aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.cp
diff options
context:
space:
mode:
authorDoug Evans <dje@google.com>2015-02-21 21:58:31 -0800
committerDoug Evans <dje@google.com>2015-02-21 21:58:31 -0800
commit96553a0cffb30d2ac6068eb71bed38ea7432073b (patch)
tree2d5c5c815a3742d1392e3d23cdf80626b6e00ebf /gdb/testsuite/gdb.cp
parente26473a140d91672765866857e2284e4a7f105b4 (diff)
downloadgdb-96553a0cffb30d2ac6068eb71bed38ea7432073b.zip
gdb-96553a0cffb30d2ac6068eb71bed38ea7432073b.tar.gz
gdb-96553a0cffb30d2ac6068eb71bed38ea7432073b.tar.bz2
PR c++/17976, symtab/17821
This patch addresses two issues. The basic problem is that "(anonymous namespace)" doesn't get entered into the symbol table because when dwarf2read.c:new_symbol_full is called the DIE has no name (dwarf2_name returns NULL). PR 17976: ptype '(anonymous namespace)' should work like any namespace PR 17821: perf issue looking up (anonymous namespace) bash$ gdb monster-program (gdb) mt set per on (gdb) mt set symbol-cache-size 0 (gdb) break (anonymous namespace)::foo Before: Command execution time: 3.266289 (cpu), 6.169030 (wall) Space used: 811429888 (+12910592 for this command) After: Command execution time: 1.264076 (cpu), 4.057408 (wall) Space used: 798781440 (+0 for this command) gdb/ChangeLog: PR c++/17976, symtab/17821 * cp-namespace.c (cp_search_static_and_baseclasses): New parameter is_in_anonymous. All callers updated. (find_symbol_in_baseclass): Ditto. (cp_lookup_nested_symbol_1): Ditto. Don't search all static blocks for symbols in an anonymous namespace. * dwarf2read.c (namespace_name): Don't call dwarf2_name, fetch DW_AT_name directly. (dwarf2_name): Convert missing namespace name to CP_ANONYMOUS_NAMESPACE_STR. gdeb/testsuite/ChangeLog: * gdb.cp/anon-ns.exp: Add test for ptype '(anonymous namespace)'.
Diffstat (limited to 'gdb/testsuite/gdb.cp')
-rw-r--r--gdb/testsuite/gdb.cp/anon-ns.exp4
1 files changed, 4 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.cp/anon-ns.exp b/gdb/testsuite/gdb.cp/anon-ns.exp
index ab9da14..d817435 100644
--- a/gdb/testsuite/gdb.cp/anon-ns.exp
+++ b/gdb/testsuite/gdb.cp/anon-ns.exp
@@ -64,5 +64,9 @@ foreach test $methods {
}
}
+# PR c++/17976
+gdb_test "ptype '(anonymous namespace)'" \
+ "type = namespace \\\(anonymous namespace\\\)"
+
gdb_exit
return 0