Index: win32-nat.c =================================================================== RCS file: /cvs/src/src/gdb/win32-nat.c,v retrieving revision 1.119 diff -u -p -r1.119 win32-nat.c --- win32-nat.c 24 Jan 2006 22:09:28 -0000 1.119 +++ win32-nat.c 2 Feb 2006 11:44:08 -0000 @@ -83,12 +83,6 @@ static unsigned dr[8]; static int debug_registers_changed; static int debug_registers_used; -/* The string sent by cygwin when it processes a signal. - FIXME: This should be in a cygwin include file. */ -#ifndef _CYGWIN_SIGNAL_STRING -#define _CYGWIN_SIGNAL_STRING "cYgSiGw00f" -#endif - #define CHECK(x) check (x, __FILE__,__LINE__) #define DEBUG_EXEC(x) if (debug_exec) printf_unfiltered x #define DEBUG_EVENTS(x) if (debug_events) printf_unfiltered x @@ -126,6 +120,12 @@ static DEBUG_EVENT current_event; /* The static HANDLE current_process_handle; /* Currently executing process */ static thread_info *current_thread; /* Info on currently selected thread */ static DWORD main_thread_id; /* Thread ID of the main thread */ +static int ignoring_faults; /* If true, the inferior has signaled + that it is doing parameter checking + and has supplied its own + EXCEPTION_ACCESS_VIOLATION handler, + and there is no need to act on + them here. */ /* Counts of things. */ static int exception_count = 0; @@ -905,12 +905,7 @@ handle_output_debug_string (struct targe || !s || !*s) return gotasig; - if (strncmp (s, _CYGWIN_SIGNAL_STRING, sizeof (_CYGWIN_SIGNAL_STRING) - 1) != 0) - { - if (strncmp (s, "cYg", 3) != 0) - warning (("%s"), s); - } - else + if (strncmp (s, _CYGWIN_SIGNAL_STRING, sizeof (_CYGWIN_SIGNAL_STRING) - 1) == 0) { char *p; int sig = strtol (s + sizeof (_CYGWIN_SIGNAL_STRING) - 1, &p, 0); @@ -919,6 +914,21 @@ handle_output_debug_string (struct targe if (gotasig) ourstatus->kind = TARGET_WAITKIND_STOPPED; } + else if (strncmp (s, _CYGWIN_FAULT_IGNORE_STRING, + sizeof (_CYGWIN_FAULT_IGNORE_STRING) - 1) == 0) + { + ignoring_faults = TRUE; + } + else if (strncmp (s, _CYGWIN_FAULT_NOIGNORE_STRING, + sizeof (_CYGWIN_FAULT_NOIGNORE_STRING) - 1) == 0) + { + ignoring_faults = FALSE; + } + else + { + if (strncmp (s, "cYg", 3) != 0) + warning (("%s"), s); + } xfree (s); return gotasig; @@ -1066,10 +1076,11 @@ handle_exception (struct target_waitstat ourstatus->value.sig = TARGET_SIGNAL_SEGV; { char *fn; - if (find_pc_partial_function ((CORE_ADDR) current_event.u.Exception - .ExceptionRecord.ExceptionAddress, - &fn, NULL, NULL) - && strncmp (fn, "KERNEL32!IsBad", strlen ("KERNEL32!IsBad")) == 0) + if (ignoring_faults + || (find_pc_partial_function ((CORE_ADDR) current_event.u.Exception + .ExceptionRecord.ExceptionAddress, + &fn, NULL, NULL) + && strncmp (fn, "KERNEL32!IsBad", strlen ("KERNEL32!IsBad")) == 0)) return 0; } break; @@ -1434,6 +1445,7 @@ do_initial_win32_stuff (DWORD pid) exception_count = 0; debug_registers_changed = 0; debug_registers_used = 0; + ignoring_faults = FALSE; for (i = 0; i < sizeof (dr) / sizeof (dr[0]); i++) dr[i] = 0; current_event.dwProcessId = pid;