From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7175 invoked by alias); 19 May 2010 19:51:09 -0000 Received: (qmail 7155 invoked by uid 48); 19 May 2010 19:51:08 -0000 Date: Wed, 19 May 2010 19:51:00 -0000 From: "jan dot kratochvil at redhat dot com" To: gdb-prs@sourceware.org Message-ID: <20100519195106.11613.jan.kratochvil@redhat.com> Reply-To: sourceware-bugzilla@sourceware.org Subject: [Bug breakpoints/11613] New: hardware watchpoint missed for -O2 -g inferior X-Bugzilla-Reason: CC Mailing-List: contact gdb-prs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-prs-owner@sourceware.org X-SW-Source: 2010-q2/txt/msg00286.txt.bz2 ==> 1.c <== int g (int j) { int l = j + 2; return l; } extern int f (int i); int main (int argc, char **argv) { f (1); return 0; } ==> 2.c <== extern int g (int j); int f (int i) { i++; g (2); return g (i); } gcc 1.c 2.s -Wall -o 1 -m32 # Tested with gcc-4.4.3-4.fc12.x86_64 but 1.c -> 2.s is attached precompiled. Works using 'set can-use-hw-watchpoints 0' workaround: $ gdb -nx -ex 'set can-use-hw-watchpoints 0' -ex 'b f' -ex r -ex 'p i' -ex 'watch i' -ex 'adv 7' -ex 'p i' ./1 $1 = 1 Watchpoint 2: i Watchpoint 2: i Old value = 1 New value = 2 f (i=2) at 2.c:6 6 g (2); $2 = 2 Does not work without the workaround: $ gdb -nx -ex 'b f' -ex r -ex 'p i' -ex 'watch i' -ex 'adv 7' -ex 'p i' ./1 $1 = 1 Hardware watchpoint 2: i f (i=2) at 2.c:7 7 return g (i); $2 = 2 The value has changed but the breakpoint has not triggered. <2><3e>: Abbrev Number: 3 (DW_TAG_formal_parameter) <3f> DW_AT_name : i <43> DW_AT_type : <0x4c> <47> DW_AT_location : 0x0 (location list) Contents of the .debug_loc section: Offset Begin End Expression 00000000 080483d0 080483da (DW_OP_fbreg: 0) 00000000 080483da 080483f1 (DW_OP_breg3: 1; DW_OP_stack_value) 00000000 -- Summary: hardware watchpoint missed for -O2 -g inferior Product: gdb Version: unknown Status: UNCONFIRMED Severity: normal Priority: P2 Component: breakpoints AssignedTo: unassigned at sourceware dot org ReportedBy: jan dot kratochvil at redhat dot com CC: gdb-prs at sourceware dot org,sergiodj at redhat dot com GCC target triplet: i386-unknown-linux-gnu http://sourceware.org/bugzilla/show_bug.cgi?id=11613 ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.