diff options
Diffstat (limited to 'gdb/linux-nat.c')
-rw-r--r-- | gdb/linux-nat.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c index 8f5f978..70f77fd 100644 --- a/gdb/linux-nat.c +++ b/gdb/linux-nat.c @@ -2129,7 +2129,7 @@ linux_handle_extended_wait (struct lwp_info *lp, int status) open_proc_mem_file (lp->ptid); ourstatus->set_execd - (make_unique_xstrdup (linux_proc_pid_to_exec_file (pid))); + (make_unique_xstrdup (linux_target->pid_to_exec_file (pid))); /* The thread that execed must have been resumed, but, when a thread execs, it changes its tid to the tgid, and the old @@ -4000,7 +4000,14 @@ linux_nat_target::thread_name (struct thread_info *thr) const char * linux_nat_target::pid_to_exec_file (int pid) { - return linux_proc_pid_to_exec_file (pid); + /* If there's no sysroot. Or the sysroot is just 'target:' and the + inferior is in the same mount namespce, then we can consider the + filesystem local. */ + bool local_fs = (gdb_sysroot.empty () + || (gdb_sysroot == TARGET_SYSROOT_PREFIX + && linux_ns_same (pid, LINUX_NS_MNT))); + + return linux_proc_pid_to_exec_file (pid, local_fs); } /* Object representing an /proc/PID/mem open file. We keep one such @@ -4721,9 +4728,7 @@ maintenance_info_lwps (const char *arg, int from_tty) } } -void _initialize_linux_nat (); -void -_initialize_linux_nat () +INIT_GDB_FILE (linux_nat) { add_setshow_boolean_cmd ("linux-nat", class_maintenance, &debug_linux_nat, _("\ |