aboutsummaryrefslogtreecommitdiff
path: root/gdb/linux-thread-db.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/linux-thread-db.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/linux-thread-db.c')
-rw-r--r--gdb/linux-thread-db.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/gdb/linux-thread-db.c b/gdb/linux-thread-db.c
index 4dab64a..3a3d3de 100644
--- a/gdb/linux-thread-db.c
+++ b/gdb/linux-thread-db.c
@@ -1364,7 +1364,7 @@ thread_db_target::detach (inferior *inf, int from_tty)
/* NOTE: From this point on, inferior_ptid is null_ptid. */
/* Detach the thread_db target from this inferior. */
- unpush_target (this);
+ inf->unpush_target (this);
}
ptid_t
@@ -1398,7 +1398,7 @@ thread_db_target::wait (ptid_t ptid, struct target_waitstatus *ourstatus,
/* New image, it may or may not end up using thread_db. Assume
not unless we find otherwise. */
delete_thread_db_info (beneath, ptid.pid ());
- unpush_target (this);
+ current_inferior ()->unpush_target (this);
return ptid;
}
@@ -1420,7 +1420,7 @@ thread_db_target::mourn_inferior ()
target_beneath->mourn_inferior ();
/* Detach the thread_db target from this inferior. */
- unpush_target (this);
+ current_inferior ()->unpush_target (this);
}
struct callback_data