Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Mark Kettenis <mark.kettenis@xs4all.nl>
To: drow@false.org
Cc: gdb-patches@sourceware.org
Subject: single-step breakpoints
Date: Tue, 25 Apr 2006 20:40:00 -0000	[thread overview]
Message-ID: <200604252039.k3PKdaZ5020227@elgar.sibelius.xs4all.nl> (raw)

Hi Daniel,

There a slight problem with insert_single_step_breakpoint() and
remove_single_step_breakpoints().  On OpenBSD, inserting a breakpoint
into the kernel-provided signal trampoline, may fail.  Unfortunately,
the caller of insert_single_step_breakpoint() never notices this, and
calls remove_single_step_breakpoints() to remove the breakpoints.
Unfortunately that makes us hit the gdb_assert() in there.

This patch makes us avoid this while still making an attempt to catch
misuse of the interface.


Index: ChangeLog
from  Mark Kettenis  <kettenis@gnu.org>

	* breakpoint.c (remove_single_step_breakpoints): Bail out early if
	no breakpoints are inserted.

Index: breakpoint.c
===================================================================
RCS file: /cvs/src/src/gdb/breakpoint.c,v
retrieving revision 1.225
diff -u -p -r1.225 breakpoint.c
--- breakpoint.c 18 Apr 2006 19:20:06 -0000 1.225
+++ breakpoint.c 25 Apr 2006 20:03:21 -0000
@@ -7726,6 +7726,9 @@ insert_single_step_breakpoint (CORE_ADDR
 void
 remove_single_step_breakpoints (void)
 {
+  if (single_step_breakpoints[0] == NULL && single_step_breakpoints[1] == NULL)
+    return;
+
   gdb_assert (single_step_breakpoints[0] != NULL);
 
   /* See insert_single_step_breakpoint for more about this deprecated


             reply	other threads:[~2006-04-25 20:40 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-25 20:40 Mark Kettenis [this message]
2006-04-25 21:02 ` Daniel Jacobowitz
2006-04-25 21:55   ` Mark Kettenis
2006-04-30  3:20     ` Mark Kettenis
2006-05-01 13:54       ` Daniel Jacobowitz
2006-05-01 16:43         ` Mark Kettenis

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=200604252039.k3PKdaZ5020227@elgar.sibelius.xs4all.nl \
    --to=mark.kettenis@xs4all.nl \
    --cc=drow@false.org \
    --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