[commit] testsuite: KFAIL gdb.cp/static-method.exp [Re: Regression for gdb.base/sigstep.exp with .debug_types]

Jan Kratochvil
2011-12-10T16:02:27Z

On Fri, 09 Dec 2011 22:53:19 +0100, Jan Kratochvil wrote:
> Going to file it to GCC debug/ . I believe with proper GCC debug/ it would
> work. Not sure now why it worked before but it probably does not matter.

Doug has notified me it is an existing GCC PR debug/45682, it even has
a workaround in GDB but that workaround is not applicable in this case [see
the testsuite comment].

Therefore KFAILed it. (Not sure if it should be XFAIL or KFAIl but it does
not matter much.)

Checked in. Tested on x86_64-fedora16-linux-gnu.

Thanks,
Jan

http://sourceware.org/ml/gdb-cvs/2011-12/msg00083.html

--- src/gdb/testsuite/ChangeLog 2011/12/10 15:16:35 1.2974
+++ src/gdb/testsuite/ChangeLog 2011/12/10 15:58:14 1.2975
@@ -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.
--- src/gdb/testsuite/gdb.cp/static-method.exp 2011/07/18 15:15:06 1.2
+++ src/gdb/testsuite/gdb.cp/static-method.exp 2011/12/10 15:58:14 1.3
@@ -48,6 +48,23 @@
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 @@

# 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.