thread_id, windows_process->desired_stop_thread_id);
if (current_event->dwDebugEventCode == EXCEPTION_DEBUG_EVENT
- && ((current_event->u.Exception.ExceptionRecord.ExceptionCode
- == EXCEPTION_BREAKPOINT)
- || (current_event->u.Exception.ExceptionRecord.ExceptionCode
- == STATUS_WX86_BREAKPOINT))
+ && is_sw_breakpoint (¤t_event->u.Exception.ExceptionRecord)
&& windows_process->windows_initialization_done)
{
ptid_t ptid = ptid_t (current_event->dwProcessId, thread_id, 0);
th->stopped_at_software_breakpoint = false;
if (windows_process->current_event.dwDebugEventCode
== EXCEPTION_DEBUG_EVENT
- && ((windows_process->current_event.u.Exception.ExceptionRecord.ExceptionCode
- == EXCEPTION_BREAKPOINT)
- || (windows_process->current_event.u.Exception.ExceptionRecord.ExceptionCode
- == STATUS_WX86_BREAKPOINT))
+ && is_sw_breakpoint (&windows_process->current_event
+ .u.Exception.ExceptionRecord)
&& windows_process->windows_initialization_done)
{
th->stopped_at_software_breakpoint = true;
virtual void store_one_register (const struct regcache *regcache,
windows_thread_info *th, int r) = 0;
+ /* Determine if ER contains a software-breakpoint. */
+ virtual bool is_sw_breakpoint (const EXCEPTION_RECORD *er) const = 0;
+
private:
windows_thread_info *add_thread (ptid_t ptid, HANDLE h, void *tlb,
windows_thread_info *th, int r) override;
void store_one_register (const struct regcache *regcache,
windows_thread_info *th, int r) override;
+
+ bool is_sw_breakpoint (const EXCEPTION_RECORD *er) const override;
};
/* The current process. */
regcache->raw_collect (r, context_ptr + x86_windows_process.mappings[r]);
}
+/* See windows-nat.h. */
+
+bool
+x86_windows_nat_target::is_sw_breakpoint (const EXCEPTION_RECORD *er) const
+{
+ return (er->ExceptionCode == EXCEPTION_BREAKPOINT
+ || er->ExceptionCode == STATUS_WX86_BREAKPOINT);
+}
+
/* Hardware watchpoint support, adapted from go32-nat.c code. */
/* Pass the address ADDR to the inferior in the I'th debug register.