diff options
author | Tom Tromey <tromey@adacore.com> | 2022-04-12 14:25:44 -0600 |
---|---|---|
committer | Tom Tromey <tromey@adacore.com> | 2022-04-14 12:12:34 -0600 |
commit | 44ac251ad202da57e134f160b6831a56a82a8cf0 (patch) | |
tree | 148a8ed6b4e99309e17e9761b30873e5e64b1c0d /gdb/windows-nat.c | |
parent | b17c7ab3808f5b781537514b28695dafaa29cb28 (diff) | |
download | gdb-44ac251ad202da57e134f160b6831a56a82a8cf0.zip gdb-44ac251ad202da57e134f160b6831a56a82a8cf0.tar.gz gdb-44ac251ad202da57e134f160b6831a56a82a8cf0.tar.bz2 |
Share handle_ms_vc_exception with gdbserver
Currently, gdb's native Windows target implements the exception-based
approach for setting thread names, but gdbserver does not. This patch
moves handle_ms_vc_exception to the shared nat/windows-nat.c code, as
preparation for adding this support to gdbserver.
Diffstat (limited to 'gdb/windows-nat.c')
-rw-r--r-- | gdb/windows-nat.c | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/gdb/windows-nat.c b/gdb/windows-nat.c index 646ddda..581eb47 100644 --- a/gdb/windows-nat.c +++ b/gdb/windows-nat.c @@ -1055,46 +1055,6 @@ display_selectors (const char * args, int from_tty) /* See nat/windows-nat.h. */ bool -windows_nat::windows_process_info::handle_ms_vc_exception - (const EXCEPTION_RECORD *rec) -{ - if (rec->NumberParameters >= 3 - && (rec->ExceptionInformation[0] & 0xffffffff) == 0x1000) - { - DWORD named_thread_id; - windows_thread_info *named_thread; - CORE_ADDR thread_name_target; - - thread_name_target = rec->ExceptionInformation[1]; - named_thread_id = (DWORD) (0xffffffff & rec->ExceptionInformation[2]); - - if (named_thread_id == (DWORD) -1) - named_thread_id = current_event.dwThreadId; - - named_thread = thread_rec (ptid_t (current_event.dwProcessId, - named_thread_id, 0), - DONT_INVALIDATE_CONTEXT); - if (named_thread != NULL) - { - int thread_name_len; - gdb::unique_xmalloc_ptr<char> thread_name - = target_read_string (thread_name_target, 1025, &thread_name_len); - if (thread_name_len > 0) - { - thread_name.get ()[thread_name_len - 1] = '\0'; - named_thread->name = std::move (thread_name); - } - } - - return true; - } - - return false; -} - -/* See nat/windows-nat.h. */ - -bool windows_nat::windows_process_info::handle_access_violation (const EXCEPTION_RECORD *rec) { |