This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[RFA] Add C++ global namespace test
- From: Keith Seitz <keiths at redhat dot com>
- To: "gdb-patches at sourceware dot org ml" <gdb-patches at sourceware dot org>
- Date: Mon, 26 Mar 2012 15:32:37 -0700
- Subject: [RFA] Add C++ global namespace test
Hi,
While working on the linespec rewrite, I noticed that there were no
tests involving the C++ global namespace ("::"). This patch adds some.
Keith
2012-03-26 Keith Seitz <keiths@redhat.com>
* gdb.cp/namespace.exp: Add breakpoint tests for functions
starting with the global namespace.
Index: testsuite/gdb.cp/namespace.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.cp/namespace.exp,v
retrieving revision 1.28
diff -u -p -r1.28 namespace.exp
--- testsuite/gdb.cp/namespace.exp 16 Jan 2012 16:21:45 -0000 1.28
+++ testsuite/gdb.cp/namespace.exp 26 Mar 2012 22:31:04 -0000
@@ -138,6 +138,11 @@ gdb_test "print AAA::xyzq('x')" \
gdb_test "break AAA::xyzq" \
"Breakpoint.*at $hex: file.*namespace.cc, line 47\\."
+# Break on a function in the global namespace.
+
+gdb_test "break ::ensureOtherRefs" \
+ "Breakpoint.*at $hex: file.*$srcfile1, line $decimal\\."
+
# Call a function in a nested namespace
gdb_test "print 'BBB::CCC::xyzq'('x')" \
@@ -153,6 +158,11 @@ gdb_test "print BBB::CCC::xyzq('x')" \
gdb_test "break BBB::CCC::xyzq" \
"Breakpoint.*at $hex: file.*namespace.cc, line 63\\."
+# Break on the same function, starting with the global namespace.
+
+gdb_test "break ::BBB::CCC::xyzq" \
+ ".*Breakpoint.*at $hex: file.*$srcfile, line 63\\."
+
# Print address of a function in a class in a namespace
gdb_test "print 'BBB::Class::xyzq'" \