From: Jan Kratochvil Date: Sat, 10 Dec 2011 15:58:14 +0000 (+0000) Subject: gdb/testsuite/ X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0a00efc36491ba57434b7219394739a686f3e3d0;p=binutils-gdb.git 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. --- diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 2035a8a4d66..1a51587b498 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,13 @@ +2011-12-10 Jan Kratochvil + + * 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 * 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 e4a767e9420..21e37477858 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.