From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6944 invoked by alias); 8 Jan 2012 12:10:29 -0000 Received: (qmail 6762 invoked by uid 22791); 8 Jan 2012 12:10:26 -0000 X-SWARE-Spam-Status: No, hits=-2.8 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO sourceware.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 08 Jan 2012 12:10:14 +0000 From: "xdegaye at gmail dot com" To: gdb-prs@sourceware.org Subject: [Bug breakpoints/13574] New: breakpoint data not consistent after source editing and run Date: Sun, 08 Jan 2012 12:10:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: breakpoints X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: xdegaye 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-q1/txt/msg00021.txt.bz2 http://sourceware.org/bugzilla/show_bug.cgi?id=13574 Bug #: 13574 Summary: breakpoint data not consistent after source editing and run Product: gdb Version: 7.3 Status: NEW Severity: normal Priority: P2 Component: breakpoints AssignedTo: unassigned@sourceware.org ReportedBy: xdegaye@gmail.com Classification: Unclassified The following gdb session shows that after inserting an empty line before a breakpoint, recompiling and re-running, then the 'info' and 'clear' commands refer to the breakpoint old line number while the 'list' command and gdb when stopping at this breakpoint, refer to the new line number. The gdb/mi '-break-list' command also reports the breakpoint old line number. === foo.c ====================== int main(int argc, char ** argv) { return 0; } === gdb session ================ $ gcc -g foo.c $ gdb-7.3.92/install/bin/gdb a.out GNU gdb (GDB) 7.3.92 Copyright (C) 2012 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-unknown-linux-gnu". For bug reporting instructions, please see: ... Reading symbols from /path/to/a.out...done. (gdb) break foo.c:3 Breakpoint 1 at 0x400487: file foo.c, line 3. (gdb) run Starting program: /path/to/a.out Breakpoint 1, main (argc=1, argv=0x7fffffffe7e8) at foo.c:3 3 return 0; (gdb) # insert a new line before the breakpoint at line 3 (gdb) shell sed -i -e "s/^\s*\({\)\s*$/\1\n/" foo.c; gcc -g foo.c (gdb) run The program being debugged has been started already. Start it from the beginning? (y or n) yes `/path/to/a.out' has changed; re-reading symbols. Starting program: /path/to/a.out Breakpoint 1, main (argc=1, argv=0x7fffffffe7e8) at foo.c:4 4 return 0; (gdb) info breakpoints Num Type Disp Enb Address What 1 breakpoint keep y 0x0000000000400487 in main at foo.c:3 breakpoint already hit 1 time (gdb) clear 4 No breakpoint at 4. (gdb) clear 3 Deleted breakpoint 1 (gdb) list 1 int main(int argc, char ** argv) 2 { 3 4 return 0; 5 } (gdb) =================== -- 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.