aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.ctf
diff options
context:
space:
mode:
authorTom de Vries <tdevries@suse.de>2022-10-12 17:02:15 +0200
committerTom de Vries <tdevries@suse.de>2022-10-12 17:02:15 +0200
commit908a926ec4ecd48571aafb560d97b927b6f94b5e (patch)
tree6e260583ade3c9c52751b23438949bdf7d990366 /gdb/testsuite/gdb.ctf
parent632ecf33a181029be7f1b7efdc687fd3dbb1a1d0 (diff)
downloadgdb-908a926ec4ecd48571aafb560d97b927b6f94b5e.zip
gdb-908a926ec4ecd48571aafb560d97b927b6f94b5e.tar.gz
gdb-908a926ec4ecd48571aafb560d97b927b6f94b5e.tar.bz2
[gdb/testsuite] Fix ctf test-cases on openSUSE Tumbleweed
When running test-case gdb.base/ctf-constvars.exp on openSUSE Tumbleweed (with system gcc version 12, providing gcc -gctf support, enabling the ctf test-cases in the gdb testsuite), I run into: ... (gdb) print vox^M 'vox' has unknown type; cast it to its declared type^M (gdb) FAIL: gdb.base/ctf-constvars.exp: print vox ... There are two causes for this: - the linker flags are missing --ctf-variables, so the information for variable vox is missing (reported in PR29468), and - the executable contains some dwarf2 due to some linked-in glibc objects, so the ctf info is ignored (reported in PR29160). By using: - -Wl,--ctf-variable, - -Wl,--strip-debug, and we can make the test-case and some similar test-cases pass. Tested on x86_64-linux. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=29160 Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=29468
Diffstat (limited to 'gdb/testsuite/gdb.ctf')
-rw-r--r--gdb/testsuite/gdb.ctf/cross-tu-cyclic.exp9
-rw-r--r--gdb/testsuite/gdb.ctf/funcreturn.exp8
-rw-r--r--gdb/testsuite/gdb.ctf/multi.exp9
3 files changed, 20 insertions, 6 deletions
diff --git a/gdb/testsuite/gdb.ctf/cross-tu-cyclic.exp b/gdb/testsuite/gdb.ctf/cross-tu-cyclic.exp
index a43e36b..ca11b73 100644
--- a/gdb/testsuite/gdb.ctf/cross-tu-cyclic.exp
+++ b/gdb/testsuite/gdb.ctf/cross-tu-cyclic.exp
@@ -24,10 +24,15 @@ standard_testfile cross-tu-cyclic-1.c cross-tu-cyclic-2.c \
cross-tu-cyclic-3.c cross-tu-cyclic-4.c
# Using `-gctf` generates full-fledged CTF debug information.
-set opts "additional_flags=-gctf -Wl,--export-dynamic"
+set opts {}
+lappend opts additional_flags=-gctf
+lappend opts ldflags=-Wl,--export-dynamic
+lappend opts ldflags=-Wl,--strip-debug
+lappend opts nowarning
+
if { [prepare_for_testing "failed to prepare" ${testfile} \
[list $srcfile $srcfile2 $srcfile3 $srcfile4] \
- [list $opts nowarnings]] } {
+ $opts] } {
return 0
}
diff --git a/gdb/testsuite/gdb.ctf/funcreturn.exp b/gdb/testsuite/gdb.ctf/funcreturn.exp
index ea01e86..1267cab 100644
--- a/gdb/testsuite/gdb.ctf/funcreturn.exp
+++ b/gdb/testsuite/gdb.ctf/funcreturn.exp
@@ -30,10 +30,14 @@ set gcc_compiled [is_c_compiler_gcc]
standard_testfile whatis.c
# Using `-gctf` generates full-fledged CTF debug information.
-set opts "additional_flags=-gctf -Wl,--export-dynamic"
+set opts {}
+lappend opts additional_flags=-gctf
+lappend opts ldflags=-Wl,--export-dynamic
+lappend opts ldflags=-Wl,--strip-debug
+lappend opts nowarning
if { [prepare_for_testing "failed to prepare" ${testfile} \
- [list $srcfile] [list $opts nowarnings]] } {
+ [list $srcfile] $opts] } {
return 0
}
diff --git a/gdb/testsuite/gdb.ctf/multi.exp b/gdb/testsuite/gdb.ctf/multi.exp
index 07fd10a..93fcbb6 100644
--- a/gdb/testsuite/gdb.ctf/multi.exp
+++ b/gdb/testsuite/gdb.ctf/multi.exp
@@ -23,10 +23,15 @@ if [skip_ctf_tests] {
standard_testfile ctf-a.c ctf-b.c ctf-c.c
# Using `-gctf` generates full-fledged CTF debug information.
-set opts "additional_flags=-gctf -Wl,--export-dynamic"
+set opts {}
+lappend opts additional_flags=-gctf
+lappend opts ldflags=-Wl,--export-dynamic
+lappend opts ldflags=-Wl,--strip-debug
+lappend opts nowarning
+
if { [prepare_for_testing "failed to prepare" ${testfile} \
[list $srcfile $srcfile2 $srcfile3] \
- [list $opts nowarnings]] } {
+ $opts] } {
return 0
}