This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFC] win32-nat.c 'set new-console' and interruption
- From: Christopher Faylor <cgf-use-the-mailinglist-please at sourceware dot org>
- To: gdb-patches at sourceware dot org, Pierre Muller <muller at ics dot u-strasbg dot fr>
- Date: Sat, 21 Jun 2008 13:05:21 -0400
- Subject: Re: [RFC] win32-nat.c 'set new-console' and interruption
- References: <000001c8d330$0c6b51f0$2541f5d0$@u-strasbg.fr>
On Sat, Jun 21, 2008 at 01:47:48AM +0200, Pierre Muller wrote:
>@@ -1076,7 +1079,13 @@ handle_exception (struct target_waitstat
> break;
> case EXCEPTION_BREAKPOINT:
> DEBUG_EXCEPTION_SIMPLE ("EXCEPTION_BREAKPOINT");
>- ourstatus->value.sig = TARGET_SIGNAL_TRAP;
>+ if (CtrlBreakSent)
>+ {
>+ CtrlBreakSent = 0;
>+ ourstatus->value.sig = TARGET_SIGNAL_INT;
>+ }
>+ else
>+ ourstatus->value.sig = TARGET_SIGNAL_TRAP;
> break;
> case DBG_CONTROL_C:
> DEBUG_EXCEPTION_SIMPLE ("DBG_CONTROL_C");
This seems like a race condition to me. You can't be guaranteed
that the breakpoint you're receiving is not a valid breakpoint.
It would be better to check if it is a valid breakpoint and, if
not, and iff CtrlBreakSent was true then do this.
But two other observations:
1. I believe that MixedCase like this is against GNU coding standards but,
even if it isn't, the convention in win32-nat.c is to use lowercase and
underscores: ctrl_break_sent.
2. What is newconsole good for? I never use it and wonder if it
shouldn't just be nuked. My usual refrain applies here: Is there
anything similar in regular gdb?
cgf