if { "${asm-arch}" == "" } {
untested "skipping tests due to no asm architecture"
- return -1
+ return
}
# On NetBSD/ELF we need a special NetBSD-identifying note section.
set multilib_flags [board_info $dest multilib_flags]
if { "${multilib_flags}" != "" } {
untested "failed to compile"
- return -1
+ return
return
}
}
if {[target_assemble ${srcdir}/${subdir}/${srcfile} $asm1obj "${asm-flags} ${debug-flags}"] != ""} {
untested "failed to assemble"
- return -1
+ return
}
if {[target_assemble ${srcdir}/${subdir}/${srcfile2} $asm2obj "${asm-flags} ${debug-flags}"] != ""} {
untested "failed to assemble"
- return -1
+ return
}
# We deliberately don't use gdb_compile here to link together the
# *-*-*bsd* and *-*-solaris2*.
if {[target_link [list $asm1obj $asm2obj] "${binfile}" ${link-flags}] != ""} {
untested "failed to link"
- return -1
+ return
}
# Restore the target board linker script for HC11/HC12.
if { [prepare_for_testing "failed to prepare" $testfile \
[list $srcfile $srcfile2]] } {
- return -1
+ return
}
# Regression test for PR34112. Check that "rbreak $srcfile:foo" doesn't set
with_test_prefix "without semaphore, not optimized" {
if {[stap_test "stap-probe-nosem-noopt"] == -1} {
untested "stap probe test failed"
- return -1
+ return
}
foreach_with_prefix pie { "nopie" "pie" } {
standard_testfile record_goto.c
if {[prepare_for_testing "failed to prepare" $testfile $srcfile]} {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
gdb_test_no_output "set record btrace bts buffer-size 1"
standard_testfile
if {[prepare_for_testing "failed to prepare" $testfile $srcfile]} {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
# trace the test code
standard_testfile record_goto.c
if {[prepare_for_testing "failed to prepare" $testfile $srcfile]} {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
# proceed to some sequential code
if { [gdb_compile_shlib $srcfile_lib $binfile_lib {}] != "" } {
untested "failed to prepare shlib"
- return -1
+ return
}
if { [prepare_for_testing "failed to prepare" $testfile $srcfile \
[list additional_flags=-DDSO_NAME=\"$binfile_lib\" libs=-ldl]] } {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
# Trace the test function
standard_testfile
if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug pthreads}]} {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
# Record the main thread. Recording will automatically be enabled for the
standard_testfile
if {[gdb_compile_pthreads "$srcdir/$subdir/$srcfile" "$binfile" executable {debug}] != "" } {
untested "failed to prepare"
- return -1
+ return
}
# We need to enable non-stop mode for the remote case.
}
if {![runto_main]} {
- return -1
+ return
}
set bp_1 [gdb_get_line_number "bp.1" $srcfile]
standard_testfile
if {[prepare_for_testing "failed to prepare" $testfile {} {debug}]} {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
# enable btrace
require allow_gdbserver_tests
clean_restart $testfile
if {![runto_main]} {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
# make sure record-btrace can be enabled after re-run
clean_restart $testfile
if {![runto_main]} {
- return -1
+ return
}
gdb_test_no_output "record btrace" "enable after restart"
if {![runto_main]} {
- return -1
+ return
}
gdb_test_no_output "record btrace" "enable after re-run"
standard_testfile
if {[prepare_for_testing "failed to prepare" $testfile $srcfile]} {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
gdb_test_no_output "set record btrace pt event-tracing on"
standard_testfile null-deref.c
if {[prepare_for_testing "failed to prepare" $testfile $srcfile]} {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
gdb_test_no_output "set record btrace pt event-tracing on"
standard_testfile exception.cc
if {[prepare_for_testing "failed to prepare" $testfile $srcfile \
{nopie c++ debug}]} {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
# we want to see the full trace for this test
# PIE on 32-bit.
standard_testfile
if {[prepare_for_testing "failed to prepare" $testfile {} {nopie debug}]} {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
# start btrace
# make sure we can handle incomplete trace with respect to indentation
if {![runto_main]} {
- return -1
+ return
}
# navigate to the fib in line 24 above
gdb_breakpoint fib
standard_testfile record_goto.c
if {[prepare_for_testing "failed to prepare" $testfile $srcfile]} {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
# trace the call to the test function
standard_testfile .c .S
if {[prepare_for_testing "failed to prepare" $testfile "$srcfile $srcfile2" {debug}]} {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
# set bp before loop and continue
standard_testfile
if {[prepare_for_testing "failed to prepare" $testfile {} {debug}]} {
- return -1
+ return
}
set host_binfile [gdb_remote_download host $binfile]
with_test_prefix "inferior 1" {
if {![runto_main]} {
- return -1
+ return
}
}
gdb_test "inferior 2" "Switching to inferior 2.*"
if {![runto_main]} {
- return -1
+ return
}
gdb_test_no_output "record btrace"
standard_testfile
if {[gdb_compile_pthreads "$srcdir/$subdir/$srcfile" "$binfile" executable {debug}] != "" } {
untested "failed to prepare"
- return -1
+ return
}
clean_restart $testfile
if {![runto_main]} {
- return -1
+ return
}
# set up breakpoints
standard_testfile record_goto.c
if {[prepare_for_testing "failed to prepare" $testfile $srcfile]} {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
proc check_not_replaying {} {
standard_testfile
if {[gdb_compile_pthreads "$srcdir/$subdir/$srcfile" "$binfile" executable {debug}] != "" } {
untested "failed to prepare"
- return -1
+ return
}
save_vars { GDBFLAGS } {
}
if {![runto_main]} {
- return -1
+ return
}
# set up breakpoints
}
} else {
unsupported "target architecture not supported"
- return -1
+ return
}
if {[prepare_for_testing "failed to prepare" $testfile $srcfile $opts]} {
- return -1
+ return
}
if { ![runto_main] } {
untested "failed to run to main"
- return -1
+ return
}
### 1. Default testrun
standard_testfile
if {[prepare_for_testing "failed to prepare" $testfile $srcfile]} {
- return -1
+ return
}
set target_binfile [gdb_remote_download target $binfile]
standard_testfile record_goto.c
if {[prepare_for_testing "failed to prepare" $testfile $srcfile]} {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
set bp [gdb_get_line_number "fun4.3" $srcfile]
}
} else {
unsupported "target architecture not supported"
- return -1
+ return
}
if {[prepare_for_testing "failed to prepare" $testfile $srcfile $opts]} {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
# When GDB prints the file for a stop location, it may print the full path
standard_testfile
if {[prepare_for_testing "failed to prepare" $testfile $srcfile \
{debug ldflags=-Wl,-z,lazy}]} {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
# trace the code for the call to test
standard_testfile
if {[prepare_for_testing "failed to prepare" $testfile $srcfile]} {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
# trace the test code
standard_testfile record_goto.c
if {[prepare_for_testing "failed to prepare" $testfile $srcfile]} {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
# Trace the call to the test function.
}
} else {
unsupported "target architecture not supported"
- return -1
+ return
}
if {[prepare_for_testing "failed to prepare" $testfile $srcfile {}]} {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
}
} else {
unsupported "target architecture not supported"
- return -1
+ return
}
if {[prepare_for_testing "failed to prepare" $testfile $srcfile $opts]} {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
# we want to see the full trace for this test
}
} else {
unsupported "target architecture not supported"
- return -1
+ return
}
if {[prepare_for_testing "failed to prepare" $testfile $srcfile $opts]} {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
# When GDB prints the file for a stop location, it may print the full path
standard_testfile .c x86-tsx.S
if {[prepare_for_testing "failed to prepare" $testfile "$srcfile $srcfile2" {debug}]} {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
# record the test
# Also discard local symbols.
if {[prepare_for_testing "failed to prepare" $testfile $srcfile \
{ldflags=-Wl,-x nopie}]} {
- return -1
+ return
}
if {![runto test]} {
- return -1
+ return
}
# we want to see the full trace for this test
standard_testfile
if {[prepare_for_testing "failed to prepare" $testfile $srcfile]} {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
# capture the disassembly of gettimeofday while live debugging
if {[prepare_for_testing $testfile $testfile $srcfile \
{debug nowarnings c++}]} {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
gdb_breakpoint [gdb_get_line_number "break here" $srcfile]
gdb_continue_to_breakpoint "testing location"
if {[skip_compile_feature_untested "var = 0"]} {
- return -1
+ return
}
# Reminder, "var" is an integer; all these types get converted to `int'.
if {[prepare_for_testing $testfile $testfile $srcfile \
{debug nowarnings c++ additional_flags=-std=c++11}]} {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
if {[skip_compile_feature_untested]} {
- return -1
+ return
}
gdb_breakpoint [gdb_get_line_number "break here" $srcfile]
if {[prepare_for_testing $testfile $testfile $srcfile \
{debug nowarnings c++}]} {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
gdb_breakpoint [gdb_get_line_number "break here" $srcfile]
gdb_continue_to_breakpoint "testing location"
if {[skip_compile_feature_untested "var = 0"]} {
- return -1
+ return
}
CompileExpression::new "var"
if {[prepare_for_testing $testfile $testfile $srcfile \
{debug nowarnings c++}]} {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
gdb_breakpoint [gdb_get_line_number "break here" $srcfile]
gdb_continue_to_breakpoint "testing location"
if {[skip_compile_feature_untested "var = 0"]} {
- return -1
+ return
}
CompileExpression::new "var"
if {[prepare_for_testing $testfile $testfile $srcfile \
{debug nowarnings c++}]} {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
gdb_breakpoint [gdb_get_line_number "break here" $srcfile]
gdb_continue_to_breakpoint "testing location"
if {[skip_compile_feature_untested "var = 0"]} {
- return -1
+ return
}
CompileExpression::new "var"
if {[prepare_for_testing $testfile $testfile $srcfile \
{debug nowarnings c++}]} {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
gdb_breakpoint [gdb_get_line_number "break here" $srcfile]
gdb_continue_to_breakpoint "testing location"
if {[skip_compile_feature_untested "var = 0"]} {
- return -1
+ return
}
CompileExpression::new "var"
if {[prepare_for_testing $testfile $testfile $srcfile \
{debug nowarnings c++}]} {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
gdb_breakpoint [gdb_get_line_number "break here" $srcfile]
gdb_continue_to_breakpoint "testing location"
if {[skip_compile_feature_untested "var = 0"]} {
- return -1
+ return
}
CompileExpression::new "var"
if { [build_executable_from_specs $testfile.exp $testfile $options \
{*}$srcfilesoptions] } {
- return -1
+ return
}
clean_restart ${testfile}
if {![runto_main]} {
- return -1
+ return
}
if {[skip_compile_feature_untested]} {
- return -1
+ return
}
gdb_test_no_output "set language c++" \
if {[prepare_for_testing $testfile $testfile $srcfile \
{debug nowarnings c++}]} {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
gdb_breakpoint [gdb_get_line_number "break here" $srcfile]
gdb_continue_to_breakpoint "testing location"
if {[skip_compile_feature_untested "var = 0"]} {
- return -1
+ return
}
CompileExpression::new "var"
if { [build_executable_from_specs $testfile.exp $testfile $options \
{*}$srcfilesoptions] } {
- return -1
+ return
}
clean_restart ${testfile}
"Set language to C++"
if {![runto_main]} {
- return -1
+ return
}
gdb_breakpoint [gdb_get_line_number "break-here"]
gdb_continue_to_breakpoint "break-here" ".* break-here .*"
if {[skip_compile_feature_untested "var = 0"]} {
- return -1
+ return
}
#
if { [prepare_for_testing "failed to prepare" "$testfile-nodebug" \
$srcfile $flags] } {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
# This binary has no debug information, so force the language to C in case
gdb_test_no_output "set language c" ""
if {[skip_compile_feature_untested]} {
- return -1
+ return
}
gdb_test "compile code resultvar = gnu_ifunc (10);" \
if { [prepare_for_testing "failed to prepare" "$testfile-debug" \
$srcfile "debug $flags"] } {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
# gnu_ifunc (10): error: too many arguments to function 'gnu_ifunc'
gdb_test "compile code resultvar = gnu_ifunc_alias (10);" \
}]
if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
- return -1
+ return
}
# Make some DWARF for the test.
if { [prepare_for_testing "failed to prepare" ${testfile} \
[list $srcfile $asm_file] {nodebug}] } {
- return -1
+ return
}
if {![runto func]} {
- return -1
+ return
}
if {[skip_compile_feature_untested]} {
- return -1
+ return
}
# If we have a bug, this will hang.
require allow_compile_tests
if { [prepare_for_testing "failed to prepare" "$testfile"] } {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
if {[skip_compile_feature_untested]} {
- return -1
+ return
}
gdb_test "compile print varint" " = 10"
require allow_compile_tests
if { [prepare_for_testing "failed to prepare" $testfile] } {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
if {[skip_compile_feature_untested]} {
- return -1
+ return
}
gdb_test_no_output "compile file -r ${srcdir}/${subdir}/$srcfile2" \
if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" \
executable {debug}] != "" } {
- return -1
+ return
}
clean_restart ${::testfile}
}
if {[skip_compile_feature_untested]} {
- return -1
+ return
}
gdb_test "compile code local_scope = 1" \
lappend srcfilesoptions $srcfile4 "nodebug"
if { [build_executable_from_specs $testfile.exp $testfile $options \
{*}$srcfilesoptions] } {
- return -1
+ return
}
clean_restart ${testfile}
"test compile file command without running inferior"
if {![runto_main]} {
- return -1
+ return
}
if {[skip_compile_feature_untested]} {
- return -1
+ return
}
#
if { [gdb_compile_shlib ${srcdir}/${subdir}/${srcfile2} $libbin {debug}] != ""
|| [gdb_compile ${srcdir}/${subdir}/${srcfile} $binfile executable \
[list debug shlib=$libbin]] == -1 } {
- return -1
+ return
}
clean_restart $testfile
gdb_load_shlib $libbin
if {![runto_main]} {
- return -1
+ return
}
gdb_test_no_output "compile code shlib_func ();" "call shared library function"
lappend opts debug
if { [gdb_compile $s1 ${objfile} object $opts] != "" } {
untested "failed to compile"
- return -1
+ return
}
set opts {}
lappend opts "additional_flags=-gctf"
if { [gdb_compile $s2 ${objfile2} object $opts] != "" } {
untested "failed to compile"
- return -1
+ return
}
set opts {}
lappend opts "additional_flags=-Wl,-ctf-variables"
if { [gdb_compile [list ${objfile} ${objfile2}] $binfile executable $opts] != "" } {
unsupported "failed to link"
- return -1
+ return
}
clean_restart
standard_ada_testfile prog
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable debug] != ""} {
- return -1
+ return
}
if {[dap_initialize] == ""} {
if {[build_executable "build executable" ${testfile} ${srcfile} \
{debug build-id}] == -1} {
- return -1
+ return
}
# Split debug information from BINFILE into BINFILE.debug.
# information by GDB will need to be done based on the build-id.
if {[gdb_gnu_strip_debug $binfile no-debuglink]} {
unsupported "cannot produce separate debug info files"
- return -1
+ return
}
# Get the .build-id/PREFIX/SUFFIX.debug file name, and convert it to
if {[build_executable "build executable" $testfile $srcfile debug] == -1} {
untested "failed to compile"
- return -1
+ return
}
# The procedure gdb_gnu_strip_debug will produce an executable called
if {[gdb_gnu_strip_debug $binfile]} {
# Check that you have a recent version of strip and objcopy installed.
unsupported "cannot produce separate debug info files"
- return -1
+ return
}
set debugfile [standard_output_file ${testfile}.debug]
if { [catch {file copy -force ${srcdir}/${subdir}/${srcfile} \
[standard_output_file ${sourcetmp}]}] != 0 } {
error "create temporary file"
- return -1
+ return
}
if { [gdb_compile "$sourcetmp" "$binfile" executable {debug build-id}] != "" } {
untested "failed to compile"
- return -1
+ return
}
if { [gdb_compile "$sourcetmp" "${binfile}2" executable {debug build-id}] != "" } {
fail "compile"
- return -1
+ return
}
# Write some assembly that just has a .gnu_debugaltlink section.
set binfile ${objdir}/${subdir}/${testfile}
if { [gdb_compile "${srcfile}" "${binfile}" object ""] != "" } {
untested "failed to compile"
- return -1
+ return
}
proc call_tests { } {
standard_testfile
if { [prepare_for_testing "failed to prepare" $testfile ${srcfile}] == -1 } {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
# Check the '/s' and '/m' flags can't be used together.
set binfile ${objdir}/${subdir}/${testfile}
if { [gdb_compile "${srcfile}" "${binfile}" executable {debug additional_flags=-ms}] != "" } {
untested "failed to compile"
- return -1
+ return
}
proc all_set_machine_h8300s { } {
return
} else {
perror "Couldn't compile ${srcfile}"
- return -1
+ return
}
}
set binfile ${objdir}/${subdir}/${testfile}
if { [gdb_compile "${srcfile}" "${binfile}" executable ""] != "" } {
untested "failed to compile"
- return -1
+ return
}
proc add_tests { } {
set binfile ${objdir}/${subdir}/${testfile}
if { [gdb_compile "${srcfile}" "${binfile}" executable ""] != "" } {
untested "failed to compile"
- return -1
+ return
}
proc all_fp_move_and_load_tests { } {
if {[target_assemble $srcfile $objfile "${asm-flags}"] != ""} {
untested "failed to assemble"
- return -1
+ return
}
if {[target_link $objfile $binfile "${link-flags}"] != ""} {
untested "failed to link"
- return -1
+ return
}
gdb_start
if {[target_assemble $srcfile $objfile "${asm-flags}"] != ""} {
untested "failed to assemble"
- return -1
+ return
}
if {[target_link $objfile $binfile "${link-flags}"] != ""} {
untested "failed to link"
- return -1
+ return
}
gdb_start
if {[target_assemble $srcfile $objfile "${asm-flags}"] != ""} {
untested "failed to assemble"
- return -1
+ return
}
if {[target_link $objfile $binfile "${link-flags}"] != ""} {
untested "failed to link"
- return -1
+ return
}
gdb_start
if {[target_assemble $srcfile $objfile "${asm-flags}"] != ""} {
untested "failed to assemble"
- return -1
+ return
}
if {[target_link $objfile $binfile "${link-flags}"] != ""} {
untested "failed to link"
- return -1
+ return
}
gdb_start
if {[target_assemble $srcfile $objfile "${asm-flags}"] != ""} {
untested "failed to assemble"
- return -1
+ return
}
if {[target_link $objfile $binfile "${link-flags}"] != ""} {
untested "failed to link"
- return -1
+ return
}
gdb_start
if {[target_assemble $srcfile $objfile "${asm-flags}"] != ""} {
untested "failed to assemble"
- return -1
+ return
}
if {[target_link $objfile $binfile "${link-flags}"] != ""} {
untested "failed to link"
- return -1
+ return
}
gdb_start
if {[target_assemble $srcfile $objfile "${asm-flags}"] != ""} {
untested "failed to assemble"
- return -1
+ return
}
if {[target_link $objfile $binfile "${link-flags}"] != ""} {
untested "failed to link"
- return -1
+ return
}
gdb_start
if {[target_assemble $srcfile $objfile "${asm-flags}"] != ""} {
untested "failed to assemble"
- return -1
+ return
}
if {[target_link $objfile $binfile "${link-flags}"] != ""} {
untested "failed to link"
- return -1
+ return
}
gdb_start
if {[target_assemble $srcfile $objfile "${asm-flags}"] != ""} {
untested "failed to assemble"
- return -1
+ return
}
if {[target_link $objfile $binfile "${link-flags}"] != ""} {
untested "failed to link"
- return -1
+ return
}
gdb_start
if {[target_assemble $srcfile $objfile "${asm-flags}"] != ""} {
untested "failed to assemble"
- return -1
+ return
}
if {[target_link $objfile $binfile "${link-flags}"] != ""} {
untested "failed to link"
- return -1
+ return
}
gdb_start
if {[target_assemble $srcfile $objfile "${asm-flags}"] != ""} {
untested "failed to assemble"
- return -1
+ return
}
if {[target_link $objfile $binfile "${link-flags}"] != ""} {
untested "failed to link"
- return -1
+ return
}
gdb_start
if {[target_assemble $srcfile $objfile "${asm-flags}"] != ""} {
untested "failed to assemble"
- return -1
+ return
}
if {[target_link $objfile $binfile "${link-flags}"] != ""} {
untested "failed to link"
- return -1
+ return
}
gdb_start
if {[target_assemble $srcfile $objfile "${asm-flags}"] != ""} {
untested "failed to assemble"
- return -1
+ return
}
if {[target_link $objfile $binfile "${link-flags}"] != ""} {
untested "failed to link"
- return -1
+ return
}
gdb_start
if { [prepare_for_testing "failed to prepare" ${testfile} \
[list $srcfile $asm_file] {nodebug}] } {
- return -1
+ return
}
gdb_test_no_output "set language d"
if {![runto "circular1.found"]} {
- return -1
+ return
}
# This last test shouldn't timeout.
if { [prepare_for_testing "failed to prepare" ${testfile} \
[list $srcfile $asm_file] {nodebug}] } {
- return -1
+ return
}
# Verify that "start" lands inside the right procedure.
if {[gdb_start_cmd] < 0} {
unsupported "start failed"
- return -1
+ return
}
gdb_test "" \
standard_testfile simple.d
if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug d}]} {
- return -1
+ return
}
# Verify that "start" lands inside the right procedure.
if {[gdb_start_cmd] < 0} {
unsupported "start failed"
- return -1
+ return
}
gdb_test "" \
if { [prepare_for_testing "failed to prepare" ${testfile} \
[list $srcfile $asm_file] {nodebug}] } {
- return -1
+ return
}
gdb_test_no_output "set language d"
if {![runto "_Dmain"]} {
- return -1
+ return
}
# watch -l will rewrite the expression to "*(watch.tstruct *) 0x12345",
if {[build_executable_and_dwo_files "$testfile.exp" "${binfile}" {nodebug} \
[list $asm_file [list nodebug split-dwo] $obj] \
[list $srcfile [list nodebug]]]} {
- return -1
+ return
}
clean_restart $::testfile
if {[prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} \
{debug f90}]} {
- return -1
+ return
}
if {![fortran_runto_main]} {
- return -1
+ return
}
# Avoid libc symbols, in particular the 'array' type.
load_lib fortran.exp
if {[prepare_for_testing $testfile.exp $testfile $srcfile {f90 debug}]} {
- return -1
+ return
}
if {![fortran_runto_main]} {
load_lib fortran.exp
if {[prepare_for_testing $testfile.exp $testfile $srcfile {f90 debug}]} {
- return -1
+ return
}
if {![fortran_runto_main]} {
standard_testfile .f
if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug f90}]} {
- return -1
+ return
}
if {![runto sub_]} {
if { [prepare_for_testing "failed to prepare" $testfile $srcfile \
{f90 debug}] } {
- return -1
+ return
}
if { ![fortran_runto_main] } {
if {[prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} \
{debug f90}]} {
- return -1
+ return
}
if {![runto [gdb_get_line_number "First Breakpoint"]]} {
perror "couldn't run to breakpoint First Breakpoint"
- return -1
+ return
}
# Avoid libc symbols, in particular the 'array' type.
if {[prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} \
{debug f90}]} {
- return -1
+ return
}
if {![fortran_runto_main]} {
- return -1
+ return
}
# Avoid libc symbols, in particular the 'array' type.
if {[build_executable ${testfile}.exp ${testfile} ${srcfile} \
{debug f90}]} {
- return -1
+ return
}
# Takes the name of an array slice as used in the test source, and extracts
if {[prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} \
{debug f90}]} {
- return -1
+ return
}
if {![fortran_runto_main]} {
- return -1
+ return
}
gdb_breakpoint [gdb_get_line_number "Test Breakpoint"]
if { [test_compiler_info {gfortran-*} f90] &&
![test_compiler_info {gfortran-1[1-9]-*} f90] } {
untested "compiler does not support assumed rank"
- return -1
+ return
}
if {[prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} \
{debug f90 dwarf5}]} {
- return -1
+ return
}
if {![fortran_runto_main]} {
untested "could not run to main"
- return -1
+ return
}
gdb_breakpoint [gdb_get_line_number "Test Breakpoint"]
standard_testfile .f90
if {[prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} {debug f90}]} {
- return -1
+ return
}
if {![fortran_runto_main]} {
load_lib "fortran.exp"
if {[prepare_for_testing $testfile.exp $testfile $srcfile {debug f90}]} {
- return -1
+ return
}
if {![fortran_runto_main]} {
- return -1
+ return
}
with_test_prefix "default values" {
[list $testfile [list debug f90] \
$srcfile [list debug f90] \
$srcfile2 [list nodebug f90]]]} {
- return -1
+ return
}
# Find a possibly mangled version of NAME, a function we want to call
set string_func [find_mangled_name "string_func"]
if {![fortran_runto_main]} {
- return -1
+ return
}
# Call the function SOME_FUNC, that takes a single integer and returns
# Ifx, and ifort do not support kind=4 for CHARACTER.
if { [test_compiler_info {ifx-*} f90] || [test_compiler_info {ifort-*} f90] } {
- return -1
+ return
}
if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} {debug additional_flags=-fbackslash f90}] } {
- return -1
+ return
}
if {![fortran_runto_main]} {
if {[prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} \
{debug f90}]} {
- return -1
+ return
}
if {![fortran_runto_main]} {
- return -1
+ return
}
gdb_breakpoint [gdb_get_line_number "Break Here"]
if {[prepare_for_testing "failed to prepare" ${testfile} \
$srcfile {debug f90 quiet}]} {
- return -1
+ return
}
if {![fortran_runto_main]} {
if {[prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} \
{debug f90}]} {
- return -1
+ return
}
if {![fortran_runto_main]} {
- return -1
+ return
}
test_gdb_complete_none "p var%x"
require allow_fortran_tests
if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug f90 quiet}]} {
- return -1
+ return
}
if {![fortran_runto_main]} {
load_lib fortran.exp
if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug f90}]} {
- return -1
+ return
}
if {![fortran_runto_main]} {
- return -1
+ return
}
gdb_breakpoint [gdb_get_line_number "Break Here"]
load_lib fortran.exp
if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug f90}]} {
- return -1
+ return
}
if {![fortran_runto_main]} {
if {[prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} \
{debug f90}]} {
- return -1
+ return
}
if {![runto [gdb_get_line_number "post_init"]]} {
load_lib "fortran.exp"
if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug f90}]} {
- return -1
+ return
}
if {![fortran_runto_main]} {
if {[prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} \
{debug f90}]} {
- return -1
+ return
}
if {![fortran_runto_main]} {
load_lib fortran.exp
if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug f90}]} {
- return -1
+ return
}
if {![fortran_runto_main]} {
- return -1
+ return
}
gdb_breakpoint [gdb_get_line_number "Break here"]
load_lib "fortran.exp"
if { [prepare_for_testing $testfile.exp $testfile $srcfile {debug f90}] } {
- return -1
+ return
}
if { ![fortran_runto_main] } {
untested "could not run to main"
- return -1
+ return
}
# Test if we can set a breakpoint via the entry-point name.
standard_testfile ".f90"
if {[prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} {debug f90}]} {
- return -1
+ return
}
with_complaints 5 {
with_timeout_factor 3 {
if {![fortran_runto_main]} {
- return -1
+ return
}
gdb_test_no_output "set max-value-size unlimited"
set GDBFLAGS [string map {"-readnow" ""} "$GDBFLAGS"]
if {[prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} {debug f90}]} {
- return -1
+ return
}
}
if {![fortran_runto_main]} {
untested "could not run to main"
- return -1
+ return
}
gdb_test "info main" "simple" "info main post start"
if { [prepare_for_testing "failed to prepare" $testfile \
[list $srcfile2 $srcfile] {debug f90}] } {
- return -1
+ return
}
if { ![fortran_runto_main] } {
if { [prepare_for_testing "failed to prepare" $testfile \
[list $srcfile2 $srcfile] {debug f90}] } {
- return -1
+ return
}
# Don't run to main to avoid increasing the search scope to include
set bin_flags [list f90 debug shlib=${binfile_lib}]
if {[gdb_compile_shlib ${srcfile_lib} ${binfile_lib} $lib_flags] != "" } {
- return -1
+ return
}
if {[prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} \
${bin_flags}]} {
- return -1
+ return
}
if {![fortran_runto_main]} {
- return -1
+ return
}
gdb_breakpoint [gdb_get_line_number "all-assigned"]
standard_testfile .f90
if { [prepare_for_testing "failed to prepare" $testfile $srcfile {debug f90}] } {
- return -1
+ return
}
if { ![fortran_runto_main] } {
if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} \
{debug f90 quiet}] } {
- return -1
+ return
}
if {![fortran_runto_main]} {
- return -1
+ return
}
gdb_breakpoint [gdb_get_line_number "Break here"]
if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} \
{debug f90 quiet}] } {
- return -1
+ return
}
if {![fortran_runto_main]} {
- return -1
+ return
}
gdb_breakpoint [gdb_get_line_number "Break here"]
if {[prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} \
{debug f90}]} {
- return -1
+ return
}
if {![fortran_runto_main]} {
- return -1
+ return
}
# Avoid libc symbols, in particular the 'array' type.
if { [gdb_compile_shlib "${srcdir}/${subdir}/${srclibfile}" $libfile {debug f90}] != "" } {
untested "failed to compile shared library"
- return -1
+ return
}
# prepare_for_testing cannot be used as linking with $libfile cannot be passed
if { [gdb_compile $srcdir/$subdir/$srcfile $binfile executable [list debug f90 shlib=$libfile]] != "" } {
untested "failed to compile"
- return -1
+ return
}
clean_restart $testfile
standard_testfile .f90
if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug f90}]} {
- return -1
+ return
}
if {![fortran_runto_main]} {
require allow_fortran_tests
if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug f90 quiet}]} {
- return -1
+ return
}
if { ![fortran_runto_main] } {
standard_testfile .f90
if { [prepare_for_testing "failed to prepare" $testfile $srcfile {debug f90}] } {
- return -1
+ return
}
if { ![fortran_runto_main] } {
$srcfile {debug} \
$srcfile2 {debug c++ additional_flags=-std=c++11} \
$srcfile3 {debug f90}]]} {
- return -1
+ return
}
set have_index [exec_has_index_section $binfile]
standard_testfile .f90
if { [prepare_for_testing "failed to prepare" $testfile $srcfile {debug f90}] } {
- return -1
+ return
}
# Test automatic language detection before the inferior starts. It tests the
load_lib "fortran.exp"
if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} {debug f90}] } {
- return -1
+ return
}
if {![fortran_runto_main]} {
load_lib "fortran.exp"
if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug f90}]} {
- return -1
+ return
}
if {![fortran_runto_main]} {
if {[build_executable ${testfile}.exp ${testfile} \
${srcfile} {debug f90}]} {
- return -1
+ return
}
set int4 [fortran_int4]
load_lib "fortran.exp"
if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug f90}]} {
- return -1
+ return
}
if {![fortran_runto_main]} {
if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} \
{debug f90 quiet}] } {
- return -1
+ return
}
if {![fortran_runto_main]} {
perror "could not run to main"
- return -1
+ return
}
# Depending on the compiler being used, the type names can be printed differently.
if {[prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} \
{debug f90}]} {
- return -1
+ return
}
if {![fortran_runto_main]} {
- return -1
+ return
}
# Depending on the compiler being used, the type names can be printed
if {[prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} \
{debug f90 quiet}]} {
- return -1
+ return
}
if {![fortran_runto_main]} {
untested "could not run to main"
- return -1
+ return
}
# Depending on the compiler being used, the type names can be printed
standard_testfile .f90
if { [prepare_for_testing "failed to prepare" $testfile $srcfile {debug f90}] } {
- return -1
+ return
}
if { ![fortran_runto_main] } {
- return -1
+ return
}
gdb_test "next" ".*" "go to the end of the program"
if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} \
{debug f90 quiet}] } {
- return -1
+ return
}
if {![fortran_runto_main]} {
- return -1
+ return
}
# Depending on the compiler being used, the type names can be printed
load_lib fortran.exp
if {[prepare_for_testing $testfile.exp $testfile $srcfile {debug f90}]} {
- return -1
+ return
}
if {![fortran_runto_main]} {
- return -1
+ return
}
gdb_breakpoint [gdb_get_line_number "write"]
load_lib fortran.exp
if {[prepare_for_testing $testfile.exp $testfile $srcfile {debug f90}]} {
- return -1
+ return
}
if {![fortran_runto_main]} {
- return -1
+ return
}
set int [fortran_int4]
load_lib "fortran.exp"
if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug f90}]} {
- return -1
+ return
}
if {![fortran_runto_main]} {
if {[prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} \
{debug f90}]} {
- return -1
+ return
}
if {![fortran_runto_main]} {
- return -1
+ return
}
gdb_breakpoint [gdb_get_line_number "Test Breakpoint"]
if {[prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} \
{debug f90}]} {
- return -1
+ return
}
if {![fortran_runto_main]} {
- return -1
+ return
}
gdb_breakpoint [gdb_get_line_number "Test Breakpoint"]
standard_testfile ".f90"
if {[prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} {debug f90}]} {
- return -1
+ return
}
if {![runto [gdb_get_line_number "post_truth_table_init"]]} {
if {[prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} \
{debug f90}]} {
- return -1
+ return
}
if {![fortran_runto_main]} {
- return -1
+ return
}
gdb_breakpoint [gdb_get_line_number "Test Breakpoint 1"]
if {[prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} \
{debug f90}]} {
- return -1
+ return
}
if {![fortran_runto_main]} {
- return -1
+ return
}
gdb_breakpoint [gdb_get_line_number "Test breakpoint"]
if {[prepare_for_testing "failed to prepare" $testfile $srcfile \
{debug f90 quiet}]} {
- return -1
+ return
}
if { ![fortran_runto_main] } {
load_lib fortran.exp
if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug f90}]} {
- return -1
+ return
}
if {![fortran_runto_main]} {
if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} \
{debug f90 quiet}] } {
- return -1
+ return
}
if {![fortran_runto_main]} {
- return -1
+ return
}
# Check the association status of various types of VLA's
if {[prepare_for_testing "failed to prepare" ${testfile} ${srcfile} \
{debug f90 quiet}]} {
- return -1
+ return
}
if {![fortran_runto_main]} {
untested "could not run to main"
- return -1
+ return
}
# Try to access vla string / vla string array / string array values.
if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} \
{debug f90 quiet}] } {
- return -1
+ return
}
# check that all fortran standard datatypes will be
# handled correctly when using as VLA's
if {![fortran_runto_main]} {
- return -1
+ return
}
# Depending on the compiler being used, the type names can be printed differently.
if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} \
{debug f90 quiet}] } {
- return -1
+ return
}
if {![fortran_runto_main]} {
- return -1
+ return
}
# Set some breakpoints and print complete vla.
if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} \
{debug f90 quiet}] } {
- return -1
+ return
}
if {![fortran_runto_main]} {
- return -1
+ return
}
set real4 [fortran_real4]
if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} \
{debug f90 quiet}] } {
- return -1
+ return
}
if {![fortran_runto_main]} {
- return -1
+ return
}
# Depending on the compiler being used, the type names can be printed differently.
if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} \
{debug f90 quiet}] } {
- return -1
+ return
}
if {![fortran_runto_main]} {
- return -1
+ return
}
# Depending on the compiler being used, the type names can be printed differently.
if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} \
{debug f90 quiet}] } {
- return -1
+ return
}
if {![fortran_runto_main]} {
- return -1
+ return
}
# Try to access values in non allocated VLA
if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} \
{debug f90 quiet}] } {
- return -1
+ return
}
# Depending on the compiler being used, the type names can be printed differently.
# the debugger when accessing it.
if {![runto [gdb_get_line_number "before-allocated"]]} {
perror "couldn't run to breakpoint before-allocated"
- return -1
+ return
}
gdb_test "print twov" " = \\\( ivla1 = <not allocated>, ivla2 = <not allocated> \\\)" \
if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} \
{debug f90 quiet}] } {
- return -1
+ return
}
if {![fortran_runto_main]} {
- return -1
+ return
}
# Check VLA with arbitrary length and check that elements outside of
if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} \
{debug f90 quiet}] } {
- return -1
+ return
}
if {![fortran_runto_main]} {
- return -1
+ return
}
# "up" works with GCC but other Fortran compilers may copy the values into the
if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} \
{debug f90 quiet}] } {
- return -1
+ return
}
if {![fortran_runto_main]} {
- return -1
+ return
}
# Check the values of VLA's in subroutine can be evaluated correctly
if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} \
{debug f90 quiet}] } {
- return -1
+ return
}
if {![fortran_runto_main]} {
- return -1
+ return
}
# Depending on the compiler being used,
if { [prepare_for_testing "failed to prepare" ${testfile} \
${srcfile} {debug f90}] } {
- return -1
+ return
}
if {![fortran_runto_main]} {
standard_testfile .go
if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} {debug go}] } {
- return -1
+ return
}
set bp_location1 [gdb_get_line_number "set breakpoint 1 here"]
set bp_location2 [gdb_get_line_number "set breakpoint 2 here"]
if { [go_runto_main] < 0 } {
- return -1
+ return
}
if { [gdb_breakpoint ${srcfile}:${bp_location1}] } {
standard_testfile .go
if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} {debug go}] } {
- return -1
+ return
}
set bp_location1 [gdb_get_line_number "set breakpoint 1 here"]
if { [go_runto_main] < 0 } {
- return -1
+ return
}
gdb_test_multiple "print st" "print global var st" {
standard_testfile .go
if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} {debug go}] } {
- return -1
+ return
}
if { [go_runto_main] < 0 } {
- return -1
+ return
}
gdb_test "print add (1, 2)" " = 3"
standard_testfile .go
if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} {debug go}] } {
- return -1
+ return
}
set bp_location1 [gdb_get_line_number "set breakpoint 1 here"]
if { [go_runto_main] < 0 } {
- return -1
+ return
}
if { [gdb_breakpoint ${srcfile}:${bp_location1}] } {
standard_testfile .go
if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} {debug go}] } {
- return -1
+ return
}
set bp_location1 [gdb_get_line_number "set breakpoint 1 here"]
set bp_location2 [gdb_get_line_number "set breakpoint 2 here"]
if { [go_runto_main] < 0 } {
- return -1
+ return
}
if { [gdb_breakpoint ${srcfile}:${bp_location1}] } {
standard_testfile .go
if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} {debug go}] } {
- return -1
+ return
}
if { [go_runto_main] < 0 } {
- return -1
+ return
}
gdb_breakpoint [gdb_get_line_number "Break here"]
standard_testfile .go
if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} {debug go}] } {
- return -1
+ return
}
set bp_location1 {main.T.Foo}
set bp_location2 {main.T.Bar}
if { [go_runto_main] < 0 } {
- return -1
+ return
}
set found_wrong_foo 0
standard_testfile integers.go
if {[prepare_for_testing "failed to prepare" ${testfile} ${srcfile} {debug go}]} {
- return -1
+ return
}
# The bug was that stopping in _start would crash.
if { [gdb_compile "${srcdir}/${subdir}/${testfile}2.go" "${binfile}2.o" object {debug go}] != "" } {
untested "failed to compile"
- return -1
+ return
}
if { [gdb_compile "${srcdir}/${subdir}/${testfile}1.go ${binfile}2.o" "${binfile}" executable "debug go libdir=[standard_output_file {}]"] != "" } {
untested "failed to compile"
- return -1
+ return
}
clean_restart $testfile
if { [go_runto_main] < 0 } {
- return -1
+ return
}
set bp_location1 {package2.Foo}
standard_testfile .go
if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} {debug go}] } {
- return -1
+ return
}
if { [go_runto_main] < 0 } {
- return -1
+ return
}
gdb_test {print "abc" + "def"} {.* = "abcdef"}
standard_testfile .go
if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} {debug go}] } {
- return -1
+ return
}
if { [go_runto_main] < 0 } {
- return -1
+ return
}
# It's not clear yet what GCC will emit.
standard_testfile .go
if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} {debug go}] } {
- return -1
+ return
}
if { [go_runto_main] < 0 } {
- return -1
+ return
}
gdb_test "print unsafe.Sizeof(42)" ".* = 4"
standard_testfile unbounded1.c
if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug quiet}]} {
- return -1
+ return
}
if {![runto main]} {
standard_testfile
if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug quiet}]} {
- 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 quiet}]} {
- return -1
+ return
}
if {![runto here]} {
standard_testfile unbounded1.c
if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug quiet}]} {
- return -1
+ return
}
if {![runto foo]} {
if {[build_executable "failed to prepare" $testfile $srcfile \
{debug pthreads}]} {
- return -1
+ return
}
# Problematic scenario is seen in non-stop mode.
}
if {![runto "breakpoint_1"]} {
- return -1
+ return
}
# Start an empty gdbserver in a new inferior.
set res [gdbserver_start "--multi" ""]
set gdbserver_gdbport [lindex $res 1]
if {[gdb_target_cmd "extended-remote" $gdbserver_gdbport]} {
- return -1
+ return
}
# Go back to inferior 1. Continuing should hit the next breakpoint.
require can_spawn_for_attach
if {[build_executable "build" $testfile $srcfile {debug}] == -1} {
- return -1
+ return
}
proc test {target_non_stop} {
set binfile3 [standard_output_file ${exec3}]
if { [build_executable ${testfile}.exp ${exec1} "${srcfile1}" {debug}] == -1 } {
- return -1
+ return
}
if { [build_executable ${testfile}.exp ${exec2} "${srcfile2}" {debug}] == -1} {
- return -1
+ return
}
if { [build_executable ${testfile}.exp ${exec3} "${srcfile3}" {debug}] == -1 } {
- return -1
+ return
}
clean_restart ${exec1}
gdb_test "inferior 1" ".*" "switch to inferior 1 to run it"
if {![runto_main]} {
- return -1
+ return
}
gdb_test "break hello" ".*"
set compile_options {debug}
if { [build_executable ${testfile}.exp ${exec1} "${srcfile1}" $compile_options] == -1 } {
- return -1
+ return
}
if { [build_executable ${testfile}.exp ${exec2} "${srcfile2}" $compile_options] == -1 } {
- return -1
+ return
}
# Start with a fresh gdb
standard_testfile
if {[prepare_for_testing "failed to prepare" $testfile $srcfile]} {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
delete_breakpoints
"check thread b/p on main still has updated correctly"
if {![runto_main]} {
- return -1
+ return
}
gdb_test "info threads" \
set binfile3 [standard_output_file ${exec3}]
if { [build_executable ${testfile}.exp ${exec1} "${srcfile1}" {debug}] == -1 } {
- return -1
+ return
}
if { [build_executable ${testfile}.exp ${exec2} "${srcfile2}" {debug}] == -1 } {
- return -1
+ return
}
if { [build_executable ${testfile}.exp ${exec3} "${srcfile3}" {debug}] == -1 } {
- return -1
+ return
}
# Start two inferiors, place a checkpoint on inferior 2, but switch
require allow_multi_inferior_tests
if {[prepare_for_testing "failed to prepare" $testfile $srcfile]} {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
delete_breakpoints
gdb_load $binfile
if {![runto "a_function"]} {
- return -1
+ return
}
gdb_test "info inferiors" ".*" "info inferiors for logging"
require allow_multi_inferior_tests
if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug}]} {
- return -1
+ return
}
# Inferior 1 stops at f1.
standard_testfile
if {[build_executable "failed to prepare" $testfile $srcfile]} {
- return -1
+ return
}
# Cache whether we can run Python and/or Guile tests.
if { $run } {
if { ![runto_main] } {
- return -1
+ return
}
}
}
set binfile2 [standard_output_file $testfile2]
if {[build_executable ${testfile}.exp ${binfile1} "${srcfile1}"] != 0} {
- return -1
+ return
}
if {[build_executable ${testfile}.exp ${binfile2} "${srcfile2}"] != 0} {
- return -1
+ return
}
# Start the first inferior.
standard_testfile hello.c
if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} {pthreads debug}] } {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
# Add another inferior.
if { [build_executable "failed to prepare" ${exec1} "${srcfile1}" \
[list debug additional_flags=${march1}]] } {
- return -1
+ return
}
set options [list debug]
lappend options "compiler=[arm_cc_for_target]"
} else {
unsupported "ARM compiler is not known"
- return -1
+ return
}
} else {
lappend options "additional_flags=${march2}"
if { [build_executable "failed to prepare" ${exec2} "${srcfile2}" \
$options]} {
- return -1
+ return
}
# Start inferior 1
require can_spawn_for_attach
if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug pthreads}]} {
- return -1
+ return
}
# Start the programs running and then wait for a bit, to be sure that
require !use_gdb_stub
if {[build_executable "failed to prepare" $testfile $srcfile]} {
- return -1
+ return
}
# We are testing GDB's ability to stop all threads.
for {set i 1} {$i <= $NUM_INFS} {incr i} {
if {[start_inferior $i] < 0} {
- return -1
+ return
}
}
}
if {$live_inferior == ""} {
- return -1
+ return
}
gdb_test "inferior $live_inferior" \
}
if {$exited_inferior == ""} {
- return -1
+ return
}
}
}
require !use_gdb_stub
if {[build_executable "failed to prepare" $testfile $srcfile {debug}]} {
- return -1
+ return
}
# We are testing GDB's ability to stop all threads.
for {set i 1} {$i <= $NUM_INFS} {incr i} {
if {[start_inferior $i] < 0} {
- return -1
+ return
}
}
}
if {$live_inferior == ""} {
- return -1
+ return
}
gdb_test "inferior $live_inferior" \
with_test_prefix "exec1" {
if { [build_executable "failed to prepare" $testfile1 $srcfile1 \
[list pthreads debug]] } {
- return -1
+ return
}
}
with_test_prefix "exec2" {
if { [build_executable "failed to prepare" $testfile2 $srcfile2 \
[list pthreads debug]] } {
- return -1
+ return
}
}
require can_spawn_for_attach
if {[build_executable "failed to prepare" $testfile $srcfile {debug}]} {
- return -1
+ return
}
# Start the programs running and then wait for a bit, to be sure that
standard_testfile
if {[prepare_for_testing "failed to prepare" $testfile $srcfile]} {
- return -1
+ return
}
# Setup for the tests. Create two inferiors, both running the global
if { [gdb_compile_shlib $srcfile_lib $binfile_lib {}] != "" } {
untested "failed to compile shared library 1"
- return -1
+ return
}
set binfile_lib_target [gdb_download_shlib $binfile_lib]
[list debug \
additional_flags=-DSHLIB_NAME=\"$binfile_lib_target\" \
shlib_load]] } {
- return -1
+ return
}
# Start two inferiors, both running the same test binary. The arguments
standard_testfile
if { [build_executable ${testfile}.exp ${binfile} "${srcfile}" {debug}] != 0 } {
- return -1
+ return
}
proc switch_to_inferior { num message } {
require !use_gdb_stub
if {[build_executable "failed to prepare" $testfile $srcfile {debug}]} {
- return -1
+ return
}
# Setting the target to non-stop mode revealed a bug where the context
set binfile_other [standard_output_file $testfile_other]
if { [build_executable ${testfile}.exp ${binfile} "${srcfile}" {debug}] != 0 } {
- return -1
+ return
}
if { [build_executable ${testfile}.exp ${binfile_other} "${srcfile_other}" {debug}] != 0 } {
- return -1
+ return
}
proc do_test {} {
standard_testfile
if {[prepare_for_testing "failed to prepare" $testfile $srcfile]} {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
# Add a second inferior that will sleep longer.
"add the second inferior"
gdb_test "inferior 2" ".*Switching to inferior 2.*"
if {![runto_main]} {
- return -1
+ return
}
gdb_test "print duration=10" "= 10"
if { [build_executable "failed to prepare" ${testfile} ${srcfile} \
{pthreads debug}] } {
- return -1
+ return
}
with_test_prefix "single-inferior" {
clean_restart ${testfile}
if {![runto_main]} {
- return -1
+ return
}
gdb_test "info threads -gid" "\\* 1 +1 +.*"
with_test_prefix "restart" {
gdb_continue_to_end
if {![runto_main]} {
- return -1
+ return
}
}
with_test_prefix "restart" {
gdb_continue_to_end
if {![runto_main]} {
- return -1
+ return
}
}
require !use_gdb_stub
if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} {pthreads debug}] } {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
# Issue "thread apply TID_LIST p 1234" and expect EXP_TID_LIST (a list
standard_testfile
if {[build_executable "failed to build" $testfile $srcfile {debug}]} {
- return -1
+ return
}
# The test proper. DISPOSE indicates how to dispose of the fork
if { [gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
untested "failed to compile"
- return -1
+ return
}
clean_restart $executable
# Compile the generic OpenCL host app
if { [gdb_compile_opencl_hostapp "${clprogram}" "${testfile}" "" ] != "" } {
untested "failed to compile"
- return -1
+ return
}
clean_restart $testfile
# Compile the generic OpenCL host app
if { [gdb_compile_opencl_hostapp "${clprogram}" "${testfile}" "" ] != "" } {
untested "failed to compile"
- return -1
+ return
}
# Load the OpenCL app
# Compile the generic OpenCL host app
if { [gdb_compile_opencl_hostapp "${clprogram}" "${testfile}" "" ] != "" } {
untested "failed to compile"
- return -1
+ return
}
gdb_exit
# Compile the generic OpenCL host app
if { [gdb_compile_opencl_hostapp "${clprogram}" "${testfile}" "" ] != "" } {
untested "failed to compile"
- return -1
+ return
}
# Load the OpenCL app
# Compile the generic OpenCL host app
if { [gdb_compile_opencl_hostapp "${clprogram}" "${testfile}" "" ] != "" } {
untested "failed to compile"
- return -1
+ return
}
# Load the OpenCL app
# See if we have target board readnow.exp or similar.
if {[readnow]} {
untested "--readnever not allowed in combination with --readnow"
- return -1
+ return
}
save_vars { GDBFLAGS } {
append GDBFLAGS " -readnever"
if {[prepare_for_testing "failed to prepare" $testfile $srcfile nodebug]} {
- return -1
+ return
}
}
if {[prepare_for_testing "failed to prepare" $testfile \
[list $srcfile $srcfile2 $srcfile3] \
{debug optimize=-O2 nowarnings}]} {
- return -1
+ return
}
if {![runto start_sequence]} {
if { [prepare_for_testing "prepare for testing" ${testfile} ${srcfile} \
{debug f90 additional_flags=-O1}] } {
- return -1
+ return
}
if {![runto f]} {
if { [prepare_for_testing "failed to prepare" $testfile $srcfile \
{debug additional_flags=-Winline}] } {
- return -1
+ return
}
# Return a string that may be used to match the output of "info break NUM".
# Start with a clean state.
delete_breakpoints
if {![runto_main]} {
- return -1
+ return
}
# Assemble flags to pass to gdb_breakpoint. Lame but this is just
if {[prepare_for_testing "failed to prepare" $testfile \
[list $srcfile $srcfile2] {debug additional_flags=-Winline}]} {
- return -1
+ return
}
gdb_test_no_output "set listsize 1"
if {[prepare_for_testing "failed to prepare" $testfile \
[list $srcfile $srcfile2] {debug additional_flags=-Winline}]} {
- return -1
+ return
}
runto_main
if { [prepare_for_testing "failed to prepare" ${testfile} \
[list $srcfile] {debug optimize=-O1}] } {
- return -1
+ return
}
if { ![runto_main] } {
- return -1
+ return
}
# Delete all breakpoints, watchpoints, tracepoints, and catchpoints so that
if { [gdb_compile_shlib ${srcfile_lib} ${binfile_lib} $lib_flags] != ""
|| [gdb_compile ${srcfile} ${binfile} executable $bin_flags] != "" } {
untested "failed to compile"
- return -1
+ return
}
clean_restart ${::testfile}
if { [prepare_for_testing "failed to prepare" $testfile \
[list $srcfile $srcfile2] $opts] } {
- return -1
+ return
}
set val ""
if {[gdb_compile_pascal "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list debug class]] != "" } {
untested "failed to compile"
- return -1
+ return
}
clean_restart ${testfile}
if {[gdb_compile_pascal "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list debug ]] != "" } {
untested "failed to compile"
- return -1
+ return
}
clean_restart ${testfile}
if {[gdb_compile_pascal "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list debug ]] != "" } {
untested "failed to compile"
- return -1
+ return
}
clean_restart ${testfile}
standard_testfile .pas
if {[gdb_compile_pascal "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list debug ]] != "" } {
- return -1
+ return
}
clean_restart ${testfile}
standard_testfile .pas
if {[gdb_compile_pascal "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list debug ]] != "" } {
- return -1
+ return
}
clean_restart ${testfile}
standard_testfile .pas
if {[gdb_compile_pascal "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list debug ]] != "" } {
- return -1
+ return
}
clean_restart ${testfile}
standard_testfile .pas
if {[gdb_compile_pascal "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list debug ]] != "" } {
- return -1
+ return
}
# If this fails, the failure will have already been recorded.
lappend compile_flags "additional_flags=-DBACKTRACE_DEPTH=${BACKTRACE_DEPTH}"
if { [gdb_compile "$srcdir/$subdir/$srcfile" ${binfile} executable $compile_flags] != ""} {
- return -1
+ return
}
return 0
clean_restart $::testfile
if ![runto_main] {
- return -1
+ return
}
gdb_breakpoint "fun2"
# we only run to main function of child GDB, so child GDB's
# prompt can't be printed out.
if ![runto_main] {
- return -1
+ return
}
return 0
global srcdir subdir srcfile binfile
if { [gdb_compile "$srcdir/$subdir/$srcfile" ${binfile} executable {debug}] != "" } {
- return -1
+ return
}
return 0
} {
clean_restart $::testfile
if ![runto_main] {
- return -1
+ return
}
return 0
} {
write_skip_func_source $skip_func_file "skip_func" [expr 4 * $SKIP_DIRECTIVE_COUNT]
if { [gdb_compile [list "$srcdir/$subdir/$srcfile" $skip_func_file] ${binfile} executable {c++ debug}] != "" } {
- return -1
+ return
}
return 0
} {
if { [gdb_compile "$srcdir/$subdir/$srcfile" ${binfile} executable $opts] != "" } {
untested "failed to compile"
- return -1
+ return
}
return 0
clean_restart $::testfile
if ![runto_main] {
- return -1
+ return
}
return 0
} {
# Compile.
if { [gdb_compile_shlib $src $exe {debug}] != "" } {
- return -1
+ return
}
# Delete object files to save some space.
}
if { [gdb_compile "$srcdir/$subdir/$srcfile" ${binfile} executable $compile_flags] != "" } {
- return -1
+ return
}
return 0
clean_restart $::testfile
if ![runto_main] {
- return -1
+ return
}
return 0
} {
lappend compile_flags "additional_flags=-DEXPANSION_DEPTH=${EXPANSION_DEPTH}"
if { [gdb_compile "$srcdir/$subdir/$srcfile" ${binfile} executable $compile_flags] != ""} {
- return -1
+ return
}
return 0
clean_restart $::testfile
if ![runto_main] {
- return -1
+ return
}
return 0
standard_testfile
if { [prepare_for_testing "failed to prepare" $testfile $srcfile] } {
- return -1
+ return
}
# Connect to gdbserver and run to a breakpoint in main. Record the
standard_testfile
if { [build_executable "failed to build exec" $testfile $srcfile {debug pthreads}] } {
- return -1
+ return
}
# Start the inferior and record a remote log for our interaction with it.
# Build the host executable.
if { [build_executable "failed to prepare" \
$testfile $srcfile {debug hip}] == -1 } {
- return -1
+ return
}
set hipmodule_path [standard_output_file ${testfile}.co]
if { [gdb_compile $srcdir/$subdir/$srcfile \
$hipmodule_path object \
{ debug hip additional_flags=--genco additional_flags=-DDEVICE } ] != "" } {
- return -1
+ return
}
proc do_test { } {
standard_testfile
if {[build_executable "failed to prepare" $testfile $srcfile {debug pthreads}]} {
- return -1
+ return
}
# Run "info threads" and return a list of various information:
standard_testfile
if { [prepare_for_testing "failed to prepare" $testfile $srcfile {debug pthread}] } {
- return -1
+ return
}
# WHICH is which thread exits the process. Can be "main" for main
require gdb_trace_common_supports_arch
if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
- return -1
+ return
}
proc test_actions_changed { } {
clean_restart $testfile
if {![runto_main]} {
- return -1
+ return
}
if {![gdb_target_supports_trace]} {
unsupported "current target does not support trace"
- return -1
+ return
}
test_actions_changed
if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \
executable {debug nowarnings}] != "" } {
untested "failed to compile"
- return -1
+ return
}
clean_restart
gdb_breakpoint "main"
gdb_run_cmd
if {[gdb_test "" "Breakpoint .*" "run to main"] != 0} {
- return -1
+ return
}
if {![gdb_target_supports_trace]} {
unsupported "target does not support trace"
- return -1
+ return
}
gdb_trace_setactions "set actions for first tracepoint" \
if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \
executable {debug nowarnings}] != "" } {
untested "failed to compile"
- return -1
+ return
}
clean_restart $testfile
if {[prepare_for_testing "failed to prepare" $executable $srcfile \
[list debug nowarnings nopie]]} {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
if {![gdb_target_supports_trace]} {
}
if {$return_me == 1} {
- return -1
+ return
}
#
if { [build_executable "failed to prepare" $testfile $srcfile \
[list debug shlib=$libipa]] } {
- return -1
+ return
}
save_vars { env(ASAN_OPTIONS) } {
}
if {![runto_main]} {
- return -1
+ return
}
pass "inferior with libinproctrace.so started"
|| [gdb_compile_shlib $libsrc2 $lib_sl2 $lib_opts] != ""
|| [gdb_compile $srcdir/$subdir/$srcfile $binfile executable $additional_flags] != ""} {
untested "failed to compile"
- return -1
+ return
}
clean_restart $executable
gdb_load_shlib $lib_sl2
if {![runto_main]} {
- return -1
+ return
}
if {![gdb_target_supports_trace]} {
unsupported "current target does not support trace"
- return -1
+ return
}
if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile executable \
[list debug nowarnings shlib=$libipa shlib=$lib_sl1 shlib_load] ] != "" } {
untested "failed to compile"
- return -1
+ return
}
tracepoint_change_loc_1 "ftrace"
standard_testfile
if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug nowarnings nopie}]} {
- return -1
+ return
}
# Tests:
}
if { ![runto_main] } {
- return -1
+ return
}
if { ![gdb_target_supports_trace] } {
set executable $testfile
if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug nowarnings nopie}]} {
- return -1
+ return
}
# Tests:
if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \
executable {debug nowarnings}] != "" } {
untested "failed to compile"
- return -1
+ return
}
clean_restart
if { [info proc gdb_reconnect] == "" } {
unsupported "target does not support reconnect"
- return -1
+ return
}
if {[prepare_for_testing "failed to prepare" $executable $srcfile \
{debug nowarnings}]} {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
if {![gdb_target_supports_trace]} {
unsupported "target does not support trace"
- return -1
+ return
}
# Disconnect in tracing.
if {[gdb_compile ${srcdir}/${subdir}/${srcfile} ${binfile}1.o \
object {nodebug}] != ""} {
- return -1
+ return
}
if {[gdb_compile [list ${binfile}1.o] \
"${binfile}1" executable {}] != ""} {
- return -1
+ return
}
clean_restart ${testfile}1
# The following test makes no sense if the offset is unknown. We need
# to update the pattern above to match call or branch instruction for
# the target architecture.
- return -1
+ return
}
# Make some DWARF for the test.
}
if {[gdb_compile $asm_file ${binfile}2.o object {nodebug}] != ""} {
- return -1
+ return
}
if {[gdb_compile [list ${binfile}1.o ${binfile}2.o] \
"${binfile}" executable {}] != ""} {
- return -1
+ return
}
clean_restart ${testfile}
if {![runto_main]} {
- return -1
+ return
}
gdb_breakpoint "foo"
load_lib "trace-support.exp"
if {![runto_main]} {
- return -1
+ return
}
if {![gdb_target_supports_trace]} {
unsupported "target does not support trace"
- return -1
+ return
}
gdb_test "trace foo" "Tracepoint $decimal at .*"
}
if {![runto_main]} {
- return -1
+ return
}
if {![gdb_target_supports_trace]} {
unsupported "target does not support trace"
- return -1
+ return
}
}
}
if {![runto_main]} {
- return -1
+ return
}
if { [gdb_test "info sharedlibrary" ".*${remote_libipa}.*" "IPA loaded"] != 0 } {
if {[prepare_for_testing "failed to prepare" $executable $srcfile \
[list debug $additional_flags]]} {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
if {![gdb_target_supports_trace]} {
unsupported "target does not support trace"
- return -1
+ return
}
require allow_in_proc_agent
if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \
executable [list debug nopie $additional_flags shlib=$libipa] ] != "" } {
untested "failed to compile"
- return -1
+ return
}
clean_restart ${executable}
if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \
executable {debug nowarnings}] != "" } {
untested "failed to compile"
- return -1
+ return
}
clean_restart
"collect gdb_struct1_test" "^$"
gdb_run_cmd
if {[gdb_test "" "Breakpoint ${decimal}, main.*" "run to main"] != 0} {
- return -1
+ return
}
if {![gdb_target_supports_trace]} {
require gdb_trace_common_supports_arch
if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} {debug}] } {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
if {![gdb_target_supports_trace]} {
unsupported "current target does not support trace"
- return -1
+ return
}
gdb_exit
standard_testfile trace-unavailable.c
if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} {debug nopie}] } {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
if {![gdb_target_supports_trace]} {
unsupported "current target does not support trace"
- return -1
+ return
}
gdb_exit
"additional_flags=-DTFILE_DIR=\"$tfile_dir\""]] \
!= "" } {
untested "failed to compile"
- return -1
+ return
}
# Make sure we are starting fresh.
if { [gdb_compile_shlib $libsrc1 $lib_sl1 $lib_opts] != ""
|| [gdb_compile_shlib $libsrc2 $lib_sl2 $lib_opts] != ""} {
untested "failed to compile shared library"
- return -1
+ return
}
set exec_opts [list debug shlib=$lib_sl1 shlib_load]
if { [gdb_compile $srcdir/$subdir/$srcfile $binfile executable $exec_opts] != "" } {
untested "failed to compile"
- return -1
+ return
}
load_lib mi-support.exp
if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \
executable {debug nowarnings}] != "" } {
untested "failed to compile"
- return -1
+ return
}
# Test notifications on creating, deleting and modifying TSV.
clean_restart $testfile
if {![runto_main]} {
- return -1
+ return
}
if {![gdb_target_supports_trace]} {
unsupported "current target does not support trace"
- return -1
+ return
}
gdb_exit
standard_testfile
if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
- return -1
+ return
}
# Start GDB, but don't run so that we have no process attached.
with_test_prefix "after tstart" {
if {![runto_main]} {
- return -1
+ return
}
}
if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \
executable {debug nowarnings}] != "" } {
untested "failed to compile"
- return -1
+ return
}
clean_restart $testfile
if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \
executable {debug nowarnings}] != "" } {
untested "failed to compile"
- return -1
+ return
}
clean_restart $testfile
if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \
executable {debug nowarnings}] != "" } {
untested "failed to compile"
- return -1
+ return
}
clean_restart
if { [gdb_compile_shlib $libsrc1 $lib_sl1 $lib_opts] != ""
|| [gdb_compile_shlib $libsrc2 $lib_sl2 $lib_opts] != ""} {
untested "failed to compile shared library"
- return -1
+ return
}
set exec_opts [list debug shlib=$lib_sl1 shlib_load]
if { [gdb_compile $srcdir/$subdir/$srcfile $binfile executable $exec_opts] != "" } {
untested "failed to compile"
- return -1
+ return
}
clean_restart $executable
gdb_load_shlib $lib_sl2
if {![runto_main]} {
- return -1
+ return
}
if {![gdb_target_supports_trace]} {
unsupported "current target does not support trace"
- return -1
+ return
}
# Verify pending tracepoint is resolved to running to main.
# Start with a fresh gdb.
clean_restart $executable
if {![runto_main]} {
- return -1
+ return
}
gdb_test_multiple "$trace_type set_point2" "set pending tracepoint on set_point2" {
# Start with a fresh gdb.
clean_restart $executable
if {![runto_main]} {
- return -1
+ return
}
gdb_test "next" ".*"
# Start with a fresh gdb.
clean_restart $executable
if {![runto_main]} {
- return -1
+ return
}
gdb_test_multiple "trace pendfunc3" "set pending tracepoint on set_point2" {
# Start with a fresh gdb.
clean_restart $executable
if {![runto_main]} {
- return -1
+ return
}
gdb_test_multiple "trace set_point2" "set pending tracepoint on set_point2" {
# Start with a fresh gdb.
clean_restart $executable
if {![runto_main]} {
- return -1
+ return
}
gdb_test_multiple "$trace_type set_point2" "set pending tracepoint on set_point2" {
if { [gdb_compile $srcdir/$subdir/$srcfile $binfile executable $exec_opts] != "" } {
untested "failed to compile with in-process agent library"
- return -1
+ return
}
pending_tracepoint_resolved "ftrace"
if {[prepare_for_testing "failed to prepare for trace tests" \
$executable $srcfile [list debug]]} {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
if {![gdb_target_supports_trace]} {
unsupported "target does not support trace"
- return -1
+ return
}
gdb_test "trace start" ".*"
standard_testfile
if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug nopie}]} {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
# Check whether the target supports tracepoints.
if {![gdb_target_supports_trace]} {
unsupported "current target does not support trace"
- return -1
+ return
}
# Run a trace session, stop it, and then inspect the resulting trace
}
}
if { $traceframe_info_supported == -1 } {
- return -1
+ return
}
# Check whether we're testing with our own GDBserver.
set is_gdbserver [target_is_gdbserver]
if { $is_gdbserver == -1 } {
- return -1
+ return
}
# Now disassemble (IOW, read from read-only memory) while inspecting a
if {[prepare_for_testing "failed to prepare" $executable $srcfile \
{debug nowarnings}]} {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
if {![gdb_target_supports_trace]} {
unsupported "target does not support trace"
- return -1
+ return
}
if {![gdb_range_stepping_enabled]} {
unsupported "range stepping not supported by the target"
- return -1
+ return
}
# Check that range stepping works well with tracepoints.
if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \
executable [list debug nowarnings shlib=$libipa] ] != "" } {
untested "failed to compile"
- return -1
+ return
}
clean_restart ${executable}
standard_testfile
if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug nopie}]} {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
if {![gdb_target_supports_trace]} {
unsupported "target does not support trace"
- return -1
+ return
}
# Set tracepoints, start tracing and collect data.
if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \
executable {debug nowarnings nopie}] != "" } {
untested "failed to compile"
- return -1
+ return
}
clean_restart $testfile
runto_main
}
if {$return_me == 1} {
- return -1
+ return
}
#
if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \
executable {debug nowarnings}] != "" } {
untested "failed to compile"
- return -1
+ return
}
clean_restart
standard_testfile
if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
if {![gdb_target_supports_trace]} {
unsupported "target does not support trace"
- return -1
+ return
}
# Step 1, find the syscall instruction address.
set syscall_insn "\[ \t\](swi|svc)\[ \t\]"
} else {
unsupported "unknown syscall instruction"
- return -1
+ return
}
# Start with a fresh gdb.
clean_restart ${testfile}
if {![runto_main]} {
- return -1
+ return
}
gdb_breakpoint "kill" -qualified
if {![compile_stap_bin "stap-probe-nosem"]} {
# An appropriate failure message has already been output
- return -1
+ return
}
clean_restart $executable
if {![compile_stap_bin "stap-probe-sem" "-DUSE_PROBES"]} {
# An appropriate failure message has already been output
- return -1
+ return
}
gdb_collect_probe_arg "probe args with semaphore" "-probe-stap two" "46"
if {[prepare_for_testing "failed to prepare" $executable $srcfile \
{debug nowarnings}]} {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
if {![gdb_target_supports_trace]} {
unsupported "target does not support trace"
- return -1
+ return
}
# Verify that the sequence of commands "tstart tstop tstart" works well.
if { [gdb_compile $srcdir/$subdir/$srcfile $binfile executable $additional_flags] != ""} {
untested "UST library or headers are not installed"
- return -1
+ return
}
# Test that the socket file is removed when GDB quits, detaches or
clean_restart $executable
gdb_load_shlib $libipa
if {![runto_main]} {
- return -1
+ return
}
if {![gdb_target_supports_trace]} {
# At this point, the socket file has been created. We must make sure it is
# the socket file.
gdb_test "detach" "Detaching .*, process .*"
unsupported "current target does not support trace"
- return -1
+ return
}
# Double-check that marker ID ("-m") is not mistaken for an explicit location
"additional_flags=-DTFILE_DIR=\"$tfile_dir\""]] \
!= "" } {
untested "failed to compile"
- return -1
+ return
}
# Make sure we are starting fresh.
if { ![generate_tracefile $binfile] } {
unsupported "unable to generate trace file"
- return -1
+ return
}
if {!$purely_local} {
if { [gdb_compile "$srcdir/$subdir/$srcfile" "$binfile" \
executable {debug nowarnings nopie}] != "" } {
untested "failed to compile"
- return -1
+ return
}
clean_restart $testfile
}
if {$return_me == 1} {
- return -1
+ return
}
# test tstatus (when trace on)
}
if {$return_me == 1} {
- return -1
+ return
}
# test tstatus (when trace off)
if {[prepare_for_testing "failed to prepare" $executable $srcfile \
[list debug $additional_flags]]} {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
if {![gdb_target_supports_trace]} {
unsupported "target does not support trace"
- return -1
+ return
}
# Set breakpoint and tracepoint at the same address.
# Start with a fresh gdb.
clean_restart ${executable}
if {![runto_main]} {
- return -1
+ return
}
gdb_test_no_output "set breakpoint always-inserted ${option}"
# Start with a fresh gdb.
clean_restart ${executable}
if {![runto_main]} {
- return -1
+ return
}
gdb_test_no_output "set breakpoint always-inserted ${option}"
# Start with a fresh gdb.
clean_restart ${executable}
if {![runto_main]} {
- return -1
+ return
}
gdb_test_no_output "set breakpoint always-inserted ${option}"
# Start with a fresh gdb.
clean_restart ${executable}
if {![runto_main]} {
- return -1
+ return
}
gdb_test_no_output "set breakpoint always-inserted ${option}"
# Start with a fresh gdb.
clean_restart ${executable}
if {![runto_main]} {
- return -1
+ return
}
gdb_breakpoint "marker" -qualified
# Start with a fresh gdb.
clean_restart ${executable}
if {![runto_main]} {
- return -1
+ return
}
gdb_breakpoint "marker" -qualified
if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \
executable [list debug $additional_flags shlib=$libipa] ] != "" } {
untested "failed to compile"
- return -1
+ return
}
clean_restart ${executable}
if {[prepare_for_testing "failed to prepare" $testfile $srcfile \
{debug nowarnings}]} {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
if {![gdb_target_supports_trace]} {
unsupported "target does not support trace"
- return -1
+ return
}
set BUFFER_SIZE 4
# If we did not get the default size then there is no point in running the
# tests below.
if { $default_size < 0 } {
- return -1
+ return
}
# Change buffer size to 'BUFFER_SIZE'.
if {[prepare_for_testing "failed to prepare" $executable $srcfile \
[list debug $additional_flags]]} {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
if {![gdb_target_supports_trace]} {
unsupported "target does not support trace"
- return -1
+ return
}
require allow_in_proc_agent
if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \
executable [list debug $additional_flags shlib=$libipa] ] != "" } {
untested "failed to compile"
- return -1
+ return
}
clean_restart ${executable}
require gdb_trace_common_supports_arch
if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile executable $options] != "" } {
untested "failed to compile"
- return -1
+ return
}
clean_restart ${testfile}
if {![runto_main]} {
- return -1
+ return
}
if {![gdb_target_supports_trace]} {
unsupported "target does not support trace"
- return -1
+ return
}
# Compile the test case with the in-process agent library.
if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile executable $options] != "" } {
untested "failed to compile with in-process agent library"
- return -1
+ return
}
# This test makes sure that disabling and enabling tracepoints works
}
if {![runto_main]} {
- return -1
+ return
}
if {![gdb_target_supports_trace]} {
unsupported "target does not support trace"
- return -1
+ return
}
}
# Make sure inferior is running in all-stop mode.
gdb_test_no_output "set non-stop 0"
if {![runto_main]} {
- return -1
+ return
}
gdb_test "break set_point1" "Breakpoint \[0-9\] at $hex: file.*"
# Start with a fresh gdb.
clean_restart $testfile
if {![runto_main]} {
- return -1
+ return
}
gdb_test_no_output "set breakpoint always-inserted ${option}"
if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \
executable {debug nowarnings}] != "" } {
untested "failed to compile"
- return -1
+ return
}
clean_restart
if {[prepare_for_testing "failed to prepare" $testfile $srcfile \
[list debug additional_flags=-mavx]]} {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
if {![gdb_target_supports_trace]} {
unsupported "target does not support trace"
- return -1
+ return
}
gdb_test_multiple "print \$ymm15" "check for AVX support" {
# Check that the target supports trace.
if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile executable $options] != "" } {
untested "failed to compile"
- return -1
+ return
}
clean_restart ${testfile}
if {![runto_main]} {
- return -1
+ return
}
if {![gdb_target_supports_trace]} {
unsupported "target does not support trace"
- return -1
+ return
}
# Compile the test case with the in-process agent library.
if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \
executable [concat {debug c} shlib=$ipalib]] != "" } {
untested "failed to compile"
- return -1
+ return
}
# Typically we need a little extra time for this test.
if {[prepare_for_testing "failed to prepare" $executable $srcfile \
[list debug]]} {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
if {![gdb_target_supports_trace]} {
unsupported "target does not support trace"
- return -1
+ return
}
set tstatus_output ""
if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \
executable {debug nowarnings}] != "" } {
untested "failed to compile"
- return -1
+ return
}
clean_restart $testfile
if { [gdb_compile ${srcdir}/${subdir}/${srcfile} ${binfile}1.o \
object {nodebug}] != "" } {
- return -1
+ return
}
Dwarf::assemble $asm_file {
}
if { [gdb_compile ${asm_file} ${binfile}2.o object {nodebug}] != "" } {
- return -1
+ return
}
if { [gdb_compile [list ${binfile}1.o ${binfile}2.o] ${binfile} \
executable {}] != "" } {
- return -1
+ return
}
clean_restart ${testfile}
if {![runto_main]} {
- return -1
+ return
}
if {![gdb_target_supports_trace]} {
unsupported "target does not support trace"
- return -1
+ return
}
gdb_breakpoint "end" -qualified
if {[prepare_for_testing "failed to prepare" $testfile $srcfile \
{debug nowarnings c++ nopie}]} {
- return -1
+ return
}
set ws "\[\r\n\t \]+"
if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \
executable {debug nowarnings}] != "" } {
untested "failed to compile"
- return -1
+ return
}
clean_restart $testfile
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" $binfile \
executable {debug nowarnings}] != "" } {
untested "failed to compile"
- return -1
+ return
}
clean_restart
gdb_breakpoint "main"
gdb_run_cmd
if {[gdb_test "" "Breakpoint .*" "run to main"] != 0} {
- return -1
+ return
}
if {![gdb_target_supports_trace]} {
unsupported "target does not support trace"
- return -1
+ return
}
gdb_trace_setactions "set stepcount to $stepcount" \