[gdb/testsuite] Use set always-read-ctf on instead of --strip-debug

Use "set always-read-ctf on" instead of --strip-debug in the ctf test-cases.

Tested on x86_64-linux.
This commit is contained in:
Tom de Vries 2023-03-03 16:51:57 +01:00
parent c35b7b2252
commit 9c2c346137
7 changed files with 34 additions and 13 deletions

View File

@ -31,15 +31,18 @@ standard_testfile .c
# Using `-gctf` generates full-fledged CTF debug information.
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} \
if { [build_executable "failed to prepare" ${testfile} \
[list $srcfile] $opts] } {
return 0
}
clean_restart
gdb_test_no_output "set always-read-ctf on"
gdb_load $binfile
#
# set it up at a breakpoint so we can play with the variable values
#

View File

@ -25,7 +25,6 @@ standard_testfile .c
# Using `-gctf` generates full-fledged CTF debug information.
set opts {}
lappend opts additional_flags=-gctf
lappend opts ldflags=-Wl,--strip-debug
lappend opts ldflags=-Wl,--ctf-variables
lappend opts nowarnings
@ -34,6 +33,10 @@ if { [prepare_for_testing "failed to prepare" ${testfile} \
return 0
}
clean_restart
gdb_test_no_output "set always-read-ctf on"
gdb_load $binfile
# Test ptype of unnamed enumeration members before any action causes
# the partial symbol table to be expanded to full symbols. This fails
# with stabs compilers which fail to use a nameless stab (such as

View File

@ -26,11 +26,15 @@ proc do_test {dir options} {
global srcfile testfile
set binfile [standard_output_file ${dir}/${testfile}]
if { [prepare_for_testing "failed to prepare" ${binfile} \
if { [build_executable "failed to prepare" ${binfile} \
[list $srcfile] $options] } {
return 0
}
clean_restart
gdb_test_no_output "set always-read-ctf on"
gdb_load $binfile
gdb_test_no_output "set print sevenbit-strings"
gdb_test_no_output "set print address off"
gdb_test_no_output "set width 0"
@ -493,7 +497,6 @@ 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}} }

View File

@ -49,11 +49,15 @@ proc do_test {dir options} {
global srcfile testfile gcc_compiled
set binfile [standard_output_file ${dir}/${testfile}]
if { [prepare_for_testing "failed to prepare" ${binfile} \
if { [build_executable "failed to prepare" ${binfile} \
[list $srcfile] $options] } {
return 0
}
clean_restart
gdb_test_no_output "set always-read-ctf on"
gdb_load $binfile
#
# Test whatis command with basic C types
#
@ -587,7 +591,6 @@ proc do_test {dir options} {
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.

View File

@ -24,15 +24,18 @@ standard_testfile cross-tu-cyclic-1.c cross-tu-cyclic-2.c \
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} \
if { [build_executable "failed to prepare" ${testfile} \
[list $srcfile $srcfile2 $srcfile3 $srcfile4] \
$opts] } {
return 0
}
clean_restart
gdb_test_no_output "set always-read-ctf on"
gdb_load $binfile
# Same thing with struct and union.
gdb_test "ptype struct A" "type = struct A \{\[\r\n\]+\[ \t\]+struct B \\*foo;\[\r\n\]+\}.*" "ptype structure A"
gdb_test "ptype struct B" "type = struct B \{\[\r\n\]+\[ \t\]+struct B \\*next;\[\r\n\]+\}.*" "ptype structure B"

View File

@ -30,14 +30,17 @@ standard_testfile whatis.c
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} \
if { [build_executable "failed to prepare" ${testfile} \
[list $srcfile] $opts] } {
return 0
}
clean_restart
gdb_test_no_output "set always-read-ctf on"
gdb_load $binfile
# test print command with functions return type
set void "(void|)"
gdb_test "print v_char_func" \

View File

@ -23,15 +23,18 @@ standard_testfile ctf-a.c ctf-b.c ctf-c.c
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} \
if { [build_executable "failed to prepare" ${testfile} \
[list $srcfile $srcfile2 $srcfile3] \
$opts] } {
return 0
}
clean_restart
gdb_test_no_output "set always-read-ctf on"
gdb_load $binfile
# Same thing with struct and union.
gdb_test "ptype struct A" "type = struct A \{\[\r\n\]+\[ \t\]+struct B \\*b;\[\r\n\]+\[ \t\]+struct A \\*next;\[\r\n\]+\}.*" "ptype structure A"
gdb_test "ptype struct B" "type = struct B \{\[\r\n\]+\[ \t\]+struct C \\*c;\[\r\n\]+\[ \t\]+int \\wombat;\[\r\n\]+\}.*" "ptype structure B"