diff options
author | Tom de Vries <tdevries@suse.de> | 2022-10-12 17:02:15 +0200 |
---|---|---|
committer | Tom de Vries <tdevries@suse.de> | 2022-10-12 17:02:15 +0200 |
commit | 908a926ec4ecd48571aafb560d97b927b6f94b5e (patch) | |
tree | 6e260583ade3c9c52751b23438949bdf7d990366 /gdb/testsuite/gdb.base | |
parent | 632ecf33a181029be7f1b7efdc687fd3dbb1a1d0 (diff) | |
download | gdb-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.base')
-rw-r--r-- | gdb/testsuite/gdb.base/ctf-constvars.exp | 9 | ||||
-rw-r--r-- | gdb/testsuite/gdb.base/ctf-ptype.exp | 8 | ||||
-rw-r--r-- | gdb/testsuite/gdb.base/cvexpr.exp | 6 | ||||
-rw-r--r-- | gdb/testsuite/gdb.base/whatis.exp | 7 |
4 files changed, 24 insertions, 6 deletions
diff --git a/gdb/testsuite/gdb.base/ctf-constvars.exp b/gdb/testsuite/gdb.base/ctf-constvars.exp index 6255e9e..a5e7fe0 100644 --- a/gdb/testsuite/gdb.base/ctf-constvars.exp +++ b/gdb/testsuite/gdb.base/ctf-constvars.exp @@ -32,9 +32,14 @@ if [skip_ctf_tests] { standard_testfile .c # Using `-gctf` generates full-fledged CTF debug information. -set opts "additional_flags=-gctf" +set opts {} +lappend opts additional_flags=-gctf +lappend opts ldflags=-Wl,--strip-debug +lappend opts ldflags=-Wl,--ctf-variables +lappend opts nowarnings + if { [prepare_for_testing "failed to prepare" ${testfile} \ - [list $srcfile] [list $opts nowarnings]] } { + [list $srcfile] $opts] } { return 0 } diff --git a/gdb/testsuite/gdb.base/ctf-ptype.exp b/gdb/testsuite/gdb.base/ctf-ptype.exp index 48d39e5..28deabb 100644 --- a/gdb/testsuite/gdb.base/ctf-ptype.exp +++ b/gdb/testsuite/gdb.base/ctf-ptype.exp @@ -26,10 +26,14 @@ set gcc_compiled [is_c_compiler_gcc] standard_testfile .c # Using `-gctf` generates full-fledged CTF debug information. -set opts "additional_flags=-gctf" +set opts {} +lappend opts additional_flags=-gctf +lappend opts ldflags=-Wl,--strip-debug +lappend opts ldflags=-Wl,--ctf-variables +lappend opts nowarnings if { [prepare_for_testing "failed to prepare" ${testfile} \ - [list $srcfile] [list $opts nowarnings]] } { + [list $srcfile] $opts] } { return 0 } diff --git a/gdb/testsuite/gdb.base/cvexpr.exp b/gdb/testsuite/gdb.base/cvexpr.exp index d8437b9..272efaf 100644 --- a/gdb/testsuite/gdb.base/cvexpr.exp +++ b/gdb/testsuite/gdb.base/cvexpr.exp @@ -491,10 +491,14 @@ proc do_test {dir options} { # } +set ctf_opts {} +lappend ctf_opts additional_flags=-gctf +lappend ctf_opts ldflags=-Wl,--strip-debug + # Build up the set of debug formats for which we will run this test. set specs { {dwarf {debug}} } if ![skip_ctf_tests] { - lappend specs {ctf {"additional_flags=-gctf"}} + lappend specs [list ctf $ctf_opts] } # Setup and run the test for each debug format. diff --git a/gdb/testsuite/gdb.base/whatis.exp b/gdb/testsuite/gdb.base/whatis.exp index c19c149..5a3ff53 100644 --- a/gdb/testsuite/gdb.base/whatis.exp +++ b/gdb/testsuite/gdb.base/whatis.exp @@ -585,10 +585,15 @@ proc do_test {dir options} { "whatis applied to function with 'void' parameter type" } +set ctf_opts {} +lappend ctf_opts additional_flags=-gctf +lappend ctf_opts ldflags=-Wl,--strip-debug +lappend ctf_opts ldflags=-Wl,--ctf-variables + # Build up the set of debug formats for which we will run this test. set specs { {dwarf {debug}} } if ![skip_ctf_tests] { - lappend specs {ctf {"additional_flags=-gctf"}} + lappend specs [list ctf $ctf_opts] } # Setup and run the test for each debug format. |