From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5162 invoked by alias); 14 Dec 2012 08:12:10 -0000 Received: (qmail 5132 invoked by uid 48); 14 Dec 2012 08:12:05 -0000 From: "karthikthecool at gmail dot com" To: gdb-prs@sourceware.org Subject: [Bug gdb/14959] New: Software watchpoint deleted when we have a call to @plt function Date: Fri, 14 Dec 2012 08:12:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: gdb X-Bugzilla-Keywords: X-Bugzilla-Severity: critical X-Bugzilla-Who: karthikthecool at gmail dot com X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 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: 2012-q4/txt/msg00393.txt.bz2 http://sourceware.org/bugzilla/show_bug.cgi?id=14959 Bug #: 14959 Summary: Software watchpoint deleted when we have a call to @plt function Product: gdb Version: HEAD Status: NEW Severity: critical Priority: P2 Component: gdb AssignedTo: unassigned@sourceware.org ReportedBy: karthikthecool@gmail.com Classification: Unclassified Hi All, I was trying to debug the following program in GDB - #include int global = 0; void func2() { global = 0; printf("global = %d \n",global); } int main() { int q = 0; func2(); q = 1; return 0; } When we try to set a software watchpoint on q and execute the program. The watchpoint gets deleted as soon as a call to printf is made. Debugging session snippet - (gdb) b main Breakpoint 1 at 0x8048427: file test.c, line 13. (gdb) r Starting program: /home/kv.bhat/OpenSourceProject/a.out Breakpoint 1, main () at test.c:13 13 int q = 0; (gdb) set can-use-hw-watchpoints 0 (gdb) watch q Watchpoint 2: q (gdb) n Watchpoint 2: q Old value = -1208201228 New value = 0 main () at test.c:14 14 func2(); (gdb) c Continuing. Watchpoint 2 deleted because the program has left the block in which its expression is valid. 0xb7fedbdb in ?? () from /lib/ld-linux.so.2 (gdb) c Continuing. global = 0 Program exited normally. (gdb) Quit Call to prtinf@plt function is resulting in watch point getting deleted - Dump of assembler code for function func2: 0x080483e4 <+0>: push %ebp 0x080483e5 <+1>: mov %esp,%ebp 0x080483e7 <+3>: push %ebx 0x080483e8 <+4>: sub $0x14,%esp 0x080483eb <+7>: call 0x8048443 <__i686.get_pc_thunk.bx> 0x080483f0 <+12>: add $0x1c04,%ebx 0x080483f6 <+18>: movl $0x0,0x28(%ebx) 0x08048400 <+28>: mov 0x28(%ebx),%edx 0x08048406 <+34>: lea -0x1ad4(%ebx),%eax 0x0804840c <+40>: mov %edx,0x4(%esp) 0x08048410 <+44>: mov %eax,(%esp) => 0x08048413 <+47>: call 0x8048300 0x08048418 <+52>: add $0x14,%esp 0x0804841b <+55>: pop %ebx 0x0804841c <+56>: pop %ebp 0x0804841d <+57>: ret End of assembler dump. (gdb) ni Watchpoint 2 deleted because the program has left the block in which its expression is valid. 0xb7fedbdb in ?? () from /lib/ld-linux.so.2 -- Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.