From 8247b8236bc5528993d9b2938bc0544a5acea21d Mon Sep 17 00:00:00 2001 From: Tankut Baris Aktemur Date: Mon, 17 Feb 2020 16:12:02 +0100 Subject: gdbserver: turn target op 'pid_to_exec_file' into a method gdbserver/ChangeLog: 2020-02-20 Tankut Baris Aktemur Turn process_stratum_target's pid_to_exec_file op into a method of process_target. * target.h (struct process_stratum_target): Remove the target op. (class process_target): Add the target op. Also add 'supports_pid_to_exec_file'. * target.cc (process_target::pid_to_exec_file): Define. (process_target::supports_pid_to_exec_file): Define. Update the derived classes and callers below. * server.cc (handle_qxfer_exec_file): Update. (handle_query): Update. * linux-low.cc (linux_target_ops): Update. (linux_process_target::supports_pid_to_exec_file): Define. (linux_process_target::pid_to_exec_file): Define. * linux-low.h (class linux_process_target): Update. * lynx-low.cc (lynx_target_ops): Update. * nto-low.cc (nto_target_ops): Update. * win32-low.cc (win32_target_ops): Update. --- gdbserver/target.h | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'gdbserver/target.h') diff --git a/gdbserver/target.h b/gdbserver/target.h index cdb3c11..d728646 100644 --- a/gdbserver/target.h +++ b/gdbserver/target.h @@ -70,14 +70,6 @@ class process_target; shared code. */ struct process_stratum_target { - /* Return the full absolute name of the executable file that was - run to create the process PID. If the executable file cannot - be determined, NULL is returned. Otherwise, a pointer to a - character string containing the pathname is returned. This - string should be copied into a buffer by the client if the string - will not be immediately used, or if it must persist. */ - char *(*pid_to_exec_file) (int pid); - /* Multiple-filesystem-aware open. Like open(2), but operating in the filesystem as it appears to process PID. Systems where all processes share a common filesystem should set this to NULL. @@ -498,6 +490,17 @@ public: /* Return true if target supports range stepping. */ virtual bool supports_range_stepping (); + + /* Return true if the pid_to_exec_file op is supported. */ + virtual bool supports_pid_to_exec_file (); + + /* Return the full absolute name of the executable file that was + run to create the process PID. If the executable file cannot + be determined, NULL is returned. Otherwise, a pointer to a + character string containing the pathname is returned. This + string should be copied into a buffer by the client if the string + will not be immediately used, or if it must persist. */ + virtual char *pid_to_exec_file (int pid); }; extern process_stratum_target *the_target; -- cgit v1.1