diff options
author | Simon Marchi <simon.marchi@polymtl.ca> | 2021-06-25 21:35:40 -0400 |
---|---|---|
committer | Simon Marchi <simon.marchi@polymtl.ca> | 2021-06-25 21:35:40 -0400 |
commit | 0f8e2034128e4a73e02cb8311eeeea7e886a5985 (patch) | |
tree | 609b9baf7a5f167daa28b0341743aa650677f28a /gdb/guile/scm-cmd.c | |
parent | ac2d77c6a102ca785aae565aec93a3478a9f4544 (diff) | |
download | binutils-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/guile/scm-cmd.c')
-rw-r--r-- | gdb/guile/scm-cmd.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/gdb/guile/scm-cmd.c b/gdb/guile/scm-cmd.c index 39c915e..ab3dad7 100644 --- a/gdb/guile/scm-cmd.c +++ b/gdb/guile/scm-cmd.c @@ -294,7 +294,7 @@ static void cmdscm_function (struct cmd_list_element *command, const char *args, int from_tty) { - command_smob *c_smob/*obj*/ = (command_smob *) get_cmd_context (command); + command_smob *c_smob/*obj*/ = (command_smob *) command->context (); SCM arg_scm, tty_scm, result; gdb_assert (c_smob != NULL); @@ -383,7 +383,7 @@ cmdscm_completer (struct cmd_list_element *command, completion_tracker &tracker, const char *text, const char *word) { - command_smob *c_smob/*obj*/ = (command_smob *) get_cmd_context (command); + command_smob *c_smob/*obj*/ = (command_smob *) command->context (); SCM completer_result_scm; SCM text_scm, word_scm; @@ -788,7 +788,7 @@ gdbscm_register_command_x (SCM self) cmd->destroyer = cmdscm_destroyer; c_smob->command = cmd; - set_cmd_context (cmd, c_smob); + cmd->set_context (c_smob); if (gdbscm_is_true (c_smob->complete)) { |