diff options
author | Gary Benson <gbenson@redhat.com> | 2015-06-10 14:28:43 +0100 |
---|---|---|
committer | Gary Benson <gbenson@redhat.com> | 2015-06-10 14:28:43 +0100 |
commit | 9bc3a9760b22a6187fdce6abc3df8f0c1d483a21 (patch) | |
tree | 0d3c633fdf088c2e5f4af7c10a3d2da02bbc21ed /gdb/linux-thread-db.c | |
parent | 4b8b5e72451d5b9da4000b8346b20035833aa087 (diff) | |
download | gdb-9bc3a9760b22a6187fdce6abc3df8f0c1d483a21.zip gdb-9bc3a9760b22a6187fdce6abc3df8f0c1d483a21.tar.gz gdb-9bc3a9760b22a6187fdce6abc3df8f0c1d483a21.tar.bz2 |
Remove linux_proc_pid_get_ns
This commit removes linux_proc_pid_get_ns, and updates its only
caller to use linux_ns_same instead.
gdb/ChangeLog:
* linux-thread-db.c (nat/linux-namespaces.h): New include.
(check_pid_namespace_match): Use linux_ns_same rather than
linux_proc_pid_get_ns to spot PID namespace mismatches.
* nat/linux-procfs.h (linux_proc_pid_get_ns): Remove.
* nat/linux-procfs.c (linux_proc_pid_get_ns): Likewise.
Diffstat (limited to 'gdb/linux-thread-db.c')
-rw-r--r-- | gdb/linux-thread-db.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/gdb/linux-thread-db.c b/gdb/linux-thread-db.c index d6387d5..6177f39 100644 --- a/gdb/linux-thread-db.c +++ b/gdb/linux-thread-db.c @@ -42,9 +42,9 @@ #include "nat/linux-osdata.h" #include "auto-load.h" #include "cli/cli-utils.h" - #include <signal.h> #include <ctype.h> +#include "nat/linux-namespaces.h" /* GNU/Linux libthread_db support. @@ -1200,20 +1200,12 @@ 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. */ - char *our_pid_ns = linux_proc_pid_get_ns (getpid (), "pid"); - char *inferior_pid_ns = linux_proc_pid_get_ns ( - ptid_get_pid (inferior_ptid), "pid"); - - if (our_pid_ns != NULL && inferior_pid_ns != NULL - && strcmp (our_pid_ns, inferior_pid_ns) != 0) + if (!linux_ns_same (ptid_get_pid (inferior_ptid), LINUX_NS_PID)) { warning (_ ("Target and debugger are in different PID " "namespaces; thread lists and other data are " "likely unreliable")); } - - xfree (our_pid_ns); - xfree (inferior_pid_ns); } } |