From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10990 invoked by alias); 21 Jun 2004 15:40:33 -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 10981 invoked from network); 21 Jun 2004 15:40:33 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org with SMTP; 21 Jun 2004 15:40:33 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.10/8.12.10) with ESMTP id i5LFeXe1014333 for ; Mon, 21 Jun 2004 11:40:33 -0400 Received: from pobox.toronto.redhat.com (pobox.toronto.redhat.com [172.16.14.4]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i5LFeW000373; Mon, 21 Jun 2004 11:40:32 -0400 Received: from touchme.toronto.redhat.com (IDENT:postfix@touchme.toronto.redhat.com [172.16.14.9]) by pobox.toronto.redhat.com (8.12.8/8.12.8) with ESMTP id i5LFeVtn024541; Mon, 21 Jun 2004 11:40:32 -0400 Received: from redhat.com (toocool.toronto.redhat.com [172.16.14.72]) by touchme.toronto.redhat.com (Postfix) with ESMTP id BFA268003A5; Mon, 21 Jun 2004 11:40:31 -0400 (EDT) Message-ID: <40D7016F.1070406@redhat.com> Date: Mon, 21 Jun 2004 15:40:00 -0000 From: Jeff Johnston User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 MIME-Version: 1.0 To: gdb-patches@sources.redhat.com Cc: uweigand@de.ibm.com Subject: [RFA]: Fix for watchpoint regressions Content-Type: multipart/mixed; boundary="------------060702060703000304080109" X-SW-Source: 2004-06/txt/msg00481.txt.bz2 This is a multi-part message in MIME format. --------------060702060703000304080109 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Content-length: 470 The attached patch fixes the recent watchpoint regressions in ia64. Tested on ia64 and x86. Ok to commit? -- Jeff J. 2004-06-18 Jeff Johnston * infrun.c (handle_inferior_event): Initialize stopped_by_watchpoint to -1. * breakpoint.c (bpstat_stop_status): Move check for ignoring untriggered watchpoints to a separate if clause. Update function comment regarding STOPPED_BY_WATCHPOINT argument. --------------060702060703000304080109 Content-Type: text/plain; name="watchpoint-fix.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="watchpoint-fix.patch" Content-length: 3113 Index: breakpoint.c =================================================================== RCS file: /cvs/src/src/gdb/breakpoint.c,v retrieving revision 1.174 diff -u -p -r1.174 breakpoint.c --- breakpoint.c 7 Jun 2004 17:58:32 -0000 1.174 +++ breakpoint.c 18 Jun 2004 22:47:01 -0000 @@ -2559,8 +2559,9 @@ which its expression is valid.\n"); } /* Get a bpstat associated with having just stopped at address - BP_ADDR in thread PTID. STOPPED_BY_WATCHPOINT is true if the - target thinks we stopped due to a hardware watchpoint. */ + BP_ADDR in thread PTID. STOPPED_BY_WATCHPOINT is 1 if the + target thinks we stopped due to a hardware watchpoint, 0 if we + know we did not trigger a hardware watchpoint, and -1 if we do not know. */ /* Determine whether we stopped at a breakpoint, etc, or whether we don't understand this stop. Result is a chain of bpstat's such that: @@ -2593,15 +2594,10 @@ bpstat_stop_status (CORE_ADDR bp_addr, p if (!breakpoint_enabled (b) && b->enable_state != bp_permanent) continue; - /* Hardware watchpoints are treated as non-existent if the reason we - stopped wasn't a hardware watchpoint (we didn't stop on some data - address). Otherwise gdb won't stop on a break instruction in the code - (not from a breakpoint) when a hardware watchpoint has been defined. */ if (b->type != bp_watchpoint - && !((b->type == bp_hardware_watchpoint - || b->type == bp_read_watchpoint - || b->type == bp_access_watchpoint) - && stopped_by_watchpoint) + && b->type != bp_hardware_watchpoint + && b->type != bp_read_watchpoint + && b->type != bp_access_watchpoint && b->type != bp_hardware_breakpoint && b->type != bp_catch_fork && b->type != bp_catch_vfork @@ -2617,6 +2613,18 @@ bpstat_stop_status (CORE_ADDR bp_addr, p continue; } + /* Continuable hardware watchpoints are treated as non-existent if the + reason we stopped wasn't a hardware watchpoint (we didn't stop on + some data address). Otherwise gdb won't stop on a break instruction + in the code (not from a breakpoint) when a hardware watchpoint has + been defined. */ + + if ((b->type == bp_hardware_watchpoint + || b->type == bp_read_watchpoint + || b->type == bp_access_watchpoint) + && !stopped_by_watchpoint) + continue; + if (b->type == bp_hardware_breakpoint) { if (b->loc->address != bp_addr) Index: infrun.c =================================================================== RCS file: /cvs/src/src/gdb/infrun.c,v retrieving revision 1.166 diff -u -p -r1.166 infrun.c --- infrun.c 11 Jun 2004 23:39:51 -0000 1.166 +++ infrun.c 18 Jun 2004 22:47:02 -0000 @@ -1252,7 +1252,7 @@ handle_inferior_event (struct execution_ defined in the file "config/pa/nm-hppah.h", accesses the variable indirectly. Mutter something rude about the HP merge. */ int sw_single_step_trap_p = 0; - int stopped_by_watchpoint = 0; + int stopped_by_watchpoint = -1; /* Mark as unknown. */ /* Cache the last pid/waitstatus. */ target_last_wait_ptid = ecs->ptid; --------------060702060703000304080109--