Don't write to inferior_ptid in go32-nat.c
[deliverable/binutils-gdb.git] / gdb / nat / windows-nat.c
index 94e7f572c0a46447d477ae2a2609f2c0502d465d..709a9d3a31b802893b34991e0e0f0cecd0102f5b 100644 (file)
@@ -20,9 +20,6 @@
 #include "nat/windows-nat.h"
 #include "gdbsupport/common-debug.h"
 
-#define STATUS_WX86_BREAKPOINT 0x4000001F
-#define STATUS_WX86_SINGLE_STEP 0x4000001E
-
 namespace windows_nat
 {
 
@@ -44,13 +41,16 @@ DWORD desired_stop_thread_id = -1;
 std::vector<pending_stop> pending_stops;
 EXCEPTION_RECORD siginfo_er;
 
+#ifdef __x86_64__
+bool ignore_first_breakpoint = false;
+#endif
+
 /* Note that 'debug_events' must be locally defined in the relevant
    functions.  */
 #define DEBUG_EVENTS(x)        if (debug_events) debug_printf x
 
 windows_thread_info::~windows_thread_info ()
 {
-  CloseHandle (h);
 }
 
 void
@@ -183,26 +183,8 @@ handle_exception (struct target_waitstatus *ourstatus, bool debug_exceptions)
     case EXCEPTION_ACCESS_VIOLATION:
       DEBUG_EXCEPTION_SIMPLE ("EXCEPTION_ACCESS_VIOLATION");
       ourstatus->value.sig = GDB_SIGNAL_SEGV;
-#ifdef __CYGWIN__
-      {
-       /* See if the access violation happened within the cygwin DLL
-          itself.  Cygwin uses a kind of exception handling to deal
-          with passed-in invalid addresses.  gdb should not treat
-          these as real SEGVs since they will be silently handled by
-          cygwin.  A real SEGV will (theoretically) be caught by
-          cygwin later in the process and will be sent as a
-          cygwin-specific-signal.  So, ignore SEGVs if they show up
-          within the text segment of the DLL itself.  */
-       const char *fn;
-       CORE_ADDR addr = (CORE_ADDR) (uintptr_t) rec->ExceptionAddress;
-
-       if ((!cygwin_exceptions && (addr >= cygwin_load_start
-                                   && addr < cygwin_load_end))
-           || (find_pc_partial_function (addr, &fn, NULL, NULL)
-               && startswith (fn, "KERNEL32!IsBad")))
-         return HANDLE_EXCEPTION_UNHANDLED;
-      }
-#endif
+      if (handle_access_violation (rec))
+       return HANDLE_EXCEPTION_UNHANDLED;
       break;
     case STATUS_STACK_OVERFLOW:
       DEBUG_EXCEPTION_SIMPLE ("STATUS_STACK_OVERFLOW");
This page took 0.024565 seconds and 4 git commands to generate.