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 /gdb/nat/windows-nat.h | |
parent | 4eab18b566a0a10d8436eb221c606df4a2803edc (diff) | |
download | gdb-fcab58390fc7a972f499b8ae1b2ff06994b6c1fc.zip gdb-fcab58390fc7a972f499b8ae1b2ff06994b6c1fc.tar.gz gdb-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 'gdb/nat/windows-nat.h')
-rw-r--r-- | gdb/nat/windows-nat.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/gdb/nat/windows-nat.h b/gdb/nat/windows-nat.h index 9f7f8b6..450ba69 100644 --- a/gdb/nat/windows-nat.h +++ b/gdb/nat/windows-nat.h @@ -248,6 +248,8 @@ struct windows_process_info gdb::optional<pending_stop> fetch_pending_stop (bool debug_events); + const char *pid_to_exec_file (int); + private: /* Handle MS_VC_EXCEPTION when processing a stop. MS_VC_EXCEPTION is @@ -266,6 +268,18 @@ private: presumed loaded. */ void add_dll (LPVOID load_addr); + + /* Try to determine the executable filename. + + EXE_NAME_RET is a pointer to a buffer whose size is EXE_NAME_MAX_LEN. + + Upon success, the filename is stored inside EXE_NAME_RET, and + this function returns nonzero. + + Otherwise, this function returns zero and the contents of + EXE_NAME_RET is undefined. */ + + int get_exec_module_filename (char *exe_name_ret, size_t exe_name_max_len); }; /* A simple wrapper for ContinueDebugEvent that continues the last |