diff options
Diffstat (limited to 'gdb/testsuite/gdb.cp/static-method.exp')
-rw-r--r-- | gdb/testsuite/gdb.cp/static-method.exp | 33 |
1 files changed, 33 insertions, 0 deletions
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. |