aboutsummaryrefslogtreecommitdiff
path: root/gdb/remote-sim.c
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@polymtl.ca>2021-03-23 09:50:32 -0400
committerSimon Marchi <simon.marchi@polymtl.ca>2021-03-23 09:50:32 -0400
commitfadf6add3028d477457c809f60f07643964d7fd2 (patch)
tree6892c92baa1dc60e5e238e9bee69c0fd2fe732cc /gdb/remote-sim.c
parent70e958370c8f4dc3222b658a725571d8d2f5f98a (diff)
downloadgdb-fadf6add3028d477457c809f60f07643964d7fd2.zip
gdb-fadf6add3028d477457c809f60f07643964d7fd2.tar.gz
gdb-fadf6add3028d477457c809f60f07643964d7fd2.tar.bz2
gdb: remove unpush_target free function
unpush_target unpushes the passed-in target from the current inferior's target stack. Calling it is therefore an implicit dependency on the current global inferior. Remove that function and make the callers use the inferior::unpush_target method directly. This sometimes allows using the inferior from the context rather than the global current inferior. target_unpusher::operator() now needs to be implemented in target.c, otherwise target.h and inferior.h both need to include each other, and that wouldn't work. gdb/ChangeLog: * target.h (unpush_target): Remove, update all callers to use `inferior::unpush_target` instead. (struct target_unpusher) <operator()>: Just declare. * target.c (unpush_target): Remove. (target_unpusher::operator()): New. Change-Id: Ia5172dfb3f373e0a75b991885b50322ca2142a8c
Diffstat (limited to 'gdb/remote-sim.c')
-rw-r--r--gdb/remote-sim.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gdb/remote-sim.c b/gdb/remote-sim.c
index d511305..f72bbd2 100644
--- a/gdb/remote-sim.c
+++ b/gdb/remote-sim.c
@@ -699,7 +699,7 @@ gdbsim_target_open (const char *args, int from_tty)
operation until after we complete those operations which could
error out. */
if (gdbsim_is_open)
- unpush_target (&gdbsim_ops);
+ current_inferior ()->unpush_target (&gdbsim_ops);
len = (7 + 1 /* gdbsim */
+ strlen (" -E little")
@@ -834,7 +834,7 @@ gdbsim_target::detach (inferior *inf, int from_tty)
if (remote_debug)
fprintf_unfiltered (gdb_stdlog, "gdbsim_detach\n");
- unpush_target (this); /* calls gdbsim_close to do the real work */
+ inf->unpush_target (this); /* calls gdbsim_close to do the real work */
if (from_tty)
printf_filtered ("Ending simulator %s debugging\n", target_shortname);
}