public inbox for gdb-prs@sourceware.org help / color / mirror / Atom feed
From: "stephane.chauveau@caps-entreprise.com" <sourceware-bugzilla@sourceware.org> To: gdb-prs@sourceware.org Subject: [Bug c++/12750] New: Fail to restore breakpoints on static functions with namespace Date: Wed, 11 May 2011 08:12:00 -0000 [thread overview] Message-ID: <bug-12750-4717@http.sourceware.org/bugzilla/> (raw) http://sourceware.org/bugzilla/show_bug.cgi?id=12750 Summary: Fail to restore breakpoints on static functions with namespace Product: gdb Version: 7.2 Status: NEW Severity: normal Priority: P2 Component: c++ AssignedTo: unassigned@sourceware.org ReportedBy: stephane.chauveau@caps-entreprise.com Created attachment 5714 --> http://sourceware.org/bugzilla/attachment.cgi?id=5714 Code sample A breakpoint set on a static function within a namespace is automatically qualified with the filename. For example, for the static function xxx::fun2() in the file main.cc , the breakpoint description becomes main.cc:xxx::fun2 Unfortunately, gdb fails to parse that syntax and so cannot restore those breakpoints after a 'run' The attached file provides a small example. Breakpoints can be successfully set on both the global function xxx::fun1 and the static function xxx::fun2 # (gdb) break main # Breakpoint 1 at 0x4005bc: file main.cc, line 20. # (gdb) run # 20 xxx::fun1() ; # (gdb) break xxx::fun1 # Breakpoint 2 at 0x40059c: file main.cc, line 9. # (gdb) break xxx::fun2 # Breakpoint 3 at 0x4005ac: file main.cc, line 13. # (gdb) cont # Breakpoint 2, xxx::fun1 () at main.cc:9 # (gdb) cont # Breakpoint 3, xxx::fun2 () at main.cc:13 # (gdb) cont # Program exited normally. However, gdb fails to restore the breakpoint on xxx::fun2 when the process is restarted: # (gdb) run # Starting program: /udd/schauvea/GDB/a.out # Error in re-setting breakpoint 3: Can't find member of namespace, class, # struct, or union named "main.cc:xxx::fun2" # Hint: try 'main.cc:xxx::fun2<TAB> or 'main.cc:xxx::fun2<ESC-?> # (Note leading single quote.) # # Breakpoint 1, main () at main.cc:20 # 20 xxx::fun1() ; The new command 'save breakpoints' shows that the breakpoint description is main.cc:xxx::fun2 which is not accepted by gdb: # (gdb) save breakpoints /dev/stdout # break main # break xxx::fun1 # break main.cc:xxx::fun2 # disable # Saved to file '/dev/stdout'. -- 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.
next reply other threads:[~2011-05-11 8:12 UTC|newest] Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top 2011-05-11 8:12 stephane.chauveau@caps-entreprise.com [this message] 2011-05-18 23:15 ` [Bug c++/12750] " keiths at redhat dot com 2011-05-18 23:17 ` keiths at redhat dot com 2011-05-31 22:14 ` cvs-commit at gcc dot gnu.org 2011-05-31 22:15 ` cvs-commit at gcc dot gnu.org 2011-05-31 22:16 ` keiths at redhat dot com 2011-07-02 19:40 ` cvs-commit at gcc dot gnu.org
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-12750-4717@http.sourceware.org/bugzilla/ \ --to=sourceware-bugzilla@sourceware.org \ --cc=gdb-prs@sourceware.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).