Use "set always-read-ctf on" instead of --strip-debug in the ctf test-cases.
Tested on x86_64-linux.
# 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
#
# 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
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
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"
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}} }
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
#
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 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"
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" \
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"