aboutsummaryrefslogtreecommitdiff
path: root/gdbserver/win32-low.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gdbserver/win32-low.cc')
-rw-r--r--gdbserver/win32-low.cc30
1 files changed, 18 insertions, 12 deletions
diff --git a/gdbserver/win32-low.cc b/gdbserver/win32-low.cc
index cc314df..5a57eed 100644
--- a/gdbserver/win32-low.cc
+++ b/gdbserver/win32-low.cc
@@ -142,6 +142,17 @@ win32_require_context (windows_thread_info *th)
/* See nat/windows-nat.h. */
windows_thread_info *
+gdbserver_windows_process::find_thread (ptid_t ptid)
+{
+ thread_info *thread = find_thread_ptid (ptid);
+ if (thread == nullptr)
+ return nullptr;
+ return (windows_thread_info *) thread_target_data (thread);
+}
+
+/* See nat/windows-nat.h. */
+
+windows_thread_info *
gdbserver_windows_process::thread_rec
(ptid_t ptid, thread_disposition_type disposition)
{
@@ -150,8 +161,7 @@ gdbserver_windows_process::thread_rec
return NULL;
windows_thread_info *th = (windows_thread_info *) thread_target_data (thread);
- if (disposition != DONT_INVALIDATE_CONTEXT)
- win32_require_context (th);
+ win32_require_context (th);
return th;
}
@@ -162,7 +172,7 @@ child_add_thread (DWORD pid, DWORD tid, HANDLE h, void *tlb)
windows_thread_info *th;
ptid_t ptid = ptid_t (pid, tid, 0);
- if ((th = windows_process.thread_rec (ptid, DONT_INVALIDATE_CONTEXT)))
+ if ((th = windows_process.find_thread (ptid)))
return th;
CORE_ADDR base = (CORE_ADDR) (uintptr_t) tlb;
@@ -822,7 +832,7 @@ win32_process_target::resume (thread_resume *resume_info, size_t n)
/* Get context for the currently selected thread. */
ptid = debug_event_ptid (&windows_process.current_event);
- th = windows_process.thread_rec (ptid, DONT_INVALIDATE_CONTEXT);
+ th = windows_process.find_thread (ptid);
if (th)
{
win32_prepare_to_resume (th);
@@ -974,8 +984,7 @@ maybe_adjust_pc ()
child_fetch_inferior_registers (regcache, -1);
windows_thread_info *th
- = windows_process.thread_rec (current_thread_ptid (),
- DONT_INVALIDATE_CONTEXT);
+ = windows_process.find_thread (current_thread_ptid ());
th->stopped_at_software_breakpoint = false;
if (windows_process.current_event.dwDebugEventCode == EXCEPTION_DEBUG_EVENT
@@ -1375,8 +1384,7 @@ win32_process_target::supports_get_tib_address ()
int
win32_process_target::get_tib_address (ptid_t ptid, CORE_ADDR *addr)
{
- windows_thread_info *th;
- th = windows_process.thread_rec (ptid, DONT_INVALIDATE_CONTEXT);
+ windows_thread_info *th = windows_process.find_thread (ptid);
if (th == NULL)
return 0;
if (addr != NULL)
@@ -1397,8 +1405,7 @@ bool
win32_process_target::stopped_by_sw_breakpoint ()
{
windows_thread_info *th
- = windows_process.thread_rec (current_thread_ptid (),
- DONT_INVALIDATE_CONTEXT);
+ = windows_process.find_thread (current_thread_ptid ());
return th == nullptr ? false : th->stopped_at_software_breakpoint;
}
@@ -1424,8 +1431,7 @@ const char *
win32_process_target::thread_name (ptid_t thread)
{
windows_thread_info *th
- = windows_process.thread_rec (current_thread_ptid (),
- DONT_INVALIDATE_CONTEXT);
+ = windows_process.find_thread (current_thread_ptid ());
return th->thread_name ();
}