if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} \
{ debug }] } {
untested "could not compile"
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
gdb_breakpoint [gdb_get_line_number "Break here"]
clean_restart ${::testfile}
if {![runto_main]} {
- return 0
+ return
}
set byte_regs(1) al
set options [list debug nopie]
if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} $options] } {
- return -1
+ return
}
# Get things started.
gdb_test "show displaced-stepping" ".* displaced stepping .* is on.*"
if {![runto_main]} {
- return 0
+ return
}
# GDB picks a spare register from this list to hold the RIP-relative
standard_testfile .S -alarm.c
if { [prepare_for_testing "failed to prepare" $testfile "$srcfile $srcfile2" $opts] } {
- return -1
+ return
}
gdb_test "set displaced-stepping on" ""
gdb_test "show displaced-stepping" ".* displaced stepping .* is on.*"
if {![runto_main]} {
- return 0
+ return
}
# Proceed to the test function.
standard_testfile .S -signal.c
if { [prepare_for_testing "failed to prepare" $testfile "$srcfile $srcfile2" $opts] } {
- return -1
+ return
}
gdb_test "set displaced-stepping on" ""
gdb_test "show displaced-stepping" ".* displaced stepping .* is on.*"
if {![runto_main]} {
- return 0
+ return
}
##########################################
clean_restart ${::testfile}
if {![runto_main]} {
- return 0
+ return
}
set nr_regs 14
}
if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} $opts] } {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
gdb_breakpoint [gdb_get_line_number "break-here" $srcfile2]
}
if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} $opts] } {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
gdb_breakpoint [gdb_get_line_number "break-here" $srcfile2]
}
if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} $opts] } {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
gdb_breakpoint [gdb_get_line_number "break-here" $srcfile2]
if { [prepare_for_testing_full "failed to prepare" \
[list $testfile "c++" $srcfile {}]] } {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
gdb_breakpoint [gdb_get_line_number "break-here" $srcfile2]
}
if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} $opts] } {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
gdb_breakpoint "breakhere"
if { [prepare_for_testing "failed to prepare" $testfile $srcfile \
{ debug c++ additional_flags=-std=c++11 }] } {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
gdb_breakpoint [gdb_get_line_number "break-here"]
if { [prepare_for_testing "failed to prepare" ${testfile} \
"${srcfile}" {debug}] } {
- return -1
+ return
}
if {![runto_main]} {
if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} \
[list debug nowarnings]] } {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
gdb_test "print /x \$fs_base" "= $hex" "print fs_base"
require {!istarget "*-*-openbsd*"}
if {[prepare_for_testing "failed to prepare" amd64-i386-address amd64-i386-address.S [list debug "additional_flags=-m32 -nostdlib"]]} {
- return -1
+ return
}
gdb_run_cmd
additional_flags=-static \
ldflags=-nostartfiles]
if { [build_executable "failed to prepare" ${testfile} ${srcfile} $options] } {
- return -1
+ return
}
# Start the test file, and check the x87 control registers (and
require is_x86_64_m64_target
if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} {nopie}] } {
- return -1
+ return
}
if {![runto breakpt]} {
- return -1
+ return
}
gdb_test "bt" "^#0 +breakpt *\\(\\) \[^\r\n\]*\r\n#1 +${::hex} in func5\[^\r\n\]*\r\n#2 +${::hex} in func4\[^\r\n\]*\r\n#3 +${::hex} in func3\[^\r\n\]*\r\nBacktrace stopped: Cannot access memory at address ${::hex}" \
clean_restart ${::testfile}
if {![runto breakpt]} {
- return -1
+ return
}
gdb_test "interpreter-exec mi \"-stack-info-depth\"" \
clean_restart ${::testfile}
if {![runto breakpt]} {
- return -1
+ return
}
gdb_test "interpreter-exec mi \"-stack-list-frames\"" \
require is_x86_64_m64_target
if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} $opts] } {
- return -1
+ return
}
if {![runto breakpt]} {
- return -1
+ return
}
# Use 'bt no-filters' here as the python filters will raise their own
clean_restart ${::testfile}
if {![runto breakpt]} {
- return -1
+ return
}
gdb_test "interpreter-exec mi \"-stack-info-depth\"" \
clean_restart ${::testfile}
if {![runto breakpt]} {
- return -1
+ return
}
gdb_test "interpreter-exec mi \"-stack-list-frames\"" \
# Test LAM 57.
if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
- return -1
+ return
}
if { ![runto_main] } {
- return -1
+ return
}
gdb_breakpoint [gdb_get_line_number "Breakpoint here"]
}
if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} $opts] } {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
gdb_test "print v" { = {i = 0, xxx = {<optimized out> <repeats 256 times>}}}
}
if {[prepare_for_testing "failed to prepare" ${testfile} $srcfile $opts]} {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
gdb_breakpoint "func"
if { [prepare_for_testing "failed to prepare" ${testfile} \
"${srcfile} ${srcfile2}" {debug}] } {
- return -1
+ return
}
clean_restart ${::testfile}
require is_x86_64_m64_target
if { [prepare_for_testing "failed to prepare" $testfile $srcfile] } {
- return -1
+ return
}
# Helper procedure to go to probe NAME
}
if { ![runto_main] } {
- return -1
+ return
}
# Name and expected value for each probe.
require is_x86_64_m64_target
if { [prepare_for_testing "failed to prepare" $testfile $srcfile] } {
- return -1
+ return
}
# Helper procedure to go to probe NAME
}
if { ![runto_main] } {
- return -1
+ return
}
foreach probe_name [list "foo" "bar" "foo_prefix" "bar_prefix"] \
standard_testfile amd64-stap-triplet.S
if { [prepare_for_testing "failed to prepare" $testfile-triplet $srcfile] } {
- return -1
+ return
}
test_probe "triplet"
if { [prepare_for_testing "failed to prepare" $testfile-three-arg-displ \
$srcfile] } {
- return -1
+ return
}
test_probe "three_arg"
standard_testfile amd64-stap-wrong-subexp.S
if { [prepare_for_testing "failed to prepare" $testfile $srcfile] } {
- return -1
+ return
}
proc goto_probe { probe_name } {
}
if { [prepare_for_testing "failed to prepare" ${testfile} "${srcfile} ${srcfile2}" $opts] } {
- return -1
+ return
}
if {![runto g]} {
- return -1
+ return
}
gdb_test "bt" "\r\n#0 +g \\(x=x@entry=2\\) at \[^\r\n\]*\r\n#1 +${::hex} in f \\(x=x@entry=1\\) at \[^\r\n\]*\r\n#2 +${::hex} in main .*"
lappend opts nopie
if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} $opts] } {
- return -1
+ return
}
if {![runto noret]} {
- return -1
+ return
}
gdb_test "bt" "#0 +noret \\(x=1\\) at \[^\r\n\]*\r\n#1 +${::hex} in mayret \\(x=x@entry=1\\) at \[^\r\n\]*\r\n#2 +${::hex} in tailcall \\(x=x@entry=1\\) at \[^\r\n\]*\r\n#3 +${::hex} in main \\(\\) at .*"
}
if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} $opts] } {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
gdb_breakpoint "g"
require is_x86_64_m64_target
if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} {}] } {
- return -1
+ return
}
if {![runto b]} {
- return -1
+ return
}
gdb_test "bt" "#0 +b \\(\\) at \[^\r\n\]*\r\n#1 +${::hex} in a \\(q=<optimized out>\\) at \[^\r\n\]*\r\n#2 +${::hex} in main \\(\[^\r\n\]*\\) at .*"
if {[target_info gdb_protocol] == "remote"
|| [target_info gdb_protocol] == "extended-remote"} {
unsupported "using [target_info gdb_protocol] protocol"
- return -1
+ return
}
standard_testfile
if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} \
{ debug }] } {
- return -1
+ return
}
# Insert the watchpoint, it should default to a h/w watchpoint.
clean_restart ${::testfile}
if {![runto_main]} {
- return 0
+ return
}
set nr_regs 14
set cf_size 8757248
} else {
unsupported "no pre-generated core file for this target"
- return -1
+ return
}
# Decompress the core file.
set corefile [decompress_bz2 $corebz2file]
if { $corefile eq "" } {
untested "failed to bunzip2 the core file"
- return -1
+ return
}
# Check the size of the decompressed core file. Just for sanity.
file stat ${corefile} corestat
if { $corestat(size) != ${cf_size} } {
untested "uncompressed core file is the wrong size"
- return -1
+ return
}
# Copy over the corefile if we are remote testing.
# The kernel VDSO is used for the syscalls returns only on i386 (not x86_64).
if { [build_executable "failed to prepare" $testfile $srcfile $options] } {
- return -1
+ return
}
# Don't tell GDB which executable we're debugging.
clean_restart ${::testfile}
if {![runto_main]} {
- return 0
+ return
}
gdb_test "break [gdb_get_line_number "first breakpoint here"]" \
if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} \
[list debug nowarnings additional_flags=${comp_flags}]] } {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
set supports_avx512 0
set corefile [decompress_bz2 $corebz2file]
if { $corefile == "" } {
untested "failed bzip2"
- return -1
+ return
}
file stat ${corefile} corestat
if {$corestat(size) != 102400} {
untested "bzip2 produces invalid result"
- return -1
+ return
}
set corefile [gdb_remote_download host $corefile]
# fragments.
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list $additional_flags]] != "" } {
untested "failed to compile"
- return -1
+ return
}
clean_restart ${::testfile}
if {![runto_main]} {
- return 0
+ return
}
set byte_regs(1) al
set srcfile ${testfile}.S
if {[prepare_for_testing "failed to prepare" ${testfile} ${srcfile} {nodebug}]} {
- return -1
+ return
}
if {![runto f]} {
- return -1
+ return
}
gdb_test "backtrace" "#0 \[^\r\n\]* f \[^\r\n\]*\r\n#1 \[^\r\n\]* g \[^\r\n\]*\r\n#2 \[^\r\n\]* main \[^\r\n\]*"
standard_testfile .S -alarm.c
if { [prepare_for_testing "failed to prepare" $testfile "$srcfile $srcfile2" $opts] } {
- return -1
+ return
}
gdb_test "set displaced-stepping on" ""
gdb_test "show displaced-stepping" ".* displaced stepping .* is on.*"
if {![runto_main]} {
- return 0
+ return
}
# Proceed to the test function.
lappend opts nopie
if { [prepare_for_testing "failed to prepare" $testfile $srcfile $opts] } {
- return -1
+ return
}
gdb_test "set displaced-stepping on" ""
gdb_test "show displaced-stepping" ".* displaced stepping .* is on.*"
if {![runto_main]} {
- return 0
+ return
}
##########################################
standard_testfile
if {[prepare_for_testing "failed to prepare" ${testfile} ${srcfile} {debug $additional_flags}]} {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
gdb_test_no_output "set breakpoint always-inserted on"
set additional_flags [gdb_target_symbol_prefix_flags_asm]
if { [prepare_for_testing "failed to prepare" $testfile $srcfile [list debug nopie $additional_flags]] } {
- return -1
+ return
}
if {![runto_main]} {
- return 0
+ return
}
with_test_prefix "zero" {
if { [gdb_compile "${srcdir}/${subdir}/${srcfilec} ${srcdir}/${subdir}/${srcfileasm}" "${binfile}" executable [list debug $additional_flags]] != "" } {
untested "failed to compile"
- return -1
+ return
}
# Get things started.
}
}
if { $gate_n == "" } {
- return -1
+ return
}
# Check we see the inserted `DW_CFA_GNU_negative_offset_extended' CFI.
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list debug $additional_flags]] != "" } {
untested "failed to compile"
- return -1
+ return
}
clean_restart ${::testfile}
if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} \
[list debug additional_flags=${comp_flags}]] } {
untested "failed to compile x86 PKEYS test."
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
set supports_pkru 0
# fragments.
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list $additional_flags]] != "" } {
untested "failed to compile"
- return -1
+ return
}
#
if {![runto_main]} {
- return 0
+ return
}
# Testcase for standard prologue.
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" \
executable $opts] != "" } {
untested "failed to compile"
- return -1
+ return
}
clean_restart $::testfile
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" \
executable [list debug $additional_flags]] != "" } {
untested "failed to compile"
- return -1
+ return
}
clean_restart $::testfile
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" \
executable [list debug $additional_flags]] != "" } {
untested "i386-size"
- return -1
+ return
}
clean_restart $::testfile
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable $opts] != "" } {
unsupported "failed to compile"
- return -1
+ return
}
clean_restart $executable
if {![runto_main]} {
- return -1
+ return
}
set args ""
clean_restart ${::testfile}
if {![runto_main]} {
- return 0
+ return
}
send_gdb "print have_sse ()\r"
require is_x86_like_target
if { [prepare_for_testing "failed to prepare" $testfile $srcfile] } {
- return -1
+ return
}
gdb_test_no_output "set language ada"
if { ![runto "-pstap bar"] } {
- return -1
+ return
}
gdb_test "print \$_probe_arg0" " = 40" \
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list debug $additional_flags]] != "" } {
untested "failed to compile"
- return -1
+ return
}
clean_restart $::testfile
clean_restart ${::testfile}
if {![runto_main]} {
- return 0
+ return
}
set word_regs(1) ax
set binfile ${objdir}/${subdir}/${testfile}
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
untested "failed to compile"
- return -1
+ return
}
clean_restart
# We need to start the inferior to place the breakpoints in the memory at all.
if {![runto_main]} {
- return -1
+ return
}
# The default "auto" mode removes all the breakpoints when we stop (and not
}
if {![info exists bpt2address]} {
- return -1
+ return
}
gdb_test "b *($bpt2address + 1)" "Breakpoint \[0-9\] at .*" "slot 1 breakpoint placed"
standard_testfile
if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
- return -1
+ return
}
if { ![runto_main] } {
- return -1
+ return
}
# Test xmm
if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} \
{debug additional_flags="-mavx512fp16"}] } {
- return -1
+ return
}
if { ![runto_main] } {
- return -1
+ return
}
gdb_test "p square(2.2)" "= 4\\.8359"
standard_testfile
if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
- return -1
+ return
}
if { ![runto_main] } {
- return -1
+ return
}
# Test xmm.