[RFC] win32-nat.c 'set new-console' and interruption
Christopher Faylor
cgf-use-the-mailinglist-please@sourceware.org
Sat Jun 21 18:37:00 GMT 2008
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
More information about the Gdb-patches
mailing list