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/breakpoint.c | |
parent | ac2d77c6a102ca785aae565aec93a3478a9f4544 (diff) | |
download | gdb-0f8e2034128e4a73e02cb8311eeeea7e886a5985.zip gdb-0f8e2034128e4a73e02cb8311eeeea7e886a5985.tar.gz gdb-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/breakpoint.c')
-rw-r--r-- | gdb/breakpoint.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index 0595c6f..dbbea6b 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -67,6 +67,7 @@ #include "thread-fsm.h" #include "tid-parse.h" #include "cli/cli-style.h" +#include "cli/cli-decode.h" /* readline include files */ #include "readline/tilde.h" @@ -8196,7 +8197,7 @@ catch_load_or_unload (const char *arg, int from_tty, int is_load, struct cmd_list_element *command) { const int enabled = 1; - bool temp = get_cmd_context (command) == CATCH_TEMPORARY; + bool temp = command->context () == CATCH_TEMPORARY; add_solib_catchpoint (arg, is_load, temp, enabled); } @@ -11280,7 +11281,7 @@ catch_fork_command_1 (const char *arg, int from_tty, const char *cond_string = NULL; catch_fork_kind fork_kind; - fork_kind = (catch_fork_kind) (uintptr_t) get_cmd_context (command); + fork_kind = (catch_fork_kind) (uintptr_t) command->context (); bool temp = (fork_kind == catch_fork_temporary || fork_kind == catch_vfork_temporary); @@ -11324,7 +11325,7 @@ catch_exec_command_1 (const char *arg, int from_tty, { struct gdbarch *gdbarch = get_current_arch (); const char *cond_string = NULL; - bool temp = get_cmd_context (command) == CATCH_TEMPORARY; + bool temp = command->context () == CATCH_TEMPORARY; if (!arg) arg = ""; @@ -15214,13 +15215,13 @@ add_catch_command (const char *name, const char *docstring, command = add_cmd (name, class_breakpoint, docstring, &catch_cmdlist); set_cmd_sfunc (command, sfunc); - set_cmd_context (command, user_data_catch); + command->set_context (user_data_catch); set_cmd_completer (command, completer); command = add_cmd (name, class_breakpoint, docstring, &tcatch_cmdlist); set_cmd_sfunc (command, sfunc); - set_cmd_context (command, user_data_tcatch); + command->set_context (user_data_tcatch); set_cmd_completer (command, completer); } |