aboutsummaryrefslogtreecommitdiff
path: root/gdb/nbsd-nat.c
diff options
context:
space:
mode:
authorKamil Rytarowski <n54@gmx.com>2020-04-12 17:04:34 +0200
committerKamil Rytarowski <n54@gmx.com>2020-04-12 19:25:35 +0200
commit51c133d547e21421c678276b0cb53383f5706781 (patch)
tree0b341915f8c814dd1b9f884cd8c4c23d8b8013e9 /gdb/nbsd-nat.c
parent54b8cbd0e4063846349634aefa8ed1a3c0ac62ca (diff)
downloadgdb-51c133d547e21421c678276b0cb53383f5706781.zip
gdb-51c133d547e21421c678276b0cb53383f5706781.tar.gz
gdb-51c133d547e21421c678276b0cb53383f5706781.tar.bz2
Implement "info proc exe" for NetBSD
Use pid_to_exec_file() to query the program. gdb/ChangeLog: * nbsd-nat.c (nbsd_nat_target::info_proc): Add do_exe.
Diffstat (limited to 'gdb/nbsd-nat.c')
-rw-r--r--gdb/nbsd-nat.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/gdb/nbsd-nat.c b/gdb/nbsd-nat.c
index 2420153..05aedf8 100644
--- a/gdb/nbsd-nat.c
+++ b/gdb/nbsd-nat.c
@@ -299,6 +299,7 @@ bool
nbsd_nat_target::info_proc (const char *args, enum info_proc_what what)
{
pid_t pid;
+ bool do_exe = false;
bool do_mappings = false;
switch (what)
@@ -306,6 +307,9 @@ nbsd_nat_target::info_proc (const char *args, enum info_proc_what what)
case IP_MAPPINGS:
do_mappings = true;
break;
+ case IP_EXE:
+ do_exe = true;
+ break;
default:
error (_("Not supported on this target."));
}
@@ -324,6 +328,14 @@ nbsd_nat_target::info_proc (const char *args, enum info_proc_what what)
printf_filtered (_("process %d\n"), pid);
+ if (do_exe)
+ {
+ const char *exe = pid_to_exec_file (pid);
+ if (exe != nullptr)
+ printf_filtered ("exe = '%s'\n", exe);
+ else
+ warning (_("unable to fetch executable path name"));
+ }
if (do_mappings)
{
size_t nvment;