From: "Pierre Muller" <muller@ics.u-strasbg.fr>
To: <gdb-patches@sourceware.org>
Subject: RE: [RFC] win32-nat.c 'set new-console' and interruption
Date: Mon, 23 Jun 2008 16:05:00 -0000 [thread overview]
Message-ID: <001001c8d53c$a773fe50$f65bfaf0$@u-strasbg.fr> (raw)
In-Reply-To: <20080623114505.GA9244@ednor.casa.cgf.cx>
> -----Message d'origine-----
> De : gdb-patches-owner@sourceware.org [mailto:gdb-patches-
> owner@sourceware.org] De la part de Christopher Faylor
> Envoyé : Monday, June 23, 2008 1:45 PM
> À : gdb-patches@sourceware.org; Pierre Muller
> Objet : Re: [RFC] win32-nat.c 'set new-console' and interruption
>
> On Mon, Jun 23, 2008 at 09:17:39AM +0200, Pierre Muller wrote:
> >I will resend a new patch proposal that complies with the lowercase
> >coding standard rule shortly.
>
> That was only the most minor problem. The race condition is something
> that needs to be addressed before the patch can be considered.
I agree with you on this.
I have a proposal to remove that possible race condition:
The exception record has a field that contains the exception
address, if I test that there is no GDB inserted breakpoint at
that location before converting the TARGET_SIGNAL_TRAP
into a TARGET_SIGNAL_INT, it should fix most problems, no?
The one case that it would still not catch would be
a 'int 3' instruction that is in the debuggee code from the start
but other than at startup, such instructions are quite unlikely, no?
Is this a sufficient fix for the possible race or
should I try harder?
Pierre Muller
Pascal language support maintainer for GDB
PS: I have two code formatting issues in my modified code:
1) the CORE_ADDR addr assignment line goes past the 80 row boundary,
even if I put the current_event on a separate line
would
+ CORE_ADDR addr = (CORE_ADDR)
+ current_event.u.Exception.ExceptionRecord.ExceptionAddress;
be acceptable to avoid going past 80?
2) For the DEBUG_EXCEPT macro use that I added,
I am also unsure about the formatting, as I had
to cut the line within the string.
Modified code to remove the race condition
between an exception create by DebugBreakProcess
and an exception created by the 'int 3' instruction
inserted by GDB for breakpoints.
@@ -1076,7 +1079,22 @@ handle_exception (struct target_waitstat
break;
case EXCEPTION_BREAKPOINT:
DEBUG_EXCEPTION_SIMPLE ("EXCEPTION_BREAKPOINT");
- ourstatus->value.sig = TARGET_SIGNAL_TRAP;
+ if (ctrl_break_sent)
+
+ {
+ CORE_ADDR addr =
+ (CORE_ADDR)
current_event.u.Exception.ExceptionRecord.ExceptionAddress;
+
+ if (!breakpoint_inserted_here_p (addr))
+ {
+ DEBUG_EXCEPT (("EXCEPTION_BREAKPOINT at 0x%lx converted to \
+TARGET_SIGNAL_INT\n", (DWORD) addr));
+ ctrl_break_sent = 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");
next prev parent reply other threads:[~2008-06-23 14:23 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-21 17:05 Pierre Muller
2008-06-21 18:37 ` Christopher Faylor
2008-06-22 3:17 ` Daniel Jacobowitz
2008-06-22 3:18 ` Corinna Vinschen
2008-06-23 1:04 ` Christopher Faylor
2008-06-23 1:10 ` Corinna Vinschen
2008-06-23 7:40 ` Pierre Muller
2008-06-23 12:00 ` Christopher Faylor
2008-06-23 16:05 ` Pierre Muller [this message]
2008-06-23 17:00 ` Pedro Alves
2008-06-23 17:25 ` Pierre Muller
2008-06-23 18:03 ` Christopher Faylor
2008-06-23 19:24 ` Pedro Alves
2008-06-23 20:33 ` Pierre Muller
2008-06-23 21:06 ` Joel Brobecker
2008-06-24 6:33 ` Christopher Faylor
2008-06-24 13:36 ` [RFC-v3] " Pierre Muller
2008-06-24 2:33 ` [RFC] " Christopher Faylor
2008-06-24 13:54 ` Pedro Alves
2008-06-24 18:29 ` Christopher Faylor
2008-06-22 9:00 ` Christopher Faylor
2008-06-23 8:52 ` [RFC v2] " Pierre Muller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='001001c8d53c$a773fe50$f65bfaf0$@u-strasbg.fr' \
--to=muller@ics.u-strasbg.fr \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox