diff options
author | Simon Marchi <simon.marchi@efficios.com> | 2020-10-24 22:59:29 -0400 |
---|---|---|
committer | Simon Marchi <simon.marchi@polymtl.ca> | 2020-10-25 09:06:09 -0400 |
commit | 3f66685e9e92717af0cafa20480de5548aea7298 (patch) | |
tree | 03f96d39222f97ac4bb7086ba24c5754c54c3c0d /gdb/linux-thread-db.c | |
parent | a0ff652f4cacc3557795204ae5e73fa9f5d2ea30 (diff) | |
download | gdb-3f66685e9e92717af0cafa20480de5548aea7298.zip gdb-3f66685e9e92717af0cafa20480de5548aea7298.tar.gz gdb-3f66685e9e92717af0cafa20480de5548aea7298.tar.bz2 |
gdb: pass inferior to check_pid_namespace_match
Pass the inferior argument available in thread_db_inferior_created, and
use it to do most things requiring the inferior.
check_pid_namespace_match is not completely decoupled from the current
inferior yet, there are hidden references behind target_can_run, for
example. But I think this is still a good step forward.
gdb/ChangeLog:
* linux-thread-db.c (check_pid_namespace_match): Add inferior
parameter and use it.
(thread_db_inferior_created): Pass inferior argument.
Change-Id: Ib768b14fc61dcf115fe13f776691f2c2f36e0679
Diffstat (limited to 'gdb/linux-thread-db.c')
-rw-r--r-- | gdb/linux-thread-db.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/gdb/linux-thread-db.c b/gdb/linux-thread-db.c index e759ecc..7cbdfa5 100644 --- a/gdb/linux-thread-db.c +++ b/gdb/linux-thread-db.c @@ -1286,7 +1286,7 @@ thread_db_new_objfile (struct objfile *objfile) } static void -check_pid_namespace_match (void) +check_pid_namespace_match (inferior *inf) { /* Check is only relevant for local targets targets. */ if (target_can_run ()) @@ -1296,7 +1296,7 @@ check_pid_namespace_match (void) child's thread list, we'll mistakenly think it has no threads since the thread PID fields won't match the PID we give to libthread_db. */ - if (!linux_ns_same (inferior_ptid.pid (), LINUX_NS_PID)) + if (!linux_ns_same (inf->pid, LINUX_NS_PID)) { warning (_ ("Target and debugger are in different PID " "namespaces; thread lists and other data are " @@ -1312,7 +1312,7 @@ check_pid_namespace_match (void) static void thread_db_inferior_created (inferior *inf) { - check_pid_namespace_match (); + check_pid_namespace_match (inf); check_for_thread_db (); } |