aboutsummaryrefslogtreecommitdiff
path: root/gdb/tui
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@polymtl.ca>2021-06-25 21:35:40 -0400
committerSimon Marchi <simon.marchi@polymtl.ca>2021-06-25 21:35:40 -0400
commit0f8e2034128e4a73e02cb8311eeeea7e886a5985 (patch)
tree609b9baf7a5f167daa28b0341743aa650677f28a /gdb/tui
parentac2d77c6a102ca785aae565aec93a3478a9f4544 (diff)
downloadbinutils-0f8e2034128e4a73e02cb8311eeeea7e886a5985.zip
binutils-0f8e2034128e4a73e02cb8311eeeea7e886a5985.tar.gz
binutils-0f8e2034128e4a73e02cb8311eeeea7e886a5985.tar.bz2
gdb: add context getter/setter to cmd_list_element
Straightforward replacement of get_cmd_context / set_cmd_context with cmd_list_element methods. gdb/ChangeLog: * cli/cli-decode.h (struct cmd_list_element) <set_context, context>: New. <context>: Rename to... <m_context>: ... this. * cli/cli-decode.c (set_cmd_context, get_cmd_context): Remove. * command.h (set_cmd_context, get_cmd_context): Remove, use cmd_list_element::set_context and cmd_list_element::context everywhere instead. Change-Id: I5016b0079014e3f17d1aa449ada7954473bf2b5d
Diffstat (limited to 'gdb/tui')
-rw-r--r--gdb/tui/tui-layout.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/gdb/tui/tui-layout.c b/gdb/tui/tui-layout.c
index b54e748..f9c94de 100644
--- a/gdb/tui/tui-layout.c
+++ b/gdb/tui/tui-layout.c
@@ -172,8 +172,7 @@ static void
tui_apply_layout (struct cmd_list_element *command,
const char *args, int from_tty)
{
- tui_layout_split *layout
- = (tui_layout_split *) get_cmd_context (command);
+ tui_layout_split *layout = (tui_layout_split *) command->context ();
/* Make sure the curses mode is enabled. */
tui_enable ();
@@ -858,7 +857,7 @@ This layout was created using:\n\
name, name, spec.c_str ()));
cmd = add_cmd (name, class_tui, nullptr, doc.get (), &layout_list);
- set_cmd_context (cmd, layout);
+ cmd->set_context (layout);
/* There is no API to set this. */
cmd->func = tui_apply_layout;
cmd->destroyer = destroy_layout;