Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Martin M. Hunt" <hunt@redhat.com>
To: gdb-patches@sources.redhat.com
Subject: [RFA] breakpoints.c clear_command fix
Date: Tue, 26 Mar 2002 16:02:00 -0000	[thread overview]
Message-ID: <200203270001.g2R01sJ08019@localhost.localdomain> (raw)

The clear command improperly detects overlays and fails 
to clear breakpoints if overlays are not disabled.

Tested with linux-x-mips (overlays enabled) and linux x86 native.
-- 
Martin Hunt
GDB Engineer
Red Hat, Inc.

2002-03-26  Martin M. Hunt  <hunt@redhat.com>

	* breakpoint.c (clear_command): Make the first loop 
	through breakpoints use the same conditions as the second.
	Correct both passes to properly detect when a breakpoint 
	is in an overlay.

Index: breakpoint.c
===================================================================
RCS file: /cvs/cvsfiles/devo/gdb/breakpoint.c,v
retrieving revision 1.331
diff -u -u -r1.331 breakpoint.c
--- breakpoint.c	2002/03/17 02:37:26	1.331
+++ breakpoint.c	2002/03/26 23:57:10
@@ -6445,24 +6445,20 @@
       sal = sals.sals[i];
       found = (struct breakpoint *) 0;
 
-
       while (breakpoint_chain
-      /* Why don't we check here that this is not
-         a watchpoint, etc., as we do below?
-         I can't make it fail, but don't know
-         what's stopping the failure: a watchpoint
-         of the same address as "sal.pc" should
-         wind up being deleted. */
-
-	     && (((sal.pc && (breakpoint_chain->address == sal.pc)) 
-		  && (!overlay_debugging 
-		      || breakpoint_chain->section == sal.section))
+	     && breakpoint_chain->type != bp_none
+	     && breakpoint_chain->type != bp_watchpoint
+	     && breakpoint_chain->type != bp_hardware_watchpoint
+	     && breakpoint_chain->type != bp_read_watchpoint
+	     && breakpoint_chain->type != bp_access_watchpoint
+	     && (((sal.pc && (breakpoint_chain->address == sal.pc))
+		  && (!section_is_overlay (breakpoint_chain->section)
+		      || section_is_mapped (breakpoint_chain->section)))
 		 || ((default_match || (0 == sal.pc))
 		     && breakpoint_chain->source_file != NULL
 		     && sal.symtab != NULL
-	      && STREQ (breakpoint_chain->source_file, sal.symtab->filename)
+		     && STREQ (breakpoint_chain->source_file, sal.symtab->filename)
 		     && breakpoint_chain->line_number == sal.line)))
-
 	{
 	  b1 = breakpoint_chain;
 	  breakpoint_chain = b1->next;
@@ -6478,14 +6474,13 @@
 	       && b->next->type != bp_read_watchpoint
 	       && b->next->type != bp_access_watchpoint
 	       && (((sal.pc && (b->next->address == sal.pc)) 
-		    && (!overlay_debugging || b->next->section == sal.section))
+		    && (!section_is_overlay (b->next->section)
+			|| section_is_mapped (b->next->section)))
 		   || ((default_match || (0 == sal.pc))
 		       && b->next->source_file != NULL
 		       && sal.symtab != NULL
 		       && STREQ (b->next->source_file, sal.symtab->filename)
 		       && b->next->line_number == sal.line)))
-
-
 	{
 	  b1 = b->next;
 	  b->next = b1->next;


             reply	other threads:[~2002-03-27  0:02 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-03-26 16:02 Martin M. Hunt [this message]
2002-04-05 18:10 ` Michael Snyder
2002-04-05 18:40   ` i18n; Was: " Andrew Cagney
2002-04-06  0:17     ` Eli Zaretskii
2002-04-06  7:30       ` Andrew Cagney
2002-04-08 12:24   ` Martin M. Hunt
2002-04-09 15:34     ` Michael Snyder

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=200203270001.g2R01sJ08019@localhost.localdomain \
    --to=hunt@redhat.com \
    --cc=gdb-patches@sources.redhat.com \
    /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