diff options
author | Tom Tromey <tromey@adacore.com> | 2022-04-26 14:16:57 -0600 |
---|---|---|
committer | Tom Tromey <tromey@adacore.com> | 2022-05-13 08:21:16 -0600 |
commit | fcab58390fc7a972f499b8ae1b2ff06994b6c1fc (patch) | |
tree | 71deaa52a04fb55d314b4fe78783fcb9ea9a8b16 /gdbserver | |
parent | 4eab18b566a0a10d8436eb221c606df4a2803edc (diff) | |
download | binutils-fcab58390fc7a972f499b8ae1b2ff06994b6c1fc.zip binutils-fcab58390fc7a972f499b8ae1b2ff06994b6c1fc.tar.gz binutils-fcab58390fc7a972f499b8ae1b2ff06994b6c1fc.tar.bz2 |
Implement pid_to_exec_file for Windows in gdbserver
I noticed that gdbserver did not implement pid_to_exec_file for
Windows, while gdb did implement it. This patch moves the code to
nat/windows-nat.c, so that it can be shared. This makes the gdbserver
implementation trivial.
Diffstat (limited to 'gdbserver')
-rw-r--r-- | gdbserver/win32-low.cc | 6 | ||||
-rw-r--r-- | gdbserver/win32-low.h | 5 |
2 files changed, 11 insertions, 0 deletions
diff --git a/gdbserver/win32-low.cc b/gdbserver/win32-low.cc index 5b91ab7..f941e8d 100644 --- a/gdbserver/win32-low.cc +++ b/gdbserver/win32-low.cc @@ -1515,6 +1515,12 @@ win32_process_target::thread_name (ptid_t thread) return th->thread_name (); } +const char * +win32_process_target::pid_to_exec_file (int pid) +{ + return windows_process.pid_to_exec_file (pid); +} + /* The win32 target ops object. */ static win32_process_target the_win32_target; diff --git a/gdbserver/win32-low.h b/gdbserver/win32-low.h index c5f40dd..d16f1f9 100644 --- a/gdbserver/win32-low.h +++ b/gdbserver/win32-low.h @@ -160,6 +160,11 @@ public: bool supports_stopped_by_sw_breakpoint () override; const char *thread_name (ptid_t thread) override; + + bool supports_pid_to_exec_file () override + { return true; } + + const char *pid_to_exec_file (int pid) override; }; /* The sole Windows process. */ |