From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17620 invoked by alias); 27 Mar 2002 00:02:31 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 17563 invoked from network); 27 Mar 2002 00:02:30 -0000 Received: from unknown (HELO localhost.localdomain) (12.230.181.242) by sources.redhat.com with SMTP; 27 Mar 2002 00:02:30 -0000 Received: from there (DRAGON [127.0.0.1]) by localhost.localdomain (8.11.6/8.11.6) with SMTP id g2R01sJ08019 for ; Tue, 26 Mar 2002 16:01:54 -0800 Message-Id: <200203270001.g2R01sJ08019@localhost.localdomain> Content-Type: text/plain; charset="iso-8859-1" From: "Martin M. Hunt" Organization: Red Hat Inc To: gdb-patches@sources.redhat.com Subject: [RFA] breakpoints.c clear_command fix Date: Tue, 26 Mar 2002 16:02:00 -0000 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SW-Source: 2002-03/txt/msg00513.txt.bz2 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 * 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;