From fcab58390fc7a972f499b8ae1b2ff06994b6c1fc Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Tue, 26 Apr 2022 14:16:57 -0600 Subject: 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. --- gdbserver/win32-low.cc | 6 ++++++ gdbserver/win32-low.h | 5 +++++ 2 files changed, 11 insertions(+) (limited to 'gdbserver') 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. */ -- cgit v1.1