diff options
Diffstat (limited to 'gdbserver/target.h')
-rw-r--r-- | gdbserver/target.h | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/gdbserver/target.h b/gdbserver/target.h index 1a013bb..66ca72f 100644 --- a/gdbserver/target.h +++ b/gdbserver/target.h @@ -1,5 +1,5 @@ /* Target operations for the remote server for GDB. - Copyright (C) 2002-2024 Free Software Foundation, Inc. + Copyright (C) 2002-2025 Free Software Foundation, Inc. Contributed by MontaVista Software. @@ -31,6 +31,7 @@ #include "gdbsupport/btrace-common.h" #include <vector> #include "gdbsupport/byte-vector.h" +#include <sys/stat.h> struct emit_ops; struct process_info; @@ -441,6 +442,12 @@ public: virtual int multifs_open (int pid, const char *filename, int flags, mode_t mode); + /* Multiple-filesystem-aware lstat. Like lstat(2), but operating in + the filesystem as it appears to process PID. Systems where all + processes share a common filesystem should not override this. + The default behavior is to use lstat(2). */ + virtual int multifs_lstat (int pid, const char *filename, struct stat *sb); + /* Multiple-filesystem-aware unlink. Like unlink(2), but operates in the filesystem as it appears to process PID. Systems where all processes share a common filesystem should not override this. @@ -475,6 +482,13 @@ public: caller. */ virtual const char *thread_name (ptid_t thread); + /* Return the string translation for THREAD's id. This gives the + target a chance to completely re-interpret the thread id and + present a target-specific description for displaying to the user. + Return empty if the target is fine with how an id is displayed + by default. */ + virtual std::string thread_id_str (thread_info *thread); + /* Thread ID to (numeric) thread handle: Return true on success and false for failure. Return pointer to thread handle via HANDLE and the handle's length via HANDLE_LEN. */ @@ -735,4 +749,10 @@ bool set_desired_process (); std::string target_pid_to_str (ptid_t); +static inline std::string +target_thread_id_str (thread_info *thread) +{ + return the_target->thread_id_str (thread); +} + #endif /* GDBSERVER_TARGET_H */ |