diff options
author | Simon Marchi <simon.marchi@polymtl.ca> | 2021-03-24 18:08:12 -0400 |
---|---|---|
committer | Simon Marchi <simon.marchi@polymtl.ca> | 2021-03-24 18:08:24 -0400 |
commit | 328d42d87e97c75d6e52800bfd4bc1bfdfb745d2 (patch) | |
tree | 4dee500fe0bf6acd7dcb8153aabebaa27936c564 /gdb/infcmd.c | |
parent | d777bf0df22f1048fd24999ae563e30abcbcfbe7 (diff) | |
download | gdb-328d42d87e97c75d6e52800bfd4bc1bfdfb745d2.zip gdb-328d42d87e97c75d6e52800bfd4bc1bfdfb745d2.tar.gz gdb-328d42d87e97c75d6e52800bfd4bc1bfdfb745d2.tar.bz2 |
gdb: remove current_top_target function
The current_top_target function is a hidden dependency on the current
inferior. Since I'd like to slowly move towards reducing our dependency
on the global current state, remove this function and make callers use
current_inferior ()->top_target ()
There is no expected change in behavior, but this one step towards
making those callers use the inferior from their context, rather than
refer to the global current inferior.
gdb/ChangeLog:
* target.h (current_top_target): Remove, make callers use the
current inferior instead.
* target.c (current_top_target): Remove.
Change-Id: Iccd457036f84466cdaa3865aa3f9339a24ea001d
Diffstat (limited to 'gdb/infcmd.c')
-rw-r--r-- | gdb/infcmd.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/gdb/infcmd.c b/gdb/infcmd.c index 80e6ad3..a6e9572 100644 --- a/gdb/infcmd.c +++ b/gdb/infcmd.c @@ -759,7 +759,7 @@ continue_command (const char *args, int from_tty) ensure_not_running (); } - prepare_execution_command (current_top_target (), async_exec); + prepare_execution_command (current_inferior ()->top_target (), async_exec); if (from_tty) printf_filtered (_("Continuing.\n")); @@ -877,7 +877,7 @@ step_1 (int skip_subroutines, int single_inst, const char *count_string) = strip_bg_char (count_string, &async_exec); count_string = stripped.get (); - prepare_execution_command (current_top_target (), async_exec); + prepare_execution_command (current_inferior ()->top_target (), async_exec); count = count_string ? parse_and_eval_long (count_string) : 1; @@ -1075,7 +1075,7 @@ jump_command (const char *arg, int from_tty) gdb::unique_xmalloc_ptr<char> stripped = strip_bg_char (arg, &async_exec); arg = stripped.get (); - prepare_execution_command (current_top_target (), async_exec); + prepare_execution_command (current_inferior ()->top_target (), async_exec); if (!arg) error_no_arg (_("starting address")); @@ -1155,7 +1155,7 @@ signal_command (const char *signum_exp, int from_tty) = strip_bg_char (signum_exp, &async_exec); signum_exp = stripped.get (); - prepare_execution_command (current_top_target (), async_exec); + prepare_execution_command (current_inferior ()->top_target (), async_exec); if (!signum_exp) error_no_arg (_("signal number")); @@ -1400,7 +1400,7 @@ until_command (const char *arg, int from_tty) gdb::unique_xmalloc_ptr<char> stripped = strip_bg_char (arg, &async_exec); arg = stripped.get (); - prepare_execution_command (current_top_target (), async_exec); + prepare_execution_command (current_inferior ()->top_target (), async_exec); if (arg) until_break_command (arg, from_tty, 0); @@ -1425,7 +1425,7 @@ advance_command (const char *arg, int from_tty) gdb::unique_xmalloc_ptr<char> stripped = strip_bg_char (arg, &async_exec); arg = stripped.get (); - prepare_execution_command (current_top_target (), async_exec); + prepare_execution_command (current_inferior ()->top_target (), async_exec); until_break_command (arg, from_tty, 1); } @@ -1772,7 +1772,7 @@ finish_command (const char *arg, int from_tty) gdb::unique_xmalloc_ptr<char> stripped = strip_bg_char (arg, &async_exec); arg = stripped.get (); - prepare_execution_command (current_top_target (), async_exec); + prepare_execution_command (current_inferior ()->top_target (), async_exec); if (arg) error (_("The \"finish\" command does not take any arguments.")); |