* [committed] Add option to trap cygwin exceptions
@ 2006-05-22 3:43 Christopher Faylor
2006-05-22 3:59 ` Eli Zaretskii
0 siblings, 1 reply; 3+ messages in thread
From: Christopher Faylor @ 2006-05-22 3:43 UTC (permalink / raw)
To: gdb-patches
Cygwin's exception model sometimes give false "SIGSEGV" positives which
annoy users. So, recent changes to win32-nat.c and the Cygwin DLL have
code to work around this issue. However, this means that debugging the
Cygwin DLL becomes more complicated since gdb no longer stops on
exceptions within the Cygwin DLL itself.
The patch below allow the user (i.e., Corinna or me) to override
this behavior.
I really need to take a sweep through win32-nat.c and make sure that
all of the options are documented. I plan on doing that before I
make my next release of gdb for cygwin.
cgf
2006-05-21 Christopher Faylor <cgf@timesys.com>
* 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.
--- win32-nat.c 10 Apr 2006 21:43:45 -0000 1.122
+++ win32-nat.c 21 May 2006 23:02:00 -0000
@@ -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_waitstat
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, /* 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,
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [committed] Add option to trap cygwin exceptions
2006-05-22 3:43 [committed] Add option to trap cygwin exceptions Christopher Faylor
@ 2006-05-22 3:59 ` Eli Zaretskii
2006-05-22 4:19 ` Christopher Faylor
0 siblings, 1 reply; 3+ messages in thread
From: Eli Zaretskii @ 2006-05-22 3:59 UTC (permalink / raw)
To: gdb-patches
> Date: Sun, 21 May 2006 19:03:52 -0400
> From: Christopher Faylor <me+gdb-patches@cgf.cx>
>
> Cygwin's exception model sometimes give false "SIGSEGV" positives which
> annoy users. So, recent changes to win32-nat.c and the Cygwin DLL have
> code to work around this issue. However, this means that debugging the
> Cygwin DLL becomes more complicated since gdb no longer stops on
> exceptions within the Cygwin DLL itself.
>
> The patch below allow the user (i.e., Corinna or me) to override
> this behavior.
Thanks.
However, please add to the manual the documentation of the new
command. I don't want to have undocumented commands, ever.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [committed] Add option to trap cygwin exceptions
2006-05-22 3:59 ` Eli Zaretskii
@ 2006-05-22 4:19 ` Christopher Faylor
0 siblings, 0 replies; 3+ messages in thread
From: Christopher Faylor @ 2006-05-22 4:19 UTC (permalink / raw)
To: gdb-patches, Eli Zaretskii
On Mon, May 22, 2006 at 06:43:09AM +0300, Eli Zaretskii wrote:
>However, please add to the manual the documentation of the new
>command. I don't want to have undocumented commands, ever.
>
>On Sun, May 21, 2006 at 07:03:52PM -0400, Christopher Faylor wrote:
>>I really need to take a sweep through win32-nat.c and make
>>sure that all of the options are documented. I plan on doing that
>>before I make my next release of gdb for cygwin.
cgf
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2006-05-22 3:59 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-05-22 3:43 [committed] Add option to trap cygwin exceptions Christopher Faylor
2006-05-22 3:59 ` Eli Zaretskii
2006-05-22 4:19 ` Christopher Faylor
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox