lappend_include_file flags $srcdir/lib/unbuffer_output.c
if { [prepare_for_testing "failed to prepare" $testfile $srcfile $flags] } {
- return -1
+ return
}
# Run with no arguments.
standard_testfile
if {[build_executable "failed to prepare" $testfile $srcfile {debug}] == -1} {
- return -1
+ return
}
# The test proper. NON_STOP indicates whether we're testing in
if {[build_executable $testfile.exp $testfile $srcfile debug] == -1} {
untested "failed to compile"
- return -1
+ return
}
# Use 'spawn_wait_for_attach' to start the test program running. It'll
if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} \
{debug c++}] } {
- return -1
+ return
}
set lineno [gdb_get_line_number "multiple locations here"]
standard_testfile
if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
- return -1
+ return
}
if {![runto_main]} {
standard_testfile all-types.c
if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
- return -1
+ return
}
#
standard_testfile
if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug] == -1} {
- return -1
+ return
}
# Because runto_main doesn't know how to handle the prompt with annotations,
standard_testfile
if { [prepare_for_testing "failed to prepare" $testfile $srcfile] } {
- return -1
+ return
}
#
standard_testfile
if { [prepare_for_testing "failed to prepare" $testfile $srcfile] } {
- return -1
+ return
}
if { [file type $srcfilelink] != "link" } {
unsupported "target directory cannot have symbolic links"
- return -1
+ return
}
if { [gdb_compile "${srcdir}/${subdir}/${srcfile} ${srcfilelink}" "${binfile}" \
executable {debug}] != "" } {
untested "failed to compile"
- return -1
+ return
}
clean_restart ${testfile}
if {![runto_main]} {
- return -1
+ return
}
gdb_breakpoint func message
standard_testfile .c
if { [prepare_for_testing "failed to prepare" $testfile $srcfile {debug}] } {
- return -1
+ return
}
if {![runto_main]} {
if {[build_executable $testfile.exp $testfile $srcfile] == -1} {
untested "failed to compile"
- return -1
+ return
}
# Assuming a running GDB. Check the status of the single inferior
set has_argv0 [gdb_has_argv0]
if { [build_executable ${testfile}.exp ${testfile} ${srcfile}] == -1 } {
- return -1
+ return
}
with_test_prefix "file symlink" {
standard_testfile int-type.c
if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug nowarnings}]} {
- return -1
+ return
}
if {[prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} \
[list debug ${lang}]]} {
- return -1
+ return
}
gdb_test_no_output "set print array-indexes on"
if {[prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} \
[list debug ${lang}]]} {
- return -1
+ return
}
if {![runto_main]} {
standard_testfile
if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
- return -1
+ return
}
if {![runto_main]} {
standard_testfile
if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
- return -1
+ return
}
#
standard_testfile
if { [build_executable "failed to prepare" $testfile $srcfile] } {
- return -1
+ return
}
set test_spawn_id [spawn_wait_for_attach $binfile]
standard_testfile
if {[build_executable "failed to build" $testfile $srcfile {debug}]} {
- return -1
+ return
}
set test_spawn_id [spawn_wait_for_attach $binfile]
standard_testfile
if { [build_executable ${testfile}.exp ${testfile} $srcfile {debug}] == -1 } {
- return -1
+ return
}
proc do_test {} {
if {[build_executable_own_libs ${testfile}.exp $executable $srcfile \
{pie}] == ""} {
- return -1
+ return
}
# Program Headers:
set dynamic_vaddr_prelinkno [lindex $phdr 0]
if {![prelink_yes $prelink_args]} {
- return -1
+ return
}
set phdr [read_phdr $binfile "readelf with prelink -R"]
set executable ${testfile}
if { [prepare_for_testing "failed to prepare" $executable "" [list debug pie]] } {
- return -1
+ return
}
set arch ""
set executable ${testfile}
if { [prepare_for_testing "failed to prepare" $executable] } {
- return -1
+ return
}
# Start the program running and then wait for a bit, to be sure
standard_testfile
if {[build_executable "failed to build" $testfile $srcfile debug]} {
- return -1
+ return
}
# Start the program running, and return its PID, ready for attaching.
#
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
untested "failed to compile"
- return -1
+ return
}
# Build the in-system-call test
if { [gdb_compile "${srcdir}/${subdir}/${srcfile2}" "${binfile2}" executable {debug}] != "" } {
untested "failed to compile in-system-call test"
- return -1
+ return
}
# Build the third file, used to check attach when the exec-file has changed.
if { [gdb_compile "${srcdir}/${subdir}/${srcfile3}" "${binfile3}" executable {debug}] != "" } {
untested "failed to compile attach exec-file changed test"
- return -1
+ return
}
# This is a test of the error cases for gdb's ability to attach to a
standard_testfile
if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
- return -1
+ return
}
require have_native_target
remote_exec host "rm -rf ${targetdir}"
if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
- return -1
+ return
}
remote_exec host "mkdir -p ${targetscriptdir}"
&& [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable \
{debug}] != "" } {
untested "failed to compile"
- return -1
+ return
}
# Use a fresh directory to confine the native core dumps.
standard_testfile
if { [prepare_for_testing "failed to prepare" $testfile $srcfile] } {
- return -1
+ return
}
if {![runto_main]} {
if {[prepare_for_testing "failed to prepare" ${testfile}! $srcfile \
{debug nowarnings}]} {
- return -1
+ return
}
# Verify that we can run the program and that it terminates normally.
standard_testfile
if {[build_executable "failed to prepare" $testfile $srcfile debug] == -1} {
- return -1
+ return
}
set file_arg $binfile
# Compile shared library:
if { [gdb_compile_shlib ${srcfile_lib} ${binfile_lib} $lib_flags] != "" } {
untested "failed to compile"
- return -1
+ return
}
# Open the shared library and determine some basic facts. The key
if { ![string equal $data "\x7fELF"] } {
close $solib_fp
untested "shared library is not an ELF file"
- return -1
+ return
}
# Read EI_CLASS for ELF32 versus ELF64.
${binfile_lib}} output] } {
untested "failed objcopy dump-section"
verbose -log "objcopy output: $output"
- return -1
+ return
}
# Determine length of .dynstr. We'll use the length for creating invalid
${binfile_lib}} output] } {
untested "failed objcopy update-section"
verbose -log "objcopy output: $output"
- return -1
+ return
}
clean_restart
standard_testfile
if {[build_executable "failed to prepare" $testfile $srcfile debug]} {
- return -1
+ return
}
# Run the test. Sets a breakpoint with a condition that sends a
standard_testfile
if { [build_executable "failed to prepare" ${testfile} $srcfile] } {
- return -1
+ return
}
set linenum [gdb_get_line_number "set break here"]
standard_testfile
if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
- return -1
+ return
}
#
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
untested "failed to compile"
- return -1
+ return
}
set has_signed_bitfields 1
standard_testfile
if {[build_executable "failed to prepare" $testfile $srcfile debug]} {
- return -1
+ return
}
# See intro.
standard_testfile
if {[build_executable "failed to prepare" $testfile $srcfile debug]} {
- return -1
+ return
}
set x_file ${srcdir}/${subdir}/$testfile.gdb
standard_testfile
if {[build_executable "failed to prepare" $testfile $srcfile]} {
- return -1
+ return
}
set script_file $srcdir/$subdir/$testfile.gdb
standard_testfile
if {[prepare_for_testing "failed to prepare" $testfile $srcfile]} {
- return -1
+ return
}
set script_file ${srcdir}/${subdir}/$testfile.gdb
# 'show breakpoint condition-evaluation' checks below will be
# performed with the remote connection in place.
if { ![runto_main] } {
- return -1
+ return
}
# This test relies on reading address zero triggering a SIGSEGV.
}
if {[build_executable "failed to prepare" $testfile $srcfile $options]} {
- return -1
+ return
}
set line_bp [gdb_get_line_number "write permanent bp"]
standard_testfile
if { [build_executable ${testfile}.exp ${testfile} $srcfile {debug}] == -1 } {
- return -1
+ return
}
with_test_prefix "single-step" {
# with duplicated breakpoints.
if { [prepare_for_testing "failed to prepare" break-always break-always.c] } {
- return -1
+ return
}
set bar_location [gdb_get_line_number "break in bar" break-always.c]
standard_testfile
if { [prepare_for_testing "failed to prepare" ${testfile}] } {
- return -1
+ return
}
if {![runto callee]} {
require !use_gdb_stub
if { [prepare_for_testing "failed to prepare" ${testfile} $srcfile {additional_flags=-static}] } {
- return -1
+ return
}
set test "info files"
standard_testfile
if { [prepare_for_testing ${testfile}.exp $testfile] } {
- return -1
+ return
}
set bp_line [gdb_get_line_number "break here" ${testfile}.c]
if { [prepare_for_testing "failed to prepare" "break-inline" {} {debug nowarnings optimize=-O2}] } {
- return -1
+ return
}
gdb_breakpoint "main" "temporary"
if {[build_executable "build library" ${binfile_lib} ${srcfile_lib} \
{debug shlib}] == -1} {
- return -1
+ return
}
if {[build_executable ${test}.exp $binfile_test ${srcfile_test} {}] == -1} {
- return -1
+ return
}
# Note: The separate debug info file content build-id/crc32 are not verified
standard_testfile
if {[build_executable "failed to prepare" $testfile $srcfile debug]} {
- return -1
+ return
}
# Run the test proper. INITIAL_LOAD determines whether the program is
{c++ ldflags=-Wl,--gc-sections} \
$srcfile {debug c++ additional_flags=-ffunction-sections}]} {
untested "failed to compile"
- return -1
+ return
}
clean_restart $testfile
if { [gdb_compile_shlib $srcfile_lib $binfile_lib {}] != "" } {
untested "failed to compile shared library"
- return -1
+ return
}
set binfile_lib_target [gdb_download_shlib $binfile_lib]
if { [prepare_for_testing "failed to prepare" $testfile $srcfile \
[list debug shlib_load additional_flags=-DSHLIB_NAME=\"$binfile_lib_target\"]] } {
- return -1
+ return
}
gdb_locate_shlib $binfile_lib
}
if { $pc == "" } {
unsupported "Couldn't get $pc"
- return -1
+ return
}
regsub "0x0*" $pc "" pc
if { ! $using_probes } {
unsupported "probes not present on this system"
- return -1
+ return
}
set sysroot ""
standard_testfile
if {[build_executable "failed to prepare" $testfile $srcfile debug]} {
- return -1
+ return
}
# Run the test proper. INITIAL_LOAD determines whether the program is
# This file was written by Rob Savoye. (rob@cygnus.com)
if { [build_executable "failed to prepare" "break" {break.c break1.c} {debug nowarnings}] } {
- return -1
+ return
}
set srcfile break.c
set srcfile1 break1.c
# on targets with optimized prologues
if { [build_executable "failed to prepare" "breako2" {break.c break1.c} {debug nowarnings optimize=-O2}] } {
- return -1
+ return
}
proc_with_prefix test_break_optimized_prologue {} {
standard_testfile
if { [prepare_for_testing "failed to prepare" $testfile $srcfile] } {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
# Delete all target-supplied memory regions.
if {![get_function_bounds "main" main_lo main_hi]} {
# Can't do the following tests if main's bounds are unknown.
- return -1
+ return
}
# Manually create a read-only memory region that covers 'main'.
standard_testfile
if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
- return -1
+ return
}
# 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
standard_testfile bt-on-fatal-signal.c
if {[prepare_for_testing "failed to prepare" $testfile $srcfile]} {
- return -1
+ return
}
# Check we can run to main. If this works this time then we just
# assume that it will work later on (when we repeatedly restart GDB).
if {![runto_main]} {
- return -1
+ return
}
# Check that the backtrace-on-fatal-signal feature is supported. If
require {!is_remote host}
if {[prepare_for_testing "failed to prepare" $testfile $srcfile]} {
- return -1
+ return
}
# Check we can run to main. If this works this time then we just
# assume that it will work later on (when we repeatedly restart GDB).
if {![runto_main]} {
- return -1
+ return
}
# Check that the backtrace-on-fatal-signal feature is supported. If
standard_testfile
if { [build_executable "failed to prepare" $testfile $srcfile debug] } {
- return -1
+ return
}
proc check_selected_frame_after_bt { bt_cmd stack_pattern } {
if {[build_executable "failed to prepare" $testfile $srcfile \
{debug build-id}] == -1} {
- return -1
+ return
}
# Split out BINFILE.debug. Remove debug from BINFILE.
if {[gdb_gnu_strip_debug $binfile] != 0} {
- return -1
+ return
}
# Get the '.build-id/xx/xxx...xxx' part of the filename.
set sources "${srcdir}/${subdir}/${srcfile} ${srcdir}/${subdir}/${srcfile2}"
if { [gdb_compile "${sources}" "${binfile}" executable {debug}] != "" } {
untested "failed to compile"
- return -1
+ return
}
clean_restart
# Only run on native boards.
require !use_gdb_stub
if { [target_info gdb_protocol] == "extended-remote" } {
- return -1
+ return
}
# Because we need to modify the source file later, it's better if we
set srcfile $newsrc
if { [prepare_for_testing "failed to prepare" $testfile $srcfile] } {
- return -1
+ return
}
# Get the line number for the line with the "break-here" marker.
# Recompile the modified source. We use "gdb_compile" here instead of
# "prepare_for_testing" because we don't want to call "clean_restart".
if { [gdb_compile "${srcfile}" "${binfile}" executable {debug}] != "" } {
- return -1
+ return
}
# Rerun the program. This should not only force GDB to reload the
lappend_include_file flags $srcdir/lib/unbuffer_output.c
if {[prepare_for_testing "failed to prepare" $testfile $srcfile $flags]} {
- return -1
+ return
}
lappend_include_file flags $srcdir/lib/unbuffer_output.c
if {[prepare_for_testing "failed to prepare" $testfile $srcfile $flags]} {
- return -1
+ return
}
gdb_test_no_output "set print sevenbit-strings"
standard_testfile .c
if { [prepare_for_testing "failed to prepare" ${testfile} $srcfile] } {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
gdb_breakpoint [gdb_get_line_number "STOP"]
if { [prepare_for_testing "failed to prepare" $testfile $srcfile \
{nodebug}] == -1} {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
gdb_test "p a_loc ()" \
if { [prepare_for_testing "failed to prepare" ${testfile} $srcfile \
{additional_flags=-static}] } {
- return -1
+ return
}
gdb_test "catch fork" "Catchpoint \[0-9\]* \\(fork\\)"
lappend_include_file flags $srcdir/lib/unbuffer_output.c
if {[prepare_for_testing "failed to prepare" $testfile $srcfile $flags]} {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
gdb_test "handle SIGSEGV nostop noprint" \
standard_testfile .c
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug shlib_load}] != "" } {
untested "failed to compile"
- return -1
+ return
}
set testfile2 catch-load-so
set binfile2_dlopen [shlib_target_file ${testfile2}.so]
if { [gdb_compile_shlib "${srcdir}/${subdir}/${srcfile2}" ${binfile2} {debug}] != "" } {
untested "failed to compile shared library"
- return -1
+ return
}
# Run one set of tests.
standard_testfile
if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
# Test "catch signal SIGHUP"
standard_testfile
if { [prepare_for_testing "failed to prepare" "${testfile}" $srcfile {debug}] } {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
gdb_breakpoint [gdb_get_line_number "set breakpoint here"]
standard_testfile
if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
- return -1
+ return
}
proc test_catch_signal {signame} {
}
if { ![setup_all_syscalls] } {
- return -1
+ return
}
# Fill all the syscalls numbers before starting anything.
standard_testfile .c charset-malloc.c
if { [prepare_for_testing "failed to prepare" ${testfile} [list $srcfile $srcfile2]] } {
- return -1
+ return
}
# Parse the output from a `show charset' command. Return the host
# is pointless.
if {[llength [array names charsets]] < 3} {
untested "fewer than 3 charsets"
- return -1
+ return
}
send_gdb "set target-charset\n"
lappend_include_file flags $srcdir/lib/unbuffer_output.c
if { [prepare_for_testing "failed to prepare" $testfile $srcfile $flags] } {
- return -1
+ return
}
# Run to FUNCTION. If that fails, issue a FAIL and make the caller
standard_testfile
if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug}]} {
- return -1
+ return
}
set is_pie [exec_is_pie $binfile]
if { ![readline_is_used] } {
untested "no tab completion support without readline"
- return -1
+ return
}
# Start of tests.
if {[prepare_for_testing "failed to prepare" $testfile \
[list $srcfile $srcfile2] {debug nowarnings}]} {
- return -1
+ return
}
if {![runto_main]} {
# library isn't used. Check it first.
if { ![readline_is_used] } {
- return -1
+ return
}
# The bulk of this test script pre-dates the completion-support
standard_testfile
if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
- return -1
+ return
}
if {![runto_main]} {
standard_testfile
if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
- return -1
+ return
}
if {[runto f2]} {
standard_testfile
if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
- return -1
+ return
}
if {![runto_main]} {
standard_testfile
if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
- return -1
+ return
}
if {![runto_main]} {
if {[prepare_for_testing "failed to prepare" $testfile [list $srcfile $srcfile2] \
{debug nowarnings}]} {
- return -1
+ return
}
set bp_location1 [gdb_get_line_number "set breakpoint 1 here"]
standard_testfile
if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
- return -1
+ return
}
if {![runto_main]} {
standard_testfile
if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug nowarnings}]} {
- return -1
+ return
}
if {![runto_main]} {
standard_testfile
if {[build_executable "failed to prepare" $testfile $srcfile debug]} {
- return -1
+ return
}
# DISPLACED indicates whether to use displaced-stepping.
# This test is Linux x86_64 only.
if { ![istarget *-*-linux*] } {
untested "$testfile.exp"
- return -1
+ return
}
require is_x86_64_m64_target gcore_cmd_available
if { [prepare_for_testing "failed to prepare" $testfile $srcfile {debug build-id}] } {
- return -1
+ return
}
if { ![runto_main] } {
- return -1
+ return
}
# First we need to generate a corefile.
if { ![gdb_gcore_cmd "$corefilename" "save corefile"] } {
verbose -log "Could not save corefile"
untested "$testfile.exp"
- return -1
+ return
}
# Determine if GDB dumped the mapping containing the build-id. This
# This test is Linux-only.
if {![istarget *-*-linux*]} {
untested "coredump-filter.exp"
- return -1
+ return
}
if { [prepare_for_testing "failed to prepare" $testfile $srcfile debug] } {
- return -1
+ return
}
if { ![runto_main] } {
- return -1
+ return
}
gdb_breakpoint [gdb_get_line_number "break-here"]
set core_supported [gdb_gcore_cmd "$non_private_anon_core" "save a corefile"]
if { !$core_supported } {
untested "corefile generation is not supported"
- return -1
+ return
}
gdb_test_multiple "info inferiors" "getting inferior pid" {
if {[build_executable $testfile.exp $testfile $srcfile] == -1} {
untested "failed to compile"
- return -1
+ return
}
# Linux core files can encore upto 80 characters for the command and
if { $env_var_name eq "" } {
unsupported "couldn't find suitable environment variable name"
- return -1
+ return
}
# Generate a core file with this environment variable set.
if {[build_executable $testfile.exp $testfile $srcfile {debug build-id}] == -1} {
untested "failed to compile"
- return -1
+ return
}
# Load the COREFILE and confirm that GDB auto-loads the executable.
if {[build_executable $testfile.exp $testfile $srcfile debug] == -1} {
untested "failed to compile"
- return -1
+ return
}
# Do not delete coremap.data when calling core_find. This file is
if {[build_executable $testfile.exp $testfile $srcfile debug] == -1} {
untested "failed to compile"
- return -1
+ return
}
set corefile [core_find $binfile {}]
# Test the equivalence between '.' and '->' for struct member references.
if {[gdb_test "ptype v_struct1.v_float_member" "type = float"] < 0} {
- return -1
+ return
}
if {[gdb_test "ptype v_struct1->v_float_member" "type = float"] < 0} {
- return -1
+ return
}
if {[gdb_test "ptype v_t_struct_p.v_float_member" "type = float"] < 0} {
- return -1
+ return
}
if {[gdb_test "ptype v_t_struct_p->v_float_member" "type = float"] < 0} {
- return -1
+ return
}
gdb_test "ptype struct link" \
additional_flags=-DGET_VERSION=get_version_2 }
if { [gdb_compile_shlib $libsrc $libobj1 $libobj1_opts ] != "" } {
- return -1
+ return
}
if { [gdb_compile_shlib $libsrc $libobj2 $libobj2_opts ] != "" } {
- return -1
+ return
}
if { [gdb_compile "${srcdir}/${subdir}/${executable}.c" \
[standard_output_file ${executable}] \
executable \
[list debug shlib=${libobj1} shlib=${libobj2}]]
!= ""} {
- return -1
+ return
}
clean_restart $executable
gdb_load_shlib $libobj2
if {![runto_main]} {
- return -1
+ return
}
set bp_location [gdb_get_line_number "STOP" "ctxobj-f.c"]
if {[gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != ""} {
untested "failed to compile"
- return -1
+ return
}
clean_restart
gdb_load ${binfile}
if {! [runto_main]} {
- return -1
+ return
}
gdb_test "list" \
"list in main"
if {! [runto "func2"]} {
- return -1
+ return
}
gdb_test "list" \
gdb_test_no_output "set listsize 3"
if {! [runto_main]} {
- return -1
+ return
}
gdb_test "list" \
"func1 \\(\\);" \
standard_testfile
if { [prepare_for_testing "failed to prepare" ${testfile}] } {
- return -1
+ return
}
if {![runto func]} {
- return -1
+ return
}
gdb_test "up" ".* main .*"
standard_testfile
if { [prepare_for_testing "failed to prepare" ${testfile}] } {
- return -1
+ return
}
if {![runto breakpt]} {
- return -1
+ return
}
# Issue the "delete mem" command. This makes GDB ignore the
standard_testfile .c
if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug}]} {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
for { set i 0 } { $i < 4 } { incr i } {
standard_testfile .c -2.c
set srcfiles [list $srcfile $srcfile2]
if {[prepare_for_testing "failed to prepare" $testfile $srcfiles]} {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
# Redirect debug output to file.
set sources [list $srcfile $srcfile2]
if {[prepare_for_testing "failed to prepare" $testfile $sources]} {
- return -1
+ return
}
# This is required due to PR25764.
standard_testfile .c
if {[build_executable "failed to prepare" $testfile $srcfile debug]} {
- return -1
+ return
}
clean_restart $testfile
if {[prepare_for_testing "failed to prepare" ${testfile} \
[list $srcfile $srcfile2] {debug nowarnings}]} {
- return -1
+ return
}
set bp_location1 [gdb_get_line_number "set breakpoint 1 here"]
standard_testfile
if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
- return -1
+ return
}
# A function to test that ALIAS is working as a shortcut of the "delete"
standard_testfile
if { [prepare_for_testing "failed to prepare" ${testfile}] } {
- return -1
+ return
}
if {![runto_main]} {
# can handle our use of line number 0 to mark the end of sequence.
if { [prepare_for_testing "failed to prepare" "disasm-end-cu" {disasm-end-cu-1.c disasm-end-cu-2.c} {debug}] } {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
set main_addr [get_hexadecimal_valueof "&main" "0"]
if {$main_addr == 0 || $dummy_3_addr == 0 || $dummy_3_addr <= $main_addr} {
fail "unable to extract required addresses, or addresses out of order"
- return -1
+ return
}
gdb_test_multiple "disassemble /m ${main_addr},${dummy_3_addr}" "disassemble address range with source" {
standard_testfile .S
if { [prepare_for_testing "failed to prepare" $testfile ${testfile}.S {nodebug}] } {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
gdb_test_sequence "disassemble /s main" \
standard_testfile
if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
# We have a breakpoint at the current pc (from stopping at main). Step over
if {[prepare_for_testing "failed to prepare" $testfile $srcfile \
{debug nowarnings}]} {
- return -1
+ return
}
# Preserve the old timeout, and set a new one that should be
[standard_output_file ${testfile}] \
executable {debug}] != ""} {
untested "failed to compile"
- return -1
+ return
}
clean_restart ${testfile}
if {[prepare_for_testing "failed to prepare" ${testfile} \
[list $srcfile $srcfile2] {debug nowarnings}]} {
- return -1
+ return
}
# test document command used within user command.
if {[build_executable "failed to prepare" \
${testfile} ${srcfile} {debug}]} {
- return -1
+ return
}
set dp_location [gdb_get_line_number "set dprintf here"]
if {[build_executable "failed to prepare for dprintf-detach" \
${testfile} ${srcfile} {debug}]} {
- return -1
+ return
}
proc dprintf_detach_test { breakpoint_always_inserted dprintf_style disconnected_dprintf } {
standard_testfile
if {[build_executable "failed to prepare" $testfile $srcfile debug]} {
- return -1
+ return
}
# This is the name of the GDB script to load.
set test "load and run script with -x"
if { $res != 0} {
fail $test
- return -1
+ return
}
# The script loaded via -x contains a run command; while running, GDB
if {[prepare_for_testing "failed to prepare for dprintf with next" \
${testfile} ${srcfile} {debug}]} {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
gdb_test "dprintf $dp_location, \"%d\\n\", x" \
if {[build_executable "failed to prepare for dprintf with non-stop" \
${testfile} ${srcfile} {debug}]} {
- return -1
+ return
}
save_vars { GDBFLAGS } {
}
if {![runto_main]} {
- return -1
+ return
}
gdb_test "dprintf foo,\"At foo entry\\n\"" "Dprintf .*"
if { [gdb_compile_shlib $libsrc $lib_sl $lib_opts] != ""
|| [gdb_compile $srcdir/$subdir/$srcfile $binfile executable $exec_opts] != ""} {
untested "failed to compile shared library"
- return -1
+ return
}
with_test_prefix "without format" {
lappend_include_file flags $srcdir/lib/unbuffer_output.c
if { [prepare_for_testing "failed to prepare" $testfile $srcfile $flags] } {
- return -1
+ return
}
set bp_location1 [gdb_get_line_number "set breakpoint 1 here"]
set dp_location1 [gdb_get_line_number "set dprintf 1 here"]
if {![runto_main]} {
- return -1
+ return
}
gdb_test "dprintf" "Format string required"
if {![runto checkpoint1]} {
untested "couldn't run to checkpoint"
- return -1
+ return
}
# Get the endianness for the later use with endianless formats.
set executable ${testfile}
if {[build_executable ${testfile}.exp $executable [list ${srcfile} ${srcmainfile}] {}] == -1} {
- return -1
+ return
}
set test "rename section"
standard_testfile
if { [build_executable "failed to prepare" ${testfile}] } {
- return -1
+ return
}
# Setup for the test, create COUNT breakpoints at the function BREAKPT.
# Compile the test executable.
if {[build_executable "failed to build" $testfile $srcfile]} {
- return -1
+ return
}
set custom_signal_handle_re \
if {[prepare_for_testing "failed to prepare" $testfile $srcfile \
$compile_flags]} {
- return -1
+ return
}
set address -1
if {[prepare_for_testing "failed to prepare" ${testfile} \
[list $srcfile $srcfile2] {debug nowarnings}]} {
- return -1
+ return
}
set bp_location1 [gdb_get_line_number "set breakpoint 1 here"]
# The rest of the testcase requires Scalar Storage Order support.
# This compiler does not support it, so skip the rest.
unsupported "No scalar storage order support"
- return -1
+ return
}
gdb_test "x/x &o.v" "0x04000000"
lappend_include_file flags $srcdir/lib/unbuffer_output.c
if { [prepare_for_testing "failed to prepare" $testfile $srcfile $flags] } {
- return -1
+ return
}
remote_exec build "rm -f core"
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable $opts] != "" } {
untested "failed to compile"
- return -1
+ return
}
clean_restart $testfile
standard_testfile
if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
- return -1
+ return
}
# Check the real contents.
standard_testfile
if {[build_executable ${testfile}.exp $testfile] == -1} {
- return -1
+ return
}
set test "eu-strip"
clean_restart $testfile
if {![runto_main]} {
- return -1
+ return
}
gdb_test "p callfunc (func)" " = 2" "infcall"
standard_testfile int-type.c
if { [prepare_for_testing "failed to prepare" $testfile $srcfile] } {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
set sizeof_int [get_sizeof "int" 4]
standard_testfile
if { [prepare_for_testing "failed to prepare for examine-backward" \
${testfile} ${srcfile}] } {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
proc get_first_mapped_address {} {
# it really has been deleted.
if { ! [file exists $binfile] } {
fail "executable does not exist (${binfile})"
- return -1
+ return
}
if {![runto_main]} {
if { [gdb_compile [file join $srcdir $subdir $srcfile] $objfile \
object [list debug]] != "" } {
untested "failed to compile"
- return -1
+ return
}
if { [gdb_compile $objfile $exec1 executable {debug text_segment=0x1000000}] != ""
|| [gdb_compile $objfile $exec2 executable {debug text_segment=0x2000000}] != ""} {
untested "link failed"
- return -1
+ return
}
# First check whether the address of "main" in exec1 is readable in
clean_restart $testfile1
if {![runto_main]} {
- return -1
+ return
}
set addr ""
clean_restart $testfile2
if {![runto_main]} {
- return -1
+ return
}
set cannot_access 0
standard_testfile
if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
- return -1
+ return
}
# Run to main, and execute BODY in the caller's context, with PREFIX
standard_testfile segv.c
if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
- return -1
+ return
}
# Run to main. But, before, change cwd to get the core into the
set_inferior_cwd_to_output_dir
if { ![runto_main] } {
- return -1
+ return
}
# Get the inferior's PID for later.
standard_testfile normal.c
if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
- return -1
+ return
}
# Checking $_exitsignal and $_exitcode, both should be void before the
# Run the inferior until the end.
if { ![runto_main] } {
- return -1
+ return
}
gdb_continue_to_end
if {[prepare_for_testing_full "failed to prepare" \
[list $testfile debug $srcfile {debug additional_flags=-DFIRST} \
$srcfile debug]]} {
- return -1
+ return
}
set foo_bp [gdb_get_line_number "Break here"]
executable \
[list debug additional_flags=[quote_for_host -DOUTDIR=\"$outdir/\"]]] != "" } {
untested "failed to compile"
- return -1
+ return
}
set dir2 [standard_output_file dir2.fileio.test]
standard_testfile
if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
- return -1
+ return
}
if { ![readline_is_used] } {
unsupported "completion doesn't work when readline isn't used."
- return -1
+ return
}
standard_testfile
if { [prepare_for_testing "failed to prepare" ${testfile}] } {
- return -1
+ return
}
if {![runto breakpt]} {
- return -1
+ return
}
# Basic attempt to read memory from globals.
}
if { [prepare_for_testing "failed to prepare" $testfile $srcfile $opts] } {
- return -1
+ return
}
proc finish_pretty { } {
# re-use the program from the "return2" test.
if { [prepare_for_testing "failed to prepare" finish return2.c] } {
- return -1
+ return
}
proc finish_1 { type } {
if { [prepare_for_testing "failed to prepare" float float.c] } {
- return -1
+ return
}
# Set it up at a breakpoint so we have its registers.
if { [do_compile] != "" && [do_compile {-mfloat128}] != "" } {
untested "compiler can't handle __float128 type?"
- return -1
+ return
}
clean_restart $testfile
if { [do_compile] != "" && [do_compile {-mfloat128}] != "" } {
untested "compiler can't handle _FloatN/_FloatNx types?"
- return -1
+ return
}
clean_restart $testfile
standard_testfile
if {[build_executable "failed to prepare" $testfile $srcfile debug]} {
- return -1
+ return
}
proc setup_gdb {} {
standard_testfile
if {[build_executable "failed to prepare" $testfile $srcfile debug]} {
- return -1
+ return
}
# Restart GDB and run the inferior to main. Return 1 on success, 0 on failure.
if {[build_executable "compile $binfile" $binfile $srcfile] == -1} {
untested "failed to compile first test binary"
- return -1
+ return
}
if {[build_executable "compile $binfile2" $binfile2 $srcfile2] == -1} {
untested "failed to compile second test binary"
- return -1
+ return
}
if {[build_executable "compile $binfile3" $binfile3 $srcfile3] == -1} {
untested "failed to compile third test binary"
- return -1
+ return
}
# If required, download the program that we exec after vfork to the
standard_testfile
if { [build_executable "failed to prepare" $testfile $srcfile debug] } {
- return -1
+ return
}
# This is the expected output for each of the test combinations
standard_testfile .c
if { [prepare_for_testing "failed to prepare" ${testfile}] } {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
gdb_test "set language fortran" {Warning: the current language does not match this frame\.}
lappend_include_file flags $srcdir/lib/attributes.h
if { [build_executable "failed to prepare" $testfile $srcfile $flags] } {
- return -1
+ return
}
# Unwind to each function in FRAMES, and compare "info frame" output
standard_testfile
if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug}]} {
- return -1
+ return
}
runto_main
}
if {[prepare_for_testing "failed to prepare" ${testfile} ${srcfile}]} {
- return -1
+ return
}
if {![runto_main]} {
standard_testfile
if { [prepare_for_testing "failed to prepare" ${testfile}] } {
- return -1
+ return
}
if {![runto setup_done]} {
standard_testfile
if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
- return -1
+ return
}
gdb_test "break ${srcfile}:[gdb_get_line_number "euphonium"]" ".*" \
if { [catch {file copy -force ${srcdir}/${subdir}/${srcfile} \
[standard_output_file tmp-${srcfile}]}] != 0 } {
error "Could not create temporary file"
- return -1
+ return
}
# Build the test executable using an absolute path.
if { [gdb_compile [standard_output_file tmp-${srcfile}] "${binfile}" executable {debug}] != "" } {
- return -1
+ return
}
# Unlike most GDB tests, we do not use gdb_reinitialize_dir in this script.
# Build the test executable using a relative path.
if { [gdb_compile [relative_filename [pwd] [build_standard_output_file tmp-${srcfile}]] \
"${binfile}" executable {debug}] != "" } {
- return -1
+ return
}
clean_restart $testfile
if { [file pathtype $objdir] != "absolute" } {
untested "objdir $objdir is not absolute"
- return -1
+ return
}
with_cwd $srcdir {
set result [catch {exec realpath ${srcdir}/${subdir}/${srcfile2}} realsrcfile2]
if { $result != 0 || $realsrcfile2 == "" } {
untested "invalid realpath of ${srcfile2}: result $result output $realsrcfile2"
- return -1
+ return
}
clean_restart ${testfile}
# to a function will put gdb into an infinite loop.
if { [prepare_for_testing "failed to prepare" "func-ptr" {func-ptr.c} {debug}] } {
- return -1
+ return
}
if {![runto_main]} {
set testname func-ptrs
set srcfile ${testname}.c
if { [prepare_for_testing "failed to prepare" ${testname} ${srcfile}] } {
- return -1
+ return
}
if { ![runto_main] } {
- return -1
+ return
}
set allow_float_test [allow_float_test]
if {[prepare_for_testing "failed to prepare" $testfile $srcfile $compile_flags]} {
- return -1
+ return
}
#
"set buffer exceeding arguments"
if {![runto_main]} {
- return -1
+ return
}
gdb_gcore_cmd [standard_output_file gcore-buffer-overflow.test] \
standard_testfile
if {[build_executable "failed to prepare" $testfile $srcfile {debug}] == -1} {
- return -1
+ return
}
# Read the proc_pid_status page, to find how much memory the given
if {[build_executable "failed to prepare" $testfile $srcfile \
{debug pie "ldflags=-Wl,-z,relro"}]} {
- return -1
+ return
}
set stripped_binfile ${binfile}.stripped
set strip_program [transform strip]
remote_file host delete ${stripped_binfile}
if {[run_on_host "strip" "$strip_program" "-g -o ${stripped_binfile} $binfile"]} {
- return -1
+ return
}
# Workaround PR binutils/10802:
# The binary is stripped of debug info, but not minsyms.
if {![runto break_here]} {
- return -1
+ return
}
if {![gdb_gcore_cmd $gcorefile "save a corefile"]} {
- return -1
+ return
}
# Now restart gdb with the unstripped binary and load the corefile.
standard_testfile
if { [have_fuse_ld_gold] == 0} {
- return -1
+ return
}
if {[build_executable "failed to prepare" $testfile $srcfile \
{debug pie "ldflags=-fuse-ld=gold"}]} {
- return -1
+ return
}
set stripped_binfile ${binfile}.stripped
set strip_program [transform strip]
remote_file host delete ${stripped_binfile}
if {[run_on_host "strip" "$strip_program" "-g -o ${stripped_binfile} $binfile"]} {
- return -1
+ return
}
# Workaround PR binutils/10802:
# The binary is stripped of debug info, but not minsyms.
if {![runto break_here]} {
- return -1
+ return
}
if {![gdb_gcore_cmd $gcorefile "save a corefile"]} {
- return -1
+ return
}
# Now restart gdb with the unstripped binary and load the corefile.
standard_testfile
if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
gdb_test "break terminal_func" "Breakpoint .* at .*${srcfile}, line .*" \
standard_testfile
if {[prepare_for_testing "prepare for test" $testfile $srcfile] == -1} {
- return -1
+ return
}
# This test isn't going to work when the board file automatically adds
set index_type [get_index_type $binfile "check debug style"]
if { $index_type ne "cooked" } {
unsupported "cannot test without a cooked index"
- return -1
+ return
}
# failure.
set options { "additional_flags=-DTIMEOUT=$timeout" debug }
if { [build_executable ${testfile}.exp ${testfile} $srcfile $options] == -1 } {
- return -1
+ return
}
# Return 0 on success, non-zero otherwise.
standard_testfile
if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
- return -1
+ return
}
if {![runto_main]} {
}
if { [prepare_for_testing "failed to prepare" $testfile $testfile.c {debug}] } {
- return -1
+ return
}
standard_testfile
if { [prepare_for_testing "failed to prepare" $testfile $testfile.c {debug}] } {
- return -1
+ return
}
# Disable hardware watchpoints if necessary.
standard_testfile
if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
- return -1
+ return
}
if {![runto_main]} {
standard_testfile
if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
- return -1
+ return
}
proc test_convenience_variables {} {
standard_testfile
if {[build_executable ${testfile}.exp $testfile]} {
- return -1
+ return
}
set pipeline_counter 0
[list [transform nm] "-D ${binfile} --format=posix --defined-only"] \
[list awk "\\{print\\ \\\$1\\}"] \
[list sort "" "" "${binfile}.dynsyms"]]} {
- return -1
+ return
}
# Extract all the text (i.e. function) symbols from the debuginfo.
[list [transform nm] "${binfile} --format=posix --defined-only"] \
[list awk "\\{if(\\\$2==\"T\"||\\\$2==\"t\"||\\\$2==\"D\")print\\ \\\$1\\}"] \
[list sort "" "" "${binfile}.funcsyms"]]} {
- return -1
+ return
}
# Keep all the function symbols not already in the dynamic symbol
remote_file host delete ${binfile}.keep_symbols
if {[run_on_host "comm" "comm" "-13 ${binfile}.dynsyms ${binfile}.funcsyms" "" \
"${binfile}.keep_symbols"]} {
- return -1
+ return
}
# GDB specific - we do not have split executable in advance.
remote_file host delete ${binfile}.strip
if {[run_on_host "strip" [transform strip] \
"--strip-all -R .comment -o ${binfile}.strip ${binfile}"]} {
- return -1
+ return
}
# Separate full debug info into ${binfile}.debug.
remote_file host delete ${binfile}.debug
if {[run_on_host "copydebug" ${objcopy_program} \
"--only-keep-debug ${binfile} ${binfile}.debug"]} {
- return -1
+ return
}
# Copy the full debuginfo, keeping only a minimal set of symbols and
# removing some unnecessary sections.
remote_file host delete ${binfile}.mini_debuginfo
if {[run_on_host "objcopy 1" ${objcopy_program} "-S --remove-section .gdb_index --remove-section .comment --keep-symbols=${binfile}.keep_symbols ${binfile}.debug ${binfile}.mini_debuginfo"]} {
- return -1
+ return
}
# Add the .gnu_debuglink section to the .gnu_debugdata file.
# is not present in usual MiniDebugInfo sections.
if {[run_on_host "addlink" ${objcopy_program} \
"--add-gnu-debuglink=${binfile}.debug ${binfile}.mini_debuginfo ${binfile}.mini_debuginfo-debuglink"]} {
- return -1
+ return
}
# Inject the compressed data into the .gnu_debugdata section of the
# original binary.
remote_file host delete ${binfile}.mini_debuginfo-debuglink.xz
if {[run_on_host "xz" "xz" "-k ${binfile}.mini_debuginfo-debuglink"]} {
- return -1
+ return
}
remote_file host delete ${binfile}.test
if {[run_on_host "objcopy 2" ${objcopy_program} "--add-section .gnu_debugdata=${binfile}.mini_debuginfo-debuglink.xz ${binfile}.strip ${binfile}.test"]} {
- return -1
+ return
}
clean_restart "$testfile.strip"
clean_restart $testfile
if { ![runto_main] } {
- return -1
+ return
}
# Get endianess for the scalar->vector casts
standard_testfile
if {[build_executable "failed to prepare" $testfile $srcfile {debug}] == -1} {
- return -1
+ return
}
set command "$binfile"
set compile_name [relative_filename $objdir $new_srcfile]
if { [gdb_compile $compile_name "${binfile}" executable {debug}] != "" } {
untested "failed to compile"
- return -1
+ return
}
clean_restart $testfile
if { [gdb_compile $new_srcfile "${binfile}" executable {debug}] != "" } {
untested "failed to compile"
- return -1
+ return
}
clean_restart $testfile
if { [gdb_compile $new_srcfile "${binfile}" executable {debug}] != "" } {
untested "failed to compile"
- return -1
+ return
}
clean_restart $testfile
gdb_load_shlib $lib_so
if {![runto_main]} {
- return -1
+ return
}
# Get main breakpoint out of the way.
standard_testfile
if {[prepare_for_testing "failed to prepare" ${testfile} ${srcfile}]} {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
# If we can read the memory at address 0, skip the test.
set test hbreak
set srcfile ${test}.c
if { [prepare_for_testing "failed to prepare" ${test} ${srcfile}] } {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
set breakline [gdb_get_line_number "break-at-exit"]
if { [prepare_for_testing "failed to prepare" "hbreak2" {break.c break1.c} {debug nowarnings}] } {
- return -1
+ return
}
set srcfile break.c
set srcfile1 break1.c
# on targets with optimized prologues.
if { [prepare_for_testing "failed to prepare" "hbreak2o2" {break.c break1.c} {debug nowarnings optimize=-O2}] } {
- return -1
+ return
}
if {![runto_main]} {
# These tests require readline support.
if { ![readline_is_used] } {
unsupported "readline isn't used."
- return -1
+ return
}
# By default the option is set to 0.
standard_testfile
if { [build_executable ${testfile}.exp "${testfile}" $srcfile {debug nowarnings}] } {
- return -1
+ return
}
# Define the hook-stop that runs COMMANDS.
set test hbreak
set srcfile ${test}.c
if { [prepare_for_testing "failed to prepare" ${test} ${srcfile}] } {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
delete_breakpoints
standard_testfile .c main.c
if { [build_executable "failed to prepare" $testfile $srcfile {debug}] } {
- return -1
+ return
}
clean_restart
standard_testfile
if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
- return -1
+ return
}
gdb_test_no_output "set listsize 1"
# Build the two executables for the test.
if {[build_executable "build exec'd file" $testfile2 $srcfile2] != 0} {
- return -1
+ return
}
if {[prepare_for_testing "prepare" $testfile $srcfile] != 0} {
- return -1
+ return
}
if { [is_remote target] } {
}
if {![runto_main]} {
- return -1
+ return
}
set linenr [gdb_get_line_number "break here"]
require {!target_info exists gdb,cannot_call_functions}
if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
# Run an infcall that takes a little bit to complete.
standard_testfile .c
if { [build_executable "failed to build" ${testfile} ${testfile}.c] } {
- return -1
+ return
}
save_vars { GDBFLAGS } {
standard_testfile
if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
- return -1
+ return
}
runto_main
standard_testfile
if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
- return -1
+ return
}
if {![runto_main]} {
require !using_fission
if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} {debug macros}] } {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
# Test various error messages.
# This test is Linux-only.
if {![istarget *-*-linux*]} {
unsupported "info-os.exp"
- return -1
+ return
}
# Support for XML-output is needed to run this test.
# Compile test program.
if { [prepare_for_testing "failed to prepare" $testfile $srcfile {debug pthreads}] } {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
# Get PID of test program.
gdb_test "set environment GDB_INFO_PROC_ENVIRON_2 TWO"
if {![runto_main]} {
- return -1
+ return
}
gdb_test "info proc" "process ${decimal}.*" "info proc with process"
if { [gdb_compile_shlib $srcfile_lib1 $binfile_lib1 {}] != "" } {
untested "failed to compile shared library 1"
- return -1
+ return
}
if { [gdb_compile_shlib $srcfile_lib2 $binfile_lib2 {}] != "" } {
untested "failed to compile shared library 2"
- return -1
+ return
}
set binfile_lib1_target [gdb_download_shlib $binfile_lib1]
set cflags "$define1 $define2"
if { [prepare_for_testing "failed to prepare" $testfile $srcfile \
[list additional_flags=$cflags shlib_load]] } {
- return -1
+ return
}
gdb_locate_shlib $binfile_lib1
standard_testfile start.c
if { [prepare_for_testing "failed to prepare" $testfile $srcfile] } {
- return -1
+ return
}
set eol "\r\n"
if {[prepare_for_testing "failed to prepare" \
"${testfile}" "$srcfile $srcfile2" "debug"]} {
- return -1
+ return
}
# Note: we do not run to main, as otherwise, the output of info variables
# Compile the program without debugging information, to have minimal symbols.
if {[prepare_for_testing "failed to prepare" $testfile $srcfile {c}]} {
- return -1
+ return
}
gdb_test_no_output "info variables -q -t int minsym" \
standard_testfile
if { [prepare_for_testing "failed to prepare" ${testfile}] } {
- return -1
+ return
}
if {![runto setup_done]} {
if {[prepare_for_testing $testfile.exp $testfile \
[list $srcfile $srcfile2] debug]} {
untested $testfile.exp
- return -1
+ return
}
# Executes "info sources ARGS".
}
if {![runto_main]} {
- return -1
+ return
}
# List both files with no regexp:
if {![runto foo]} {
untested "failed to run to function foo"
- return -1
+ return
}
# Invoke 'info sources EXTRA_ARGS' and extract the results.
if {[build_executable $testfile.exp $testfile $srcfile $opts] == -1} {
untested "failed to compile"
- return -1
+ return
}
clean_restart
standard_testfile
if { [prepare_for_testing "failed to prepare" ${testfile}] } {
- return -1
+ return
}
# Verify that the "info line" command does not skip function prologues.
require allow_python_tests
if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}]} {
- return -1
+ return
}
if {![runto_main]} {
standard_testfile
if { [prepare_for_testing "failed to prepare" ${testfile} $srcfile {debug}] } {
- return -1
+ return
}
# Do not use gdb_test for this test, since it has two prompts.
set executable ${testfile}
if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug}]} {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
gdb_test_multiple "continue &" "" {
standard_testfile
if { [build_executable ${testfile}.exp ${testfile} $srcfile {debug}] == -1 } {
- return -1
+ return
}
proc do_test {} {
standard_testfile
if {[build_executable "failed to build" $testfile $srcfile {debug}]} {
- return -1
+ return
}
# The test proper.
if {[prepare_for_testing "failed to prepare for testing" \
${testfile} ${srcfile} {debug}]} {
- return -1
+ return
}
# Pretend there's no terminal.
gdb_test_no_output "set interactive-mode off"
if {![runto_main]} {
- return -1
+ return
}
# Delete breakpoints so that the next resume is a plain continue,
if {[build_executable $testfile.exp $testfile $srcfile $options] == -1} {
untested "failed to compile"
- return -1
+ return
}
gdb_start
if { [build_executable ${testfile}.exp $executable $srcfile \
[list debug pthreads pie]] } {
- return -1
+ return
}
# Start the program running and then wait for a bit, to be sure
if {[gdb_compile ${srcdir}/${subdir}/${srcfile_dl} $binfile_dl executable \
$options] == -1 } {
untested "failed to compile"
- return -1
+ return
}
# Build the program that loads *two* JIT libraries.
if {[gdb_compile ${srcdir}/${subdir}/${srcfile_dl} $binfile_dl2 executable \
$options] == -1 } {
untested "failed to compile two-jitter binary"
- return -1
+ return
}
# STANDALONE is true when the JIT reader is included directly in the
if { [gdb_compile "${srcdir}/${subdir}/${jit_host_src}" "${jit_host_bin}" \
executable [list debug additional_flags=$jit_reader_flag]] != "" } {
untested "failed to compile"
- return -1
+ return
}
set jit_reader jit-reader
if { [gdb_compile_shlib "${srcdir}/${subdir}/${jit_reader_src}" "${jit_reader_bin}" \
[list debug additional_flags=$jit_reader_flag]] != "" } {
untested "failed to compile"
- return -1
+ return
}
# Test "info registers" in the current frame, expecting RSP's value to
standard_testfile
if { [prepare_for_testing "failed to prepare" $testfile $srcfile] } {
- return -1
+ return
}
if { ![runto_main] } {
- return -1
+ return
}
gdb_breakpoint [gdb_get_line_number "inline-funct"]
standard_testfile .c
if {[prepare_for_testing "failed to prepare" $testfile $srcfile]} {
- return -1
+ return
}
# General testing of the 'jump' command. GDB is already started.
# Run to main, add inferiors if needed.
if {![runto_main]} {
- return -1
+ return
}
for {set inf 2} {$inf <= $num_inferiors} {incr inf} {
# Start a new inferior, and run it with the same executable.
if { [prepare_for_testing "failed to prepare" $testfile \
[list ${srcfile} ${srcfile2}]] } {
- return -1
+ return
}
if { ![runto_main] } {
- return -1
+ return
}
require {!target_info exists gdb,nosignals}
if {[prepare_for_testing "failed to prepare" ${testfile}]} {
- return -1
+ return
}
gdb_test "handle SIGUSR1 stop print pass" "SIGUSR1\[ \t\]+Yes\[ \t\]+Yes\[ \t\]+Yes\[ \t\]+.*"
if {![runto_main]} {
- return -1
+ return
}
gdb_test "continue" "Program received signal SIGUSR1, .*"
set executable $testfile
if {[prepare_for_testing "failed to prepare" $executable]} {
- return -1
+ return
}
runto_main
lappend flags additional_flags=-DBINFILE=$binfile
if {[build_executable "failed to prepare" $testfile $srcfile $flags] == -1} {
- return -1
+ return
}
set checkpoint_line [gdb_get_line_number "Checkpoint here"]
}
if {[build_executable "failed to prepare" $testfile $srcfile] == -1} {
- return -1
+ return
}
# The actual output GDB prints in response to commands after the
standard_testfile
if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
- return -1
+ return
}
if {![runto_main]} {
}
if { ! $supported } {
- return -1
+ return
}
gdb_test "break main:L1" "Location main:L1 not available"
standard_testfile .c
if { [prepare_for_testing "failed to prepare" $testfile ${srcfile} debug] } {
- return -1
+ return
}
if {[prepare_for_testing "failed to prepare" ${testfile} \
[list $srcfile $srcfile2 $srcfile3] {debug}]} {
- return -1
+ return
}
set oldtimeout $timeout
set testfile ldbl_e308
set srcfile ${testfile}.c
if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
gdb_test_no_output "set variable ldbl_308 = 1.6e+308l"
standard_testfile
if {[prepare_for_testing "failed to prepare" $testfile $srcfile]} {
- return -1
+ return
}
if {![runto_main]} {
}
if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
# PR 17559: gdb_disassembly was using the wrong symtab lookup function.
standard_testfile
if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
- return -1
+ return
}
gdb_test "break $srcfile:65535" \
if {[prepare_for_testing "failed to prepare" $testfile [list $srcfile $srcfile2] \
{debug}]} {
- return -1
+ return
}
# Build source listing pattern based on an inclusive line range.
standard_testfile list-ambiguous0.c
if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
- return -1
+ return
}
set fill "${decimal}\\s+\[^\n\r\]+"
if { [gdb_compile "${srcfile}" "${binfile}" \
executable $options] != "" } {
untested "failed to compile"
- return -1
+ return
}
# Now delete the source file.
$testfile {} \
$srcfile {nodebug} \
$srcfile2 {debug}]] } {
- return -1
+ return
}
if {![runto_main]} {
if {[build_executable "failed to prepare" $testfile [list $srcfile $srcfile2] \
{debug}]} {
- return -1
+ return
}
# The last line in the file.
set opts {debug nopie}
if {[prepare_for_testing "failed to prepare" $testfile $srcfile $opts]} {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
# Manually change the value of the_variable.
standard_testfile
if {[prepare_for_testing "failed to prepare" $testfile {} {debug}]} {
- return -1
+ return
}
if {![runto_main]} {
standard_testfile
if { [prepare_for_testing "failed to prepare" ${testfile} $srcfile {debug quiet}] } {
- return -1
+ return
}
# 64-bit array size should not overflow
object $options] != ""
|| [gdb_compile "${objfile}" "${binfile}" executable $options] != "" } {
untested "failed to compile"
- return -1
+ return
}
clean_restart $testfile
require !readnow
if { [prepare_for_testing "failed to prepare" $testfile $srcfile] } {
- return -1
+ return
}
require {string eq [have_index $binfile] ""}
if {[build_executable "failed to prepare" $testfile \
$srcfile {debug nowarnings}]} {
- return -1
+ return
}
clean_restart
set test "verify no symtabs are expanded"
if { [readnow] } {
unsupported $test
- return -1
+ return
}
gdb_test_no_output "maint info symtabs" $test
if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} \
{debug nopie}]} {
- return -1
+ return
}
if {![runto normal_func]} {
if {[prepare_for_testing "failed to prepare" $testfile \
[list $srcfile $srcfile2] {debug nowarnings}]} {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
# Check the output of 'maint info target-sections' command.
if {[prepare_for_testing "failed to prepare" $testfile \
$srcfile {debug}]} {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
gdb_breakpoint foo
if {[prepare_for_testing "failed to prepare" $testfile \
[list $srcfile $srcfile2] {debug nowarnings}]} {
- return -1
+ return
}
# Check "maint set per-command" warnings. We do this early so that
standard_testfile $filename
if {[prepare_for_testing "failed to prepare" "$testfile" $srcfile \
{ debug }]} {
- return -1
+ return
}
# Start the test.
standard_testfile
if {[build_executable "failed to prepare" $testfile $srcfile debug]} {
- return -1
+ return
}
# Generate core file.
} msg
if { "$msg" != "" } {
untested "Can't set stack limit"
- return -1
+ return
}
set cmd \
standard_testfile
if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
- return -1
+ return
}
if {![runto_main]} {
standard_testfile .c
if { [prepare_for_testing "failed to prepare" $testfile $srcfile] } {
- return -1
+ return
}
runto_main
set options "-fno-builtin-memset -fno-builtin-memcpy -fno-builtin-memmove"
if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} \
[list debug additional_flags=$options]] } {
- return -1
+ return
}
set linespec ${srcfile}:[gdb_get_line_number "Break here"]
if {![runto ${linespec}]} {
- return -1
+ return
}
gdb_test "watch -location a\[28\]" \
standard_testfile
if {[prepare_for_testing "failed to prepare" ${testfile} ${srcfile}]} {
- return -1
+ return
}
if {[target_info gdb_protocol] == "extended-remote"} {
clean_restart $testfile
if {![runto_main]} {
- return -1
+ return
}
# Targets that don't support memory tagging should not execute the
# runtime memory tagging tests.
if {![supports_memtag]} {
unsupported "memory tagging unsupported"
- return -1
+ return
}
# With the program running, try to use the memory tagging commands.
}
if {[prepare_for_testing "failed to prepare" $testfile $srcfile $options]} {
- return -1
+ return
}
if {[runto middle]} {
set opts "additional_flags=-fsplit-stack"
if { [prepare_for_testing "failed to prepare" ${testfile} $srcfile \
[list $opts]] } {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
gdb_breakpoint "marker_hit"
if {[prepare_for_testing "failed to prepare" $testfile [list $srcfile $srcfile2] \
{c++}]} {
- return -1
+ return
}
gdb_test "info func foo" ".* foo\\(\\).* foo\\(\\).*"
standard_testfile
if {[prepare_for_testing "failed to prepare" "${testfile}" "${srcfile}"]} {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
gdb_breakpoint [gdb_get_line_number "BREAK"]
if {![support_nested_function_tests]} {
untested "compiler does not support nested functions"
- return -1
+ return
}
if { [gdb_compile "${srcdir}/${subdir}/${testcase}.c" \
[standard_output_file "${testcase}"] \
executable \
[list debug "additional_flags=-std=gnu99"]] != "" } {
- return -1
+ return
}
if {![support_nested_function_tests]} {
untested "compiler does not support nested functions"
- return -1
+ return
}
set flags {}
if { [gdb_compile "${srcdir}/${subdir}/${testcase}.c" \
[standard_output_file "${testcase}"] \
executable $flags] != "" } {
- return -1
+ return
}
if {![support_nested_function_tests]} {
untested "compiler does not support nested functions"
- return -1
+ return
}
set flags {}
if { [gdb_compile "${srcdir}/${subdir}/${testcase}.c" \
[standard_output_file "${testcase}"] \
executable $flags] != "" } {
- return -1
+ return
}
set compile_options "debug"
if {[build_executable $testfile.exp $testfile ${srcfile} ${compile_options}] == -1} {
untested "failed to compile"
- return -1
+ return
}
# Start gdb and create an extra console UI. Start the inferior in the
set compile_options "debug"
if {[build_executable $testfile.exp $testfile ${srcfile} ${compile_options}] == -1} {
untested "failed to compile"
- return -1
+ return
}
# See intro.
set compile_options "debug"
if {[build_executable $testfile.exp $testfile ${srcfile} ${compile_options}] == -1} {
untested "failed to compile"
- return -1
+ return
}
# Ensure no output has been sent. Use MESSAGE as test message.
standard_testfile
if {[prepare_for_testing "failed to prepare" $testfile $testfile.c]} {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
# Make sure we do not see any warnings.
standard_testfile
if {[prepare_for_testing "failed to prepare" $testfile $srcfile]} {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
# Load 'global_foo' into a history variable.
standard_testfile
if {[prepare_for_testing "failed to prepare" ${testfile} ${srcfile} {debug}]} {
- return -1
+ return
}
proc noreturn_finish_test { } {
standard_testfile
if {[prepare_for_testing "failed to prepare" ${testfile} ${srcfile} {debug}]} {
- return -1
+ return
}
proc noreturn_test { } {
if { [prepare_for_testing "failed to prepare for testing large offsets" \
${testfile} ${srcfile}] } {
- return -1
+ return
}
set test "print &big_struct test"
if {[prepare_for_testing "failed to prepare" $testfile \
[list $srcfile $srcfile2] debug]} {
- return -1
+ return
}
#
standard_testfile .c
if {[build_executable "failed to prepare" $testfile $srcfile debug]} {
- return -1
+ return
}
clean_restart
if { ![readline_is_used] } {
untested "no tab completion support without readline"
- return -1
+ return
}
set tui_supported_p [allow_tui_tests]
standard_testfile
if {[build_executable "failed to prepare" $testfile $srcfile debug] == -1} {
- return -1
+ return
}
# Send a ctrl-c while the target is running and check that the output
standard_testfile
if {[build_executable "failed to prepare" $testfile $srcfile debug] == -1} {
- return -1
+ return
}
# Check that we handle a stop event coming from a background execution
standard_testfile
if {[build_executable "failed to prepare" $testfile $srcfile debug] == -1} {
- return -1
+ return
}
set file_arg $binfile
standard_testfile
if {[build_executable "failed to prepare" $testfile $srcfile debug] == -1} {
- return -1
+ return
}
# Test paginating while printing about the inferior having exited.
standard_testfile
if {[build_executable "failed to prepare" $testfile $srcfile debug]} {
- return -1
+ return
}
# Check that we can patch an executable.
standard_testfile
if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug nowarnings}]} {
- return -1
+ return
}
if {![runto_main]} {
if { [gdb_compile_shlib $libsrc $lib_sl $lib_opts] != ""
|| [gdb_compile $srcdir/$subdir/$srcfile $binfile executable $exec_opts] != ""} {
untested "failed to compile"
- return -1
+ return
}
clean_restart
if {[build_executable $testfile.exp $testfile \
$srcfile {debug nowarnings}] == -1} {
untested "failed to compile"
- return -1
+ return
}
clean_restart
lappend flags c++
if {[build_executable "failed to prepare" $testfile $srcfile $flags]} {
- return -1
+ return
}
clean_restart
set opts [list debug pie]
if {[build_executable ${testfile}.exp $executable1 $srcfile [concat $opts {additional_flags=-DBIN=1}]] == -1
|| [build_executable ${testfile}.exp $executable2 $srcfile [concat $opts {additional_flags=-DBIN=2}]] == -1} {
- return -1
+ return
}
clean_restart ${executable1}
gdb_test_no_output "set args ${binfile2}" "set args ${binfile2_test_msg}"
if {![runto_main]} {
- return -1
+ return
}
# Do not stop on `main' after re-exec.
set sources "pr10179-a.c pr10179-b.c"
if {[build_executable ${testname}.exp $testname $sources {debug}] == -1} {
- return -1
+ return
}
clean_restart ${testname}
if {![runto_main]} {
- return -1
+ return
}
gdb_test "rbreak foo.*" "Breakpoint ${::decimal}\[^\\n\]*\\nint foo\[12\]\[^\\n\]*\\nBreakpoint ${::decimal}\[^\\n\]*\\nint foo\[12\].*"
if {[build_executable "build library" ${libfile} ${libsrcfile} \
{debug shlib}] == -1} {
- return -1
+ return
}
set srcfile ${testfile}.c
set binfile [standard_output_file ${executable}]
set prelink_args [build_executable_own_libs ${testfile}.exp $executable $srcfile [list debug "ldflags=-Wl,${libfile},-rpath,[file dirname ${libfile}]"]]
if {$prelink_args == ""} {
- return -1
+ return
}
set test "split debug of executable"
if {![prelink_yes $prelink_args]} {
# Maybe we don't have prelink.
- return -1
+ return
}
set found 0
# Relink $libfile to a different address.
if {![prelink_yes $prelink_args]} {
- return -1
+ return
}
# Start with a fresh gdb
require allow_python_tests
if { [prepare_for_testing "failed to prepare" $testfile $srcfile] } {
- return -1
+ return
}
if {![runto_main]} {
if {[prepare_for_testing $testfile.exp $testfile $srcfile debug]} {
untested $testfile.exp
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
gdb_test "print nums" \
if {[prepare_for_testing $testfile.exp $testfile $srcfile debug]} {
untested $testfile.exp
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
gdb_test_no_output "set print pretty on"
standard_testfile
if { [prepare_for_testing "failed to prepare" $testfile $srcfile] } {
- return -1
+ return
}
if {![runto_main]} {
if { [gdb_compile_shlib ${srcdir}/${subdir}/${srcfile_lib} ${binfile_lib} {debug}] != ""
|| [gdb_compile ${srcdir}/${subdir}/${srcfile} ${objfile} object {debug}] != "" } {
untested "failed to compile"
- return -1
+ return
}
set opts [list debug shlib=${binfile_lib}]
if { [gdb_compile ${objfile} ${binfile} executable $opts] != "" } {
untested "failed to compile"
- return -1
+ return
}
clean_restart $testfile
gdb_load_shlib ${binfile_lib}
if {![runto lib]} {
- return -1
+ return
}
if {![gdb_gcore_cmd $gcorefile "save a corefile"]} {
- return -1
+ return
}
proc test_load_core { print_symbol_loading } {
standard_testfile
if {[prepare_for_testing "failed to prepare" $testfile $srcfile]} {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
gdb_test {printf "%ls\n", wide_str} "^wide string"
standard_testfile
if { [prepare_for_testing "failed to prepare" ${testfile}] } {
- return -1
+ return
}
set bp_main [gdb_get_line_number "break main" ${testfile}.h]
standard_testfile .c psym-external-decl-2.c
if { [test_compiler_info "clang-*"] } {
- return -1
+ return
}
set srcfiles [list $srcfile $srcfile2]
$testfile [list] \
$srcfile [list debug] \
$srcfile2 [list]] == -1 } {
- return -1
+ return
}
clean_restart $testfile
if {[prepare_for_testing "failed to prepare" $testfile \
[list $srcfile $srcfile2] debug]} {
- return -1
+ return
}
# Disable the prompt for whether to set pending breakpoints.
}
if { [prepare_for_testing "failed to prepare" $testfile $srcfile] } {
- return -1
+ return
}
# Tests handling flexible array member. Regression tests for PR gdb/33966.
if { [prepare_for_testing "failed to prepare" $testfile $srcfile \
{ debug c++ }] } {
- return -1
+ return
}
# Test general offset printing, ctor/dtor printing, union, formatting.
if {[prepare_for_testing "failed to prepare" ${testfile} \
[list $srcfile $srcfile2] {debug nowarnings}]} {
- return -1
+ return
}
# Some tests require GCC.
# Test the equivalence between '.' and '->' for struct member references.
if {[gdb_test "ptype v_struct1.v_float_member" "type = float"] < 0} {
- return -1
+ return
}
if {[gdb_test "ptype v_struct1->v_float_member" "type = float"] < 0} {
- return -1
+ return
}
if {[gdb_test "ptype v_t_struct_p.v_float_member" "type = float"] < 0} {
- return -1
+ return
}
if {[gdb_test "ptype v_t_struct_p->v_float_member" "type = float"] < 0} {
- return -1
+ return
}
standard_testfile
if {[build_executable "failed to prepare" $testfile $srcfile debug]} {
- return -1
+ return
}
# Set a software watchpoint, continue, wait a bit and stop the target
standard_testfile
if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
- return -1
+ return
}
proc address_get { testname } {
set test "randomized addresses should not match"
if {[string equal $addr1 $addr2]} {
untested "no randomization detected on this system"
- return -1
+ return
} else {
pass $test
}
set executable $testfile
if { [prepare_for_testing "failed to prepare" $testfile $srcfile {debug}] } {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
if {![gdb_range_stepping_enabled]} {
unsupported "range stepping not supported by the target"
- return -1
+ return
}
# Check that range stepping can step a range of multiple instructions.
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" object {debug}] != "" } {
untested "failed to compile"
- return -1
+ return
}
setenv TERM dumb
if { ![readline_is_used] } {
unsupported "completion doesn't work when readline isn't used."
- return -1
+ return
}
gdb_test_no_output "set width 50"
standard_testfile
if { [prepare_for_testing "failed to prepare" $testfile $srcfile] } {
- return -1
+ return
}
# The fix for this issue relies on GDB being able to adjust the EOF
# this feature is not available then this test might not pass.
if { ![readline_supports_eof_flag] } {
unsupported "readline is not eof flag aware"
- return -1
+ return
}
# Create a breakpoint then issue the 'commands' commands. When the
if { [build_executable "failed to build" $testfile $srcfile { debug }] == -1 } {
untested "couldn't compile ${srcfile}"
- return -1
+ return
}
save_vars { GDBFLAGS } {
if { [file type $srcfilelink] != "link" } {
unsupported "target directory cannot have symbolic links"
- return -1
+ return
}
if { [gdb_compile "${srcdir}/${subdir}/${srcfile} ${srcfilelink}" "${binfile}" \
executable {debug}] != "" } {
untested "failed to compile"
- return -1
+ return
}
clean_restart ${testfile}
standard_testfile .c
if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
gdb_test "break $srcfile:[gdb_get_line_number BREAK $srcfile] if n == 3" \
standard_testfile
if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
- return -1
+ return
}
proc recurse_tests {} {
standard_testfile
if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
- return -1
+ return
}
if {![runto_main]} {
#
if { [prepare_for_testing "failed to prepare" relational int-type.c {debug nowarnings}] } {
- return -1
+ return
}
#
set result [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}]
if {$result != ""} {
untested "failed to compile"
- return -1
+ return
}
gdb_start
require !use_gdb_stub
if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
- return -1
+ return
}
# Using the source command to read commands from a file is important,
set executable $testfile
if { [prepare_for_testing "failed to prepare" $executable $srcfile] } {
- return -1
+ return
}
proc restore_tests { } {
# Test PR cli/23785
clean_restart $testfile
if { ![runto_main] } {
- return -1
+ return
}
gdb_test "restore non-existent-file binary" \
"Failed to open non-existent-file: .*"
standard_testfile
if { [prepare_for_testing "failed to prepare" $testfile $srcfile] } {
- return -1
+ return
}
if { ![runto bar] } {
- return -1
+ return
}
with_test_prefix "in bar" {
set allow_float_test [allow_float_test]
if { [prepare_for_testing "failed to prepare" "return"] } {
- return -1
+ return
}
proc return_tests { } {
}
if {[prepare_for_testing "failed to prepare" $testfile $srcfile [list debug $additional_flags]]} {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
set pattern ".* = \\{int_array = \\{1, 2, 3, 4, 5\\}, double_array = \\{3.25, 5, 6.25, 1.325, -1.95\\}, char_array = \"abcde\"\\}"
executable $rtld_flags] } {
set reason "-static-pie not supported or static libc missing"
untested "failed to compile ($reason)"
- return -1
+ return
}
# Main program file names and flags:
# Compile pretend RTLD:
if { [gdb_compile ${srcfile_rtld} ${binfile_rtld} executable $rtld_flags] != "" } {
untested "failed to compile"
- return -1
+ return
}
# Compile main program:
if { [gdb_compile ${srcfile_main} ${binfile_main} executable $main_flags] != "" } {
untested "failed to compile"
- return -1
+ return
}
clean_restart
set executable $testfile
if {[prepare_for_testing "failed to prepare" $executable]} {
- return -1
+ return
}
set test_spawn_id [spawn_wait_for_attach $binfile]
standard_testfile
if {[build_executable "failed to build" $testfile $srcfile {debug}]} {
- return -1
+ return
}
proc test_run {testname} {
standard_testfile .c
if { [prepare_for_testing "failed to prepare" ${testfile} $srcfile] } {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
# Delete all breakpoints, watchpoints, tracepoints, and catchpoints so that
# the "runto_main" breakpoint above does not interfere with our testing.
# Now start a new debugger session...
clean_restart $testfile
if {![runto_main]} {
- return -1
+ return
}
# Delete all breakpoints, watchpoints, tracepoints, and catchpoints so that
# the "runto_main" breakpoint above does not interfere with our testing.
standard_testfile
if {[prepare_for_testing "failed to prepare" ${testfile} ${srcfile}]} {
- return -1
+ return
}
gdb_test_no_output "set can-use-hw-watchpoints 0"
if {![runto_main]} {
- return -1
+ return
}
gdb_test_multiple "maint info break" "maint info break before" {
if {[build_executable "failed to build" ${testfile} \
[list $srcfile $srcfile2] {debug}]} {
- return -1
+ return
}
# Test locating various things when stopped just inside main, after
if { [prepare_for_testing "failed to prepare" "sect-cmd" \
{break.c break1.c} {debug nowarnings}] } {
- return -1
+ return
}
set srcfile break.c
set srcfile1 break1.c
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug nowarnings}] != "" } {
untested "failed to compile"
- return -1
+ return
}
# Note: the procedure gdb_gnu_strip_debug will produce an executable called
if {[gdb_gnu_strip_debug $binfile$EXEEXT]} {
# check that you have a recent version of strip and objcopy installed
unsupported "cannot produce separate debug info files"
- return -1
+ return
}
#
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" \
executable {debug}] != "" } {
untested "failed to compile"
- return -1
+ return
}
if {[gdb_gnu_strip_debug $binfile no-main]} {
# check that you have a recent version of strip and objcopy installed
unsupported "cannot produce separate debug info files"
- return -1
+ return
}
clean_restart $testfile
standard_testfile
if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
- return -1
+ return
}
gdb_test "break -q main" \
standard_testfile
if { [prepare_for_testing "failed to prepare" $testfile $srcfile debug] } {
- return -1
+ return
}
# Test that tilde expansion works fine.
set compile_options "debug"
if {[build_executable $testfile.exp $testfile ${srcfile} ${compile_options}] == -1} {
untested "failed to compile"
- return -1
+ return
}
proc test_set_inferior_tty { command } {
standard_testfile start.c
if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
- return -1
+ return
}
# Do not run the inferior as the purpose of this testcase is to test
if { [prepare_for_testing "failed to prepare" "set-noassign" start.c {debug nowarnings}] } {
- return -1
+ return
}
if {![runto_main]} {
standard_testfile .c
if {[build_executable "failed to prepare" $testfile $srcfile debug]} {
- return -1
+ return
}
clean_restart
if { ![readline_is_used] } {
untested "no tab completion support without readline"
- return -1
+ return
}
# Test the show command SHOW_CMD. EXPECTED_RE is the expected output.
standard_testfile
if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
- return -1
+ return
}
#
standard_testfile
if { [build_executable "failed to prepare" $testfile $srcfile debug] } {
- return -1
+ return
}
set test_var_name "GDB_TEST_VAR"
if { [prepare_for_testing "failed to prepare" $testfile "$srcfile $srcfile2" \
{debug}] } {
untested "failed to compile"
- return -1
+ return
}
# Load $binfile a second time. The second created objfile will re-use the
# partial symtabs created by the first one.
if { [gdb_file_cmd $binfile] != 0 } {
fail "file command failed"
- return -1
+ return
}
gdb_breakpoint "bar"
if { ![runto "bar"] } {
- return -1
+ return
}
# A buggy GDB would fail to find the full symbol associated to this frame's
standard_testfile
if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
- return -1
+ return
}
proc test_one_sig {nextsig} {
standard_testfile
if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
- return -1
+ return
}
#
standard_testfile
if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
- return -1
+ return
}
gdb_test "display/i \$pc"
standard_testfile .c
if { [prepare_for_testing "failed to prepare" $testfile $srcfile] } {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
gdb_breakpoint "pass"
standard_testfile
if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
- return -1
+ return
}
# Advance to main
standard_testfile
if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
- return -1
+ return
}
gdb_test "display/i \$pc"
set options [list debug "additional_flags=-DOUTPUT_TXT=\"$gdb_txt\""]
if {[build_executable $testfile.exp $testfile $srcfile $options]} {
untested "failed to compile"
- return -1
+ return
}
set options [list debug "additional_flags=-DOUTPUT_TXT=\"$standalone_txt\""]
if {[build_executable $testfile.exp $testfile-standalone $srcfile $options]} {
untested "failed to compile"
- return -1
+ return
}
# Run the program directly, and dump its initial signal actions and
clean_restart $testfile
if {![runto_main]} {
- return -1
+ return
}
gdb_continue_to_end "collect signals state under gdb"
set test "signals states are identical"
if { ! $have_standalone } {
untested $test
- return -1
+ return
}
if {!$purely_local} {
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
untested "failed to compile"
- return -1
+ return
}
gdb_exit
set objdso [standard_output_file $libname]
if {[gdb_compile_shlib $srcdso $objdso {debug}] != ""} {
untested "failed to compile dso"
- return -1
+ return
}
# Build the test executable and runto main.
set opts [list debug shlib=$objdso]
if { [prepare_for_testing "failed to " $testfile $srcfile $opts] } {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
if {[readnow]} {
untested "this test checks for delayed symtab expansion"
- return -1
+ return
}
# Use 'info sources' to check if the debug information for the shared
require {!target_info exists gdb,nosignals}
if {[prepare_for_testing "failed to prepare" ${testfile} ${srcfile} {debug}]} {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
# If we can examine what's at memory address 0, it is possible that we
if { [is_address_zero_readable] } {
untested "memory at address 0 is possibly executable"
- return -1
+ return
}
# Run until we hit the SIGSEGV (or SIGBUS on some platforms).
if {[build_executable $testfile.exp $testfile $srcfile debug]} {
untested "failed to compile"
- return -1
+ return
}
set clear_done [gdb_get_line_number {done = 0}]
standard_testfile
if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
- return -1
+ return
}
#
if { [prepare_for_testing "failed to prepare" "skip-inline" \
{skip-inline.c skip1.c } \
{debug nowarnings}] } {
- return -1
+ return
}
set srcfile skip-inline.c
if {[gdb_compile_shlib ${srcdir}/${subdir}/${srcfile_lib} ${binfile_lib} \
[list debug]] != ""} {
- return -1
+ return
}
if {[gdb_compile "${srcdir}/${subdir}/${srcfile_main}" "${binfile_main}.o" \
object debug] != ""} {
- return -1
+ return
}
set testobjdir [standard_output_file {}]
if {[gdb_compile "${binfile_main}.o" "${binfile_main}" executable \
[list debug shlib=$binfile_lib]] != ""} {
- return -1
+ return
}
#
if { [prepare_for_testing "failed to prepare" "skip" \
{skip.c skip1.c } \
{debug nowarnings}] } {
- return -1
+ return
}
set srcfile skip.c
lappend flags c++
if {[prepare_for_testing "failed to prepare" $testfile $srcfile $flags]} {
- return -1
+ return
}
if {![runto_main]} {
set srcfile start.c
if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
- return -1
+ return
}
# With probes interface GDB no longer scans the inferior library list so its
|| [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${objfile}" object {debug}] != ""
|| [gdb_compile "${objfile} ${binlibfile}" "${binfile}" executable {}] != "" } {
untested "failed to compile"
- return -1
+ return
}
clean_restart $executable
standard_testfile
if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
- return -1
+ return
}
if {$use_gdb_stub && [target_info exists gdb,do_reload_on_run]} {
|| [gdb_compile_shlib ${srcfile1_lib} ${right_binfile1_lib} $right_lib_flags] != ""
|| [gdb_compile_shlib ${srcfile2_lib} ${right_binfile2_lib} $right_lib_flags] != "" } {
untested "failed to compile shared library"
- return -1
+ return
}
# Build the test binary using the right copies of the libraries.
if { [gdb_compile $srcdir/$subdir/${srcfile} ${binfile} \
executable $bin_flags] != "" } {
untested "failed to compile"
- return -1
+ return
}
clean_restart $testfile
if { [gdb_compile_shlib ${srcfile_lib2} ${binfile_lib2} $lib2_flags] != ""
|| [gdb_compile_shlib ${srcfile_lib1} ${binfile_lib1} $lib1_flags] != "" } {
untested "failed to compile"
- return -1
+ return
}
# Main program
if { [gdb_compile ${srcfile} ${binfile} executable $bin_flags] != "" } {
untested "failed to compile"
- return -1
+ return
}
clean_restart $testfile
standard_testfile
if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
- return -1
+ return
}
if {![runto_main]} {
standard_testfile
if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
- return -1
+ return
}
gdb_test "show source open" "Source opening is \"on\"\\." \
standard_testfile
if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
- return -1
+ return
}
if {![runto_main]} {
set executable ${testfile}
if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
- return -1
+ return
}
if {![runto_main]} {
}
if { $next_insn_addr == "" } {
- return -1
+ return
}
gdb_test "b *$next_insn_addr" "Breakpoint .*" "set breakpoint on address"
standard_testfile .c
if { [prepare_for_testing "failed to prepare" $testfile $srcfile] } {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
gdb_breakpoint [gdb_get_line_number "test-next"] temporary
lappend flags c++
if {[prepare_for_testing "failed to prepare" $testfile $srcfile $flags]} {
- return -1
+ return
}
# This is a testcase specifically for the `start' GDB command. For regular
# For C++ programs, "start" should stop in main().
if { [gdb_start_cmd] < 0 } {
fail start
- return -1
+ return
}
gdb_test "" \
standard_testfile
if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
- return -1
+ return
}
# This is a testcase specifically for the `start' GDB command. For regular
# For C programs, "start" should stop in main().
if { [gdb_start_cmd] < 0 } {
fail start
- return -1
+ return
}
gdb_test "" \
standard_testfile
if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
- return -1
+ return
}
# Define a stop hook that outputs the value of 'x'
if { [gdb_starti_cmd] < 0 } {
untested starti
- return -1
+ return
}
# The program should stop at the first instruction, so the constructor
standard_testfile
if { [build_executable "failed to prepare" $testfile $srcfile debug] } {
- return -1
+ return
}
set unique_file [standard_output_file "unique-file.unique-extension"]
standard_testfile
if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
- return -1
+ return
}
gdb_test "break *hello" \
}
if { [prepare_for_testing "failed to prepare" $testfile $srcfile \
[list debug "additional_flags=$cflags"]] } {
- return -1
+ return
}
if { ![runto_main] } {
- return -1
+ return
}
# Do repeated instruction steps in order to reach TARGET from CURRENT
if { [prepare_for_testing "failed to prepare" $testfile $srcfile \
$flags] == -1 } {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
gdb_test step $srcfile:$decimal\r\n.*
set linefile ${testfile}.inp
if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
- return -1
+ return
}
if {![runto_main]} {
set syscall_insn "\[ \t\](swi|svc)\[ \t\]"
} else {
unsupported "unknown syscall instruction"
- return -1
+ return
}
if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
gdb_test "set follow-fork-mode child"
standard_testfile start.c
if { [build_executable "failed to build" ${testfile} $srcfile] } {
- return -1
+ return
}
# Get the current PC. MSG is used as test message.
array set syscall_number {fork "(120|220)" vfork "(190|220)" \
clone "(120|220)"}
} else {
- return -1
+ return
}
proc_with_prefix check_pc_after_cross_syscall { displaced syscall syscall_insn_next_addr } {
set testfile "step-over-fork"
clean_restart $testfile
if {![runto_main]} {
- return -1
+ return
}
set cond_bp_target 1
standard_testfile
if { [prepare_for_testing "failed to prepare" ${testfile} $srcfile] } {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
gdb_test "step" " in-func .*"
gdb_test_no_output {set $b=$pc}
if {![runto_main]} {
- return -1
+ return
}
gdb_breakpoint {*$b if cond ()}
standard_testfile
if {[build_executable "failed to build" ${testfile} ${srcfile} {debug}]} {
- return -1
+ return
}
set linenum_for_user_bp [gdb_get_line_number "break for user-bp test here"]
standard_testfile
if {[build_executable ${testfile}.exp ${testfile} ${srcfile} {nodebug}] == -1} {
- return -1
+ return
}
# We need those symbols global to access them from the .S file.
clean_restart $testfile
if {![runto_main]} {
- return -1
+ return
}
gdb_breakpoint symful
set executable $testfile
if { [prepare_for_testing "failed to prepare" $executable $srcfile] } {
- return -1
+ return
}
#
standard_testfile .c
if { [prepare_for_testing "failed to prepare" $testfile $srcfile {debug}] } {
- return -1
+ return
}
if {![runto_main]} {
standard_testfile .c
if { [prepare_for_testing "failed to prepare" "structs3" "" {debug}] } {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
set vhn "${::valnum_re}"
# Compile the test executable.
if {[build_executable "failed to build" $testfile $srcfile {debug macros}]} {
- return -1
+ return
}
# The tests in this file are run multiple times with GDB's styles
|| [test_compiler_info {clang-[1-9]-*}]}]
if { [prepare_for_testing "failed to prepare" ${testfile} [list $srcfile $srcfile2]] } {
- return -1
+ return
}
if {![runto_main]} {
if { [gdb_compile "${srcdir}/${subdir}/${srcfile2}" \
[standard_output_file ${binlibfile}] object {debug}] != "" } {
untested "failed to compile"
- return -1
+ return
}
if {[build_executable ${testfile}.exp ${testfile} ${srcfile} {debug}] == -1} {
- return -1
+ return
}
clean_restart ${binlibfile}
if {[gdb_compile "${srcdir}/${subdir}/${srcfile}" \
$ofile object {debug}] != ""} {
untested "failed to compile"
- return -1
+ return
}
clean_restart
}
if {[prepare_for_testing $testfile $testfile $srcfilelink]} {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
# Using a line number ensures that the default symtab is used.
gdb_load_shlib $lib1
if {![runto_main]} {
- return -1
+ return
}
# PR 17564
# the output of the "info terminal" command.
if { [prepare_for_testing "failed to prepare" term term.c] } {
- return -1
+ return
}
# Once before running the program.
standard_testfile
if { [prepare_for_testing "failed to prepare" $testfile $srcfile] } {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
delete_breakpoints
set bp_number [get_integer_valueof "\$bpnum" 0]
if { $bp_number == 0 } {
unresolved "breakpoint not placed correctly"
- return -1
+ return
}
set saw_header false
# Build shared objects for dlopen:
if { [gdb_compile_shlib $libsrc $lib1obj [list debug additional_flags=-DN=1]] != "" } {
untested "failed to compile shared object"
- return -1
+ return
}
if { [gdb_compile_shlib $libsrc $lib2obj [list debug additional_flags=-DN=2]] != "" } {
untested "failed to compile shared object"
- return -1
+ return
}
if { [gdb_compile_shlib $libsrc $lib3obj [list debug additional_flags=-DN=3]] != "" } {
untested "failed to compile shared object"
- return -1
+ return
}
if { [gdb_compile_shlib $libsrc $lib4obj [list debug additional_flags=-DN=4]] != "" } {
untested "failed to compile shared object"
- return -1
+ return
}
# Build shared objects to link against main program:
if { [gdb_compile_shlib $libsrc $lib10obj [list debug additional_flags=-DN=10]] != "" } {
untested "failed to compile shared object"
- return -1
+ return
}
if { [gdb_compile_shlib $libsrc $lib11obj [list debug additional_flags=-DN=11]] != "" } {
untested "failed to compile shared object"
- return -1
+ return
}
# Use gdb_compile_pthreads to build and link the main program for
if { [gdb_compile_shlib $lib1src $lib1obj {debug}] != "" } {
untested "failed to compile shared object"
- return -1
+ return
}
if { [gdb_compile_shlib $lib2src $lib2obj {debug}] != "" } {
untested "failed to compile shared object"
- return -1
+ return
}
if { [gdb_compile_shlib $lib3src $lib3obj {debug}] != "" } {
untested "failed to compile shared object"
- return -1
+ return
}
# Certain linux target architectures implement support for internal
if {[prepare_for_testing "failed to prepare" $testfile $srcfile \
{debug pthreads}]} {
- return -1
+ return
}
if {![runto "parent_stop"]} {
require !gdb_debug_enabled
if { [prepare_for_testing "failed to prepare" ui-redirect start.c] } {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
set test "commands"
standard_testfile advance.c
if {[prepare_for_testing "failed to prepare" $testfile $srcfile nodebug]} {
- return -1
+ return
}
if {![runto_main]} {
standard_testfile .c .S
if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
- return -1
+ return
}
set asm_file [standard_output_file $srcfile2]
if { [prepare_for_testing "failed to prepare" ${testfile} \
[list $srcfile $asm_file] {nodebug} ] } {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
gdb_test "next" ".* TAG: loop code .*" "inside the loop"
set srcfile break.c
if { [prepare_for_testing "failed to prepare" "until" {break.c break1.c} {debug nowarnings}] } {
- return -1
+ return
}
set bp_location1 [gdb_get_line_number "set breakpoint 1 here"]
if {[prepare_for_testing_full "failed to prepare" \
[list ${testfile} $ldflags \
$srcfile $srcfile_flags $srcfile2 $srcfile2_flags]]} {
- return -1
+ return
}
if {![runto_main]} {
standard_testfile
if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
- return -1
+ return
}
if { ![runto_main] } {
setenv LC_ALL C.UTF-8
if { [prepare_for_testing "failed to prepare" ${testfile} [list $srcfile]] } {
- return -1
+ return
}
if {![runto done]} {
if { ![readline_is_used] } {
untested "no tab completion support without readline"
- return -1
+ return
}
# Test linespec completion.
standard_testfile .c
if {[build_executable $testfile.exp $testfile $srcfile {debug}] == -1} {
- return -1
+ return
}
if { [vgdb_start] == -1 } {
- return -1
+ return
}
set double_free [gdb_get_line_number "double-free"]
standard_testfile .c
if {[build_executable "failed to build" $testfile $srcfile {debug}] == -1} {
- return -1
+ return
}
if { [vgdb_start] == -1 } {
- return -1
+ return
}
gdb_test_no_output "set displaced-stepping off"
standard_testfile .c
if {[build_executable $testfile.exp $testfile $srcfile {debug}] == -1} {
- return -1
+ return
}
set active_at_startup 0
if { [vgdb_start $active_at_startup] == -1 } {
- return -1
+ return
}
# Determine whether we're at nanosleep.
standard_testfile .c
if {[build_executable $testfile.exp $testfile $srcfile {debug}] == -1} {
- return -1
+ return
}
if { [vgdb_start] == -1 } {
- return -1
+ return
}
set continue_count 1
standard_testfile
if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
# Disable hardware watchpoints if necessary.
standard_testfile
if { [prepare_for_testing "failed to prepare" $testfile $srcfile] } {
- return -1
+ return
}
if {![runto_main]} {
standard_testfile
if { [prepare_for_testing "failed to prepare" ${testfile} $srcfile] } {
- return -1
+ return
}
with_test_prefix "setup" {
if { [build_executable "compile $binfile3" $binfile3 $srcfile2] } {
untested "failed to compile third test binary"
- return -1
+ return
}
if { [is_remote target] } {
standard_testfile
if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
gdb_breakpoint [gdb_get_line_number "vlas_filled"]
set using_clang [test_compiler_info clang*]
if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
set sizeof_int [get_sizeof "int" 4]
standard_testfile
if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
gdb_breakpoint [gdb_get_line_number "vla-filled"]
require {!test_compiler_info clang*}
if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
gdb_breakpoint [gdb_get_line_number "vlas_filled"]
standard_testfile .c vla-stub-define.c
if { [prepare_for_testing "failed to prepare for vla-stub.exp" \
${testfile} [list ${srcfile} ${srcfile2}]] } {
- return -1
+ return
}
gdb_test "p *local_struct.ptr" { = {dynamic_field = 0x0}}
# Use the same test program constvars.c.
if { [prepare_for_testing "failed to prepare" volatile constvars.c] } {
- return -1
+ return
}
#
standard_testfile
if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
- return -1
+ return
}
# Set a watchpoint watching EXPR.
if { [build_executable ${testfile}.exp ${testfile} ${testfile}.c {debug}] } {
untested "failed to compile"
- return -1
+ return
}
proc test_watchpoint { hw } {
standard_testfile .c
if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
- return -1
+ return
}
# Disable hardware watchpoints if necessary.
standard_testfile
if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
- return -1
+ return
}
if {![runto_main]} {
require allow_hw_watchpoint_access_tests
if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
- return -1
+ return
}
if {![runto_main]} {
if { [build_executable ${testfile}.exp ${testfile} $srcfile {debug}] } {
untested "failed to compile"
- return -1
+ return
}
proc test_watchpoint_across_vfork { hw teststr } {
if {[prepare_for_testing_full "failed to prepare" \
[list $testfile debug $srcfile debug $srcfile2 {}]]} {
- return -1
+ return
}
# Problem does not occur otherwise.
gdb_test_no_output "set can-use-hw-watchpoints 0"
if {![runto_main]} {
- return -1
+ return
}
gdb_breakpoint [gdb_get_line_number "watchpoint-here"]
standard_testfile .c
if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
- return -1
+ return
}
# It is more compatible this way.
gdb_test_no_output "set can-use-hw-watchpoints 0"
if {![runto_main]} {
- return -1
+ return
}
# Ensure there is a parent frame to create related bp_watchpoint_scope.
standard_testfile
if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
- return -1
+ return
}
set test_spawn_id [spawn_wait_for_attach $binfile]
set test watchpoint-hw-hit-once
set srcfile ${test}.c
if { [prepare_for_testing "failed to prepare" ${test} ${srcfile}] } {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
gdb_test "rwatch watchee"
standard_testfile
if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
- return -1
+ return
}
# Create the watchpoint before the inferior gets started. Now the native CPU
if { [gdb_start_cmd] < 0 } {
fail start
- return -1
+ return
}
gdb_test "" "main .* at .*" "start"
standard_testfile
if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
- return -1
+ return
}
if {![runto_main]} {
standard_testfile
if {[build_executable "failed to prepare" $testfile $srcfile {debug}]} {
- return -1
+ return
}
# STOP_MODE is either "all-stop" or "non-stop". HW is true if we are
require allow_hw_watchpoint_tests
if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
- return -1
+ return
}
if {![runto_main]} {
standard_testfile
if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile}] } {
- return -1
+ return
}
if {![runto_main]} {
- return -1
+ return
}
gdb_breakpoint [gdb_get_line_number "start_again"] "Breakpoint $decimal at $hex" "start_again"
set wp_set 1
if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
- return -1
+ return
}
with_test_prefix "before inferior start" {
standard_testfile .c
if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
- return -1
+ return
}
set bp_location [gdb_get_line_number "START"]
#
if { [prepare_for_testing "failed to prepare" whatis-exp int-type.c {debug nowarnings}] } {
- return -1
+ return
}
#
if {[prepare_for_testing "failed to prepare" $testfile "$srcfile $srcfile2" \
debug]} {
- return -1
+ return
}
if { [ensure_gdb_index $binfile] == -1 } {
untested "error adding gdb index"
- return -1
+ return
}
clean_restart $testfile
standard_testfile .c
if {[build_executable "failed to prepare" $testfile $srcfile debug]} {
- return -1
+ return
}
clean_restart $testfile
if {[build_executable $testfile.exp $testfile \
$srcfile [list debug nowarnings] ] == -1} {
untested $testfile.exp
- return -1
+ return
}
save_vars { GDBFLAGS } {
[standard_output_file ${main_testfile}] \
executable {debug}] != ""} {
untested "failed to build $main_testfile"
- return -1
+ return
}
clean_restart ${main_testfile}
if {![runto opaque_routine]} {
untested "could not run to opaque_routine"
- return -1
+ return
}
# Make sure that "bt full" command is capable of displaying MY_TABLE