From 09280ddfff174955471ddf214231a12826ef5f0f Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Sun, 21 May 2006 23:04:39 +0000 Subject: (check in missing file) * win32-nat.c (cygwin_exceptions): New variable. (handle_exception): Treat a cygwin exception like a normal exception if cygwin_exceptions is true. (_initialize_win32_nat): Add "set cygwin-exceptions" handler. --- gdb/win32-nat.c | 10 +++++++++- gdb/windows-nat.c | 10 +++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) (limited to 'gdb') diff --git a/gdb/win32-nat.c b/gdb/win32-nat.c index abbf4a3..870635d 100644 --- a/gdb/win32-nat.c +++ b/gdb/win32-nat.c @@ -142,6 +142,7 @@ static int saw_create; /* User options. */ static int new_console = 0; +static int cygwin_exceptions = 0; static int new_group = 1; static int debug_exec = 0; /* show execution */ static int debug_events = 0; /* show events from kernel */ @@ -1114,7 +1115,7 @@ handle_exception (struct target_waitstatus *ourstatus) within the text segment of the DLL itself. */ char *fn; bfd_vma addr = (bfd_vma) current_event.u.Exception.ExceptionRecord.ExceptionAddress; - if ((addr >= cygwin_load_start && addr < cygwin_load_end) + if ((!cygwin_exceptions && (addr >= cygwin_load_start && addr < cygwin_load_end)) || (find_pc_partial_function (addr, &fn, NULL, NULL) && strncmp (fn, "KERNEL32!IsBad", strlen ("KERNEL32!IsBad")) == 0)) return 0; @@ -2437,6 +2438,13 @@ Show use of shell to start subprocess."), NULL, NULL, /* FIXME: i18n: */ &setlist, &showlist); + add_setshow_boolean_cmd ("cygwin-exceptions", class_support, &cygwin_exceptions, _("\ +Break when an exception is detected in the Cygwin DLL itself."), _("\ +Show whether gdb breaks on exceptions in the Cygwin DLL itself."), NULL, + NULL, + NULL, /* FIXME: i18n: */ + &setlist, &showlist); + add_setshow_boolean_cmd ("new-console", class_support, &new_console, _("\ Set creation of new console when creating child process."), _("\ Show creation of new console when creating child process."), NULL, diff --git a/gdb/windows-nat.c b/gdb/windows-nat.c index abbf4a3..870635d 100644 --- a/gdb/windows-nat.c +++ b/gdb/windows-nat.c @@ -142,6 +142,7 @@ static int saw_create; /* User options. */ static int new_console = 0; +static int cygwin_exceptions = 0; static int new_group = 1; static int debug_exec = 0; /* show execution */ static int debug_events = 0; /* show events from kernel */ @@ -1114,7 +1115,7 @@ handle_exception (struct target_waitstatus *ourstatus) within the text segment of the DLL itself. */ char *fn; bfd_vma addr = (bfd_vma) current_event.u.Exception.ExceptionRecord.ExceptionAddress; - if ((addr >= cygwin_load_start && addr < cygwin_load_end) + if ((!cygwin_exceptions && (addr >= cygwin_load_start && addr < cygwin_load_end)) || (find_pc_partial_function (addr, &fn, NULL, NULL) && strncmp (fn, "KERNEL32!IsBad", strlen ("KERNEL32!IsBad")) == 0)) return 0; @@ -2437,6 +2438,13 @@ Show use of shell to start subprocess."), NULL, NULL, /* FIXME: i18n: */ &setlist, &showlist); + add_setshow_boolean_cmd ("cygwin-exceptions", class_support, &cygwin_exceptions, _("\ +Break when an exception is detected in the Cygwin DLL itself."), _("\ +Show whether gdb breaks on exceptions in the Cygwin DLL itself."), NULL, + NULL, + NULL, /* FIXME: i18n: */ + &setlist, &showlist); + add_setshow_boolean_cmd ("new-console", class_support, &new_console, _("\ Set creation of new console when creating child process."), _("\ Show creation of new console when creating child process."), NULL, -- cgit v1.1