public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/12750] New: Fail to restore breakpoints on static functions with namespace
@ 2011-05-11 8:12 stephane.chauveau@caps-entreprise.com
2011-05-18 23:15 ` [Bug c++/12750] " keiths at redhat dot com
` (5 more replies)
0 siblings, 6 replies; 7+ messages in thread
From: stephane.chauveau@caps-entreprise.com @ 2011-05-11 8:12 UTC (permalink / raw)
To: gdb-prs
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.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c++/12750] Fail to restore breakpoints on static functions with namespace
2011-05-11 8:12 [Bug c++/12750] New: Fail to restore breakpoints on static functions with namespace stephane.chauveau@caps-entreprise.com
@ 2011-05-18 23:15 ` keiths at redhat dot com
2011-05-18 23:17 ` keiths at redhat dot com
` (4 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: keiths at redhat dot com @ 2011-05-18 23:15 UTC (permalink / raw)
To: gdb-prs
http://sourceware.org/bugzilla/show_bug.cgi?id=12750
Keith Seitz <keiths at redhat dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
CC| |keiths at redhat dot com
--- Comment #1 from Keith Seitz <keiths at redhat dot com> 2011-05-18 23:15:09 UTC ---
I noticed this bug while working on c++/12704, so I am picking this up. This is
another linespec bug. I'll be submitting a patch for this soon.
--
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.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c++/12750] Fail to restore breakpoints on static functions with namespace
2011-05-11 8:12 [Bug c++/12750] New: Fail to restore breakpoints on static functions with namespace stephane.chauveau@caps-entreprise.com
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
` (3 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: keiths at redhat dot com @ 2011-05-18 23:17 UTC (permalink / raw)
To: gdb-prs
http://sourceware.org/bugzilla/show_bug.cgi?id=12750
Keith Seitz <keiths at redhat dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at sourceware |keiths at redhat dot com
|dot org |
--
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.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c++/12750] Fail to restore breakpoints on static functions with namespace
2011-05-11 8:12 [Bug c++/12750] New: Fail to restore breakpoints on static functions with namespace stephane.chauveau@caps-entreprise.com
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
` (2 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2011-05-31 22:14 UTC (permalink / raw)
To: gdb-prs
http://sourceware.org/bugzilla/show_bug.cgi?id=12750
--- Comment #2 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> 2011-05-31 22:13:55 UTC ---
CVSROOT: /cvs/src
Module name: src
Changes by: kseitz@sourceware.org 2011-05-31 22:13:52
Modified files:
gdb : ChangeLog linespec.c
Log message:
PR c++/12750
* linespec.c (get_search_block): New function.
(find_methods): Add FILE_SYMTATB parameter and use it and
get_search_block to pass an appropriate block to
lookup_symbol_in_namespace.
(decode_line_1): Record if *ARGPTR is single-quote enclosed.
Check if *ARGPTR starts with a filename first.
If it does, call locate_first_half again to locate the next
"first half" of the linespec.
Pass FILE_SYMTATB to decode_objc and decode_compound.
Swallow the trailing single-quote if IS_SQUOTE_ENCLOSED.
(locate_first_half): Stop on the first colon seen.
(decode_compound): Add FILE_SYMTAB parameter.
Pass FILE_SYMTAB to lookup_prefix_sym and find_method.
(lookup_prefix_sym): Add FILE_SYMTAB parameter and use
get_search_block with lookup_symbol.
(find_method): Add FILE_SYMTAB parameter and pass it to
find_methods.
(decode_objc): Use get_search_block.
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/ChangeLog.diff?cvsroot=src&r1=1.13070&r2=1.13071
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/linespec.c.diff?cvsroot=src&r1=1.121&r2=1.122
--
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.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c++/12750] Fail to restore breakpoints on static functions with namespace
2011-05-11 8:12 [Bug c++/12750] New: Fail to restore breakpoints on static functions with namespace stephane.chauveau@caps-entreprise.com
` (2 preceding siblings ...)
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
5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2011-05-31 22:15 UTC (permalink / raw)
To: gdb-prs
http://sourceware.org/bugzilla/show_bug.cgi?id=12750
--- Comment #3 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> 2011-05-31 22:14:23 UTC ---
CVSROOT: /cvs/src
Module name: src
Changes by: kseitz@sourceware.org 2011-05-31 22:14:21
Modified files:
gdb/testsuite : ChangeLog
Added files:
gdb/testsuite/gdb.cp: static-method.cc static-method.exp
Log message:
PR c++/12750
* gdb.cp/static-method.cc: New file.
* gdb.cp/static-method.exp: New file.
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/ChangeLog.diff?cvsroot=src&r1=1.2735&r2=1.2736
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/gdb.cp/static-method.cc.diff?cvsroot=src&r1=NONE&r2=1.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/gdb.cp/static-method.exp.diff?cvsroot=src&r1=NONE&r2=1.1
--
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.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c++/12750] Fail to restore breakpoints on static functions with namespace
2011-05-11 8:12 [Bug c++/12750] New: Fail to restore breakpoints on static functions with namespace stephane.chauveau@caps-entreprise.com
` (3 preceding siblings ...)
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
5 siblings, 0 replies; 7+ messages in thread
From: keiths at redhat dot com @ 2011-05-31 22:16 UTC (permalink / raw)
To: gdb-prs
http://sourceware.org/bugzilla/show_bug.cgi?id=12750
Keith Seitz <keiths at redhat dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
--- Comment #4 from Keith Seitz <keiths at redhat dot com> 2011-05-31 22:15:09 UTC ---
Patch committed. If there are any further problems, please let me know.
--
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.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c++/12750] Fail to restore breakpoints on static functions with namespace
2011-05-11 8:12 [Bug c++/12750] New: Fail to restore breakpoints on static functions with namespace stephane.chauveau@caps-entreprise.com
` (4 preceding siblings ...)
2011-05-31 22:16 ` keiths at redhat dot com
@ 2011-07-02 19:40 ` cvs-commit at gcc dot gnu.org
5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2011-07-02 19:40 UTC (permalink / raw)
To: gdb-prs
http://sourceware.org/bugzilla/show_bug.cgi?id=12750
--- Comment #5 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> 2011-07-02 19:40:16 UTC ---
CVSROOT: /cvs/src
Module name: src
Branch: gdb_7_3-branch
Changes by: jkratoch@sourceware.org 2011-07-02 19:40:12
Modified files:
gdb : ChangeLog linespec.c
Log message:
commit 835cf7647bf08d33e2c7286b45658cc58704b363
Author: Keith Seitz <keiths@redhat.com>
Date: Tue May 31 22:13:51 2011 +0000
gdb/
PR c++/12750
* linespec.c (get_search_block): New function.
(find_methods): Add FILE_SYMTATB parameter and use it and
get_search_block to pass an appropriate block to
lookup_symbol_in_namespace.
(decode_line_1): Record if *ARGPTR is single-quote enclosed.
Check if *ARGPTR starts with a filename first.
If it does, call locate_first_half again to locate the next
"first half" of the linespec.
Pass FILE_SYMTATB to decode_objc and decode_compound.
Swallow the trailing single-quote if IS_SQUOTE_ENCLOSED.
(locate_first_half): Stop on the first colon seen.
(decode_compound): Add FILE_SYMTAB parameter.
Pass FILE_SYMTAB to lookup_prefix_sym and find_method.
(lookup_prefix_sym): Add FILE_SYMTAB parameter and use
get_search_block with lookup_symbol.
(find_method): Add FILE_SYMTAB parameter and pass it to
find_methods.
(decode_objc): Use get_search_block.
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/ChangeLog.diff?cvsroot=src&only_with_tag=gdb_7_3-branch&r1=1.12887.2.47&r2=1.12887.2.48
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/linespec.c.diff?cvsroot=src&only_with_tag=gdb_7_3-branch&r1=1.117.2.3&r2=1.117.2.4
--
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.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2011-07-02 19:40 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-11 8:12 [Bug c++/12750] New: Fail to restore breakpoints on static functions with namespace stephane.chauveau@caps-entreprise.com
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
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).