aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Kratochvil <jan.kratochvil@redhat.com>2011-12-10 15:58:14 +0000
committerJan Kratochvil <jan.kratochvil@redhat.com>2011-12-10 15:58:14 +0000
commit0a00efc36491ba57434b7219394739a686f3e3d0 (patch)
treea4e167e91b5490a4f77dae618d254ddca7e23274
parent4511b1ba87abd6e84846dcfd38087653a7ddbd89 (diff)
downloadgdb-0a00efc36491ba57434b7219394739a686f3e3d0.zip
gdb-0a00efc36491ba57434b7219394739a686f3e3d0.tar.gz
gdb-0a00efc36491ba57434b7219394739a686f3e3d0.tar.bz2
gdb/testsuite/
* gdb.cp/static-method.exp (have_gcc_45682_fixed, info addr A::func()): New variable, new test. (list static-method.cc:xxx::(anonymous namespace)::A::func) (list 'static-method.cc:xxx::(anonymous namespace)::A::func') (list 'static-method.cc':'xxx::(anonymous namespace)::A::func') (list static-method.cc:'xxx::(anonymous namespace)::A::func'): KFAIL them if HAVE_GCC_45682_FIXED is not set.
-rw-r--r--gdb/testsuite/ChangeLog10
-rw-r--r--gdb/testsuite/gdb.cp/static-method.exp33
2 files changed, 43 insertions, 0 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 2035a8a..1a51587 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,13 @@
+2011-12-10 Jan Kratochvil <jan.kratochvil@redhat.com>
+
+ * gdb.cp/static-method.exp (have_gcc_45682_fixed, info addr A::func()):
+ New variable, new test.
+ (list static-method.cc:xxx::(anonymous namespace)::A::func)
+ (list 'static-method.cc:xxx::(anonymous namespace)::A::func')
+ (list 'static-method.cc':'xxx::(anonymous namespace)::A::func')
+ (list static-method.cc:'xxx::(anonymous namespace)::A::func'): KFAIL
+ them if HAVE_GCC_45682_FIXED is not set.
+
2011-12-10 Yao Qi <yao@codesourcery.com>
* gdb.trace/status-stop.exp: New.
diff --git a/gdb/testsuite/gdb.cp/static-method.exp b/gdb/testsuite/gdb.cp/static-method.exp
index e4a767e..21e3747 100644
--- a/gdb/testsuite/gdb.cp/static-method.exp
+++ b/gdb/testsuite/gdb.cp/static-method.exp
@@ -48,6 +48,23 @@ if {[prepare_for_testing $testfile $testfile $srcfile {c++ debug}]} {
return -1
}
+# The GDB workaround for GCC PR debug/45682 does not apply as it requires
+# DW_AT_linkage_name of methods. The whole class A is in anonymous namespace,
+# therefore not accessible outside of the CU (compilation unit) and therefore
+# GCC does not produce DW_AT_linkage_name for such methods.
+
+set have_gcc_45682_fixed 1
+set test "info addr A::func()"
+gdb_test_multiple $test $test {
+ -re "No symbol \"A::func\\(\\)\" in current context\\.\r\n$gdb_prompt $" {
+ pass $test
+ }
+ -re "Symbol \"A::func\\(\\)\" is a function at address .*\r\n$gdb_prompt $" {
+ kfail gcc/45682 $test
+ set have_gcc_45682_fixed 0
+ }
+}
+
if {![runto_main]} {
perror "couldn't run to breakpoint"
continue
@@ -68,9 +85,25 @@ foreach test $methods {
# Test whether the function/method can be "list"ed
# with the filename pre-pended.
+ if {[string compare $test "xxx::${ans}::A::func"] == 0
+ && !$have_gcc_45682_fixed} {
+ setup_kfail gcc/45682 "*-*-*"
+ }
gdb_test "list ${srcfile}:$test" $result
+ if {[string compare $test "xxx::${ans}::A::func"] == 0
+ && !$have_gcc_45682_fixed} {
+ setup_kfail gcc/45682 "*-*-*"
+ }
gdb_test "list '${srcfile}:$test'" $result
+ if {[string compare $test "xxx::${ans}::A::func"] == 0
+ && !$have_gcc_45682_fixed} {
+ setup_kfail gcc/45682 "*-*-*"
+ }
gdb_test "list '${srcfile}':'$test'" $result
+ if {[string compare $test "xxx::${ans}::A::func"] == 0
+ && !$have_gcc_45682_fixed} {
+ setup_kfail gcc/45682 "*-*-*"
+ }
gdb_test "list ${srcfile}:'$test'" $result
# Test setting and hitting a breakoint at the function/method.