save_vars { GDBFLAGS } {
append GDBFLAGS " -ex \"set non-stop $non_stop\""
- clean_restart ${binfile}
+ clean_restart
+ gdb_load $binfile
}
if ![runto_main] {
if { [gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug nowarnings}] == "" } {
- clean_restart $binfile
+ clean_restart
+ gdb_load $binfile
if {![runto_main]} {
return
}
save_vars { ::GDBFLAGS } {
set ::GDBFLAGS "$::GDBFLAGS --args $::binfile $arglist"
- clean_restart $::binfile
+ clean_restart
+ gdb_load $::binfile
gdb_test_no_output "set startup-with-shell ${startup_with_shell}" \
"set startup-with-shell for $name"
return -1
}
-clean_restart ${binfile}
+clean_restart
+gdb_load $binfile
if {![runto_main]} {
return
}
-clean_restart ${binfile}
+clean_restart
+gdb_load $binfile
#
}
proc_with_prefix test {} {
- clean_restart $::binfile
+ clean_restart
+ gdb_load $::binfile
# GDB used to have a bug on Windows where failing to attach once
# made a subsequent "attach" or "run" hang. So it's important for
# Attach to the parent, run it to a known point, extract the
# child's PID, and detach.
with_test_prefix "parent" {
- clean_restart ${binfile}
+ clean_restart
+ gdb_load $binfile
gdb_test "attach $parent_pid" \
"Attaching to program.*, process $parent_pid.*" \
# Start over, and attach to the child this time.
with_test_prefix "child" {
- clean_restart $binfile
+ clean_restart
+ gdb_load $binfile
gdb_test "attach $child_pid" \
"Attaching to program.*, process $child_pid.*" \
global gdb_prompt
global decimal
- clean_restart $binfile
+ clean_restart
+ gdb_load $binfile
if {![runto setup_done]} {
return 0
global escapedbinfile
global srcfile
- clean_restart $binfile
+ clean_restart
+ gdb_load $binfile
# Figure out a regular expression that will match the sysroot,
# noting that the default sysroot is "target:", and also noting
global timeout
global decimal
- clean_restart $binfile
+ clean_restart
+ gdb_load $binfile
# Figure out a regular expression that will match the sysroot,
# noting that the default sysroot is "target:", and also noting
global binfile2
global binfile3
- clean_restart $binfile
+ clean_restart
+ gdb_load $binfile
# Start two programs that can be attached to.
# The first program contains a 'int bidule' variable, the second a 'float bidule'.
# Run GDB on the test program up to where it will dump core.
-clean_restart ${binfile}
+clean_restart
+gdb_load $binfile
gdb_test_no_output "set print sevenbit-strings"
gdb_test_no_output "set width 0"
"try edit when no symbol file is loaded"
# Now start with a test binary.
- clean_restart $binfile
+ clean_restart
+ gdb_load $binfile
with_test_prefix "before starting inferior" {
return -1
}
-clean_restart ${binfile}
+clean_restart
+gdb_load $binfile
if {![runto_main]} {
return
# AFTER_KILL_COND is appended to the breakpoint condition, after "kill
# -SIGINT $gdb_pid".
proc test { {after_kill_cond ""} } {
- clean_restart $::binfile
+ clean_restart
+ gdb_load $::binfile
if {![runto_main]} {
return
global binfile
global linenum
- clean_restart $binfile
+ clean_restart
+ gdb_load $binfile
if ![runto_main] {
return
# Run GDB on the bigcore program up-to where it will dump core.
- clean_restart ${binfile}
+ clean_restart
+ gdb_load $binfile
gdb_test_no_output "set print sevenbit-strings"
gdb_test_no_output "set width 0"
}
}
-clean_restart ${binfile}
+clean_restart
+gdb_load $binfile
gdb_test_no_output "set print sevenbit-strings"
runto_main
# "attach".
with_test_prefix "run" {
- clean_restart $binfile
+ clean_restart
+ gdb_load $binfile
if {![runto_main]} {
return -1
with_test_prefix "attach" {
if {[can_spawn_for_attach]} {
- clean_restart $binfile
+ clean_restart
+ gdb_load $binfile
set test_spawn_id [spawn_wait_for_attach $binfile]
set testpid [spawn_id_get_pid $test_spawn_id]
}
proc run_test { cond_eval access_type bpexpr nloc } {
- clean_restart ${::binfile}
+ clean_restart
+ gdb_load $::binfile
if { ![runto_main] } {
return -1
# Restart the inferior, which should unload the shared library, GDB
# should mark the b/p as disabled due to its condition again.
proc run_test { hit_cond } {
- clean_restart $::binfile
+ clean_restart
+ gdb_load $::binfile
if {![runto_main]} {
return
global gdb_prompt
global srcfile binfile
- clean_restart $binfile
+ clean_restart
+ gdb_load $binfile
if {![runto_main]} {
return -1
# Restart GDB.
save_vars { GDB } {
set GDB [gdb_no_core]
- clean_restart $binfile
+ clean_restart
+ gdb_load $binfile
}
# Capture the pid of GDB.
proc check_selected_frame_after_bt { bt_cmd stack_pattern } {
global binfile
- clean_restart $binfile
+ clean_restart
+ gdb_load $binfile
with_test_prefix $bt_cmd {
# Start with a fresh gdb.
-clean_restart ${binfile}
+clean_restart
+gdb_load $binfile
gdb_test_no_output "set print sevenbit-strings"
gdb_test_no_output "set print address off"
gdb_test_no_output "set width 0"
# Start with a fresh gdb.
-clean_restart ${binfile}
+clean_restart
+gdb_load $binfile
if { ![runto_main] } {
return 0
# Start with a fresh gdb.
-clean_restart ${binfile}
+clean_restart
+gdb_load $binfile
if { ![runto_main] } {
return 0
test_catch_syscall_multi_arch_1 $arch1 $arch2 $syscall1_name \
$syscall2_name $syscall_number
- clean_restart $binfile
+ clean_restart
+ gdb_load $binfile
}
proc do_syscall_tests_without_xml {} {
# Execute the tests, using XML support
gdb_exit
if { [allow_xml_test] } {
- clean_restart $binfile
+ clean_restart
+ gdb_load $binfile
do_syscall_tests
# Now, we have to see if GDB displays a warning when we
# don't set the data-directory but try to use catch syscall
# anyway. For that, we must restart GDB first.
- clean_restart $binfile
+ clean_restart
+ gdb_load $binfile
test_catch_syscall_fail_nodatadir
}
# Restart gdb
-clean_restart $binfile
+clean_restart
+gdb_load $binfile
# Execute the tests, without XML support. In this case, GDB will
# only display syscall numbers, and not syscall names.
# Now let's try setting a large number of checkpoints (>600)
#
-clean_restart $binfile
+clean_restart
+gdb_load $binfile
runto_main
gdb_breakpoint $break1_loc
#
with_test_prefix "delete checkpoint 0" {
- clean_restart $binfile
+ clean_restart
+ gdb_load $binfile
runto_main
gdb_test "checkpoint" "Checkpoint 1: fork returned pid $decimal\\."
gdb_test "" "Breakpoint \[0-9\]*, stop_here .*" "running to stop_here $ident"
}
-clean_restart ${binfile}
+clean_restart
+gdb_load $binfile
gdb_test "break stop_here if (var1 == 42)" \
"Breakpoint.*at.* file .*$srcfile, line.*" \
}
# Start with a fresh gdb.
-clean_restart ${binfile}
+clean_restart
+gdb_load $binfile
if {![runto_main]} {
return 0
return -1
}
-clean_restart ${binfile}
+clean_restart
+gdb_load $binfile
gdb_test_no_output "set print sevenbit-strings"
gdb_test_no_output "set print address off"
}
-clean_restart ${binfile}
+clean_restart
+gdb_load $binfile
if {![runto_main]} {
global loc_name loc_index fill
global decimal hex gdb_prompt binfile
- clean_restart ${binfile}
+ clean_restart
+ gdb_load $binfile
if {![runto_main]} {
return
proc_with_prefix scenario_1 { start_before } {
global warning decimal fill bkptno_num_re binfile
- clean_restart ${binfile}
+ clean_restart
+ gdb_load $binfile
if { $start_before } {
if {![runto_main temporary]} {
proc_with_prefix scenario_2 { start_before } {
global binfile bkptno_num_re
- clean_restart ${binfile}
+ clean_restart
+ gdb_load $binfile
if { $start_before } {
if {![runto_main temporary]} {
proc_with_prefix scenario_3 { start_before } {
global binfile bkptno_num_re loc_index warning
- clean_restart ${binfile}
+ clean_restart
+ gdb_load $binfile
if { $start_before } {
if {![runto_main temporary]} {
proc_with_prefix scenario_4 { start_before } {
global binfile bkptno_num_re loc_index warning
- clean_restart ${binfile}
+ clean_restart
+ gdb_load $binfile
if { $start_before } {
if {![runto_main temporary]} {
return -1
}
-clean_restart ${binfile}
+clean_restart
+gdb_load $binfile
#
global gdb_prompt decimal
global srcfile binfile
- clean_restart $binfile
+ clean_restart
+ gdb_load $binfile
gdb_test_no_output "set displaced-stepping $displaced"
gdb_test_no_output "set breakpoint always-inserted $breakpoint_always_inserted"
# Load the core file and confirm that the full executable name is
# seen.
-clean_restart $binfile
+clean_restart
+gdb_load $binfile
set saw_generated_line false
gdb_test_multiple "core-file $corefile_1" "load core file no args" {
-re "^Core was generated by `[string_to_regexp $binfile]'\\.\r\n" {
# Load the core file and confirm that the full executable name and
# argument list are seen.
-clean_restart $binfile
+clean_restart
+gdb_load $binfile
set saw_generated_line false
gdb_test_multiple "core-file $corefile_2" "load core file with args" {
-re "^Core was generated by `[string_to_regexp $binfile] $args'\\.\r\n" {
# Restart, load the core file, and check the environment variable
# shows up.
-clean_restart $binfile
+clean_restart
+gdb_load $binfile
# Check for environment variable VAR_NAME in the environment, its
# value should be VAR_VALUE.
# LD_PRELOAD.
append_environment_default ASAN_OPTIONS verify_asan_link_order 0
- clean_restart $binfile
+ clean_restart
+ gdb_load $binfile
# Start GDB with the modified environment, this means that, when
# using remote targets, gdbserver will also use the preload
# Restart GDB. This time we are _not_ using the preload library. We
# no longer need it as we are only analysing the core file now.
-clean_restart $binfile
+clean_restart
+gdb_load $binfile
# Load the core file.
gdb_test "core-file $corefile" \
# Now restart normally.
-clean_restart $binfile
+clean_restart
+gdb_load $binfile
# Test basic corefile recognition via core-file command.
remote_exec host "mv ${coremmap_data_filename} \
${coremmap_data_backup_filename}"
-clean_restart $binfile
+clean_restart
+gdb_load $binfile
# Load the core file and check we get a warning about the
# coremmap.data file being missing.
# Test that we can unload the core with the "detach" command.
proc_with_prefix corefile_detach {} {
- clean_restart $::binfile
+ clean_restart
+ gdb_load $::binfile
gdb_test "core-file $::corefile" "Core was generated by .*" "load core"
gdb_test "detach" "No core file now\\." "detach core"
return
}
- clean_restart $::binfile
+ clean_restart
+ gdb_load $::binfile
gdb_test "core-file $corefile" "Core was generated by .*" "run: load core again"
set re "Local core dump file:"
# Restart and run to the abort call.
-clean_restart $binfile
+clean_restart
+gdb_load $binfile
if {![runto_main]} {
return
gdb_test_no_output "maint print core-file-backed-mappings" \
"maint print core-file-backed-mapping with no core file"
-clean_restart $binfile
+clean_restart
+gdb_load $binfile
set core_loaded [gdb_core_cmd "$corefile" "re-load generated corefile"]
if { $core_loaded == -1 } {
[standard_output_file coredir.[getpid]/coremmap.data.backup]
remote_exec host "mv ${data_filename} ${backup_filename}"
-clean_restart $binfile
+clean_restart
+gdb_load $binfile
# Load the core file. The 'coremap.data' file cannot be found by GDB,
# but all the mappings for that file are r/w and should be present in
return -1
}
-clean_restart $binfile
+clean_restart
+gdb_load $binfile
# Basic/core tests using user-visible commands.
with_test_prefix "basics" {
if {$is_remote} {
append ::GDBFLAGS " -ex \"maint set target-non-stop on\""
}
- clean_restart ${binfile}
+ clean_restart
+ gdb_load $binfile
}
set test_spawn_id [spawn_wait_for_attach $binfile]
gdb_test "detach" "Detaching from program: .*$escapedbinfile, .*" "detach, $pass"
}
-clean_restart $binfile
+clean_restart
+gdb_load $binfile
global pass
set pass "one"
return -1
}
-clean_restart ${binfile}
+clean_restart
+gdb_load $binfile
if {![runto_main]} {
return
gdb_test "kill" ".*" "kill again"
gdb_test "detach" ".*" "detach again"
- clean_restart $binfile
+ clean_restart
+ gdb_load $binfile
}
# Ok, on to real life
# Run the tests relating to the command "info sharedlibrary", to
# verify that the namespace ID is consistent.
proc test_info_shared {} {
- clean_restart $::binfile
+ clean_restart
+ gdb_load $::binfile
if { ![runto_main] } {
return
# Also tests that the namespace ID is only printed at the correct
# times.
proc_with_prefix test_conv_vars {} {
- clean_restart $::binfile
+ clean_restart
+ gdb_load $::binfile
gdb_test "print \$_linker_namespace_count" "0" \
"0 namespace before starting inferior"
# Restarting GDB so that we can test setting a breakpoint
# using the convenience variable, while a proper bp syntax
# isn't implemented for namespaces
- clean_restart $::binfile
+ clean_restart
+ gdb_load $::binfile
if {![runto_main]} {
return
}
# Run several tests relating to the command "info namespaces".
proc test_info_linker_namespaces {} {
- clean_restart $::binfile
+ clean_restart
+ gdb_load $::binfile
# Check that "info linker-namespaces" while the inferior is not running
# doesn't crash.
# Setup for calling 'test_dlmopen', this is the version of the test
# that doesn't use 'attach'.
proc test_dlmopen_no_attach {} {
- clean_restart $::binfile
+ clean_restart
+ gdb_load $::binfile
if { ![runto_main] } {
return
return
}
- clean_restart $::binfile
+ clean_restart
+ gdb_load $::binfile
# Start the test program.
set test_spawn_id [spawn_wait_for_attach $::binfile]
return
}
- clean_restart $::binfile
+ clean_restart
+ gdb_load $::binfile
if { ![runto_main] } {
return
# Check that we can 'next' over the dlclose calls without GDB giving any
# warnings or errors.
proc_with_prefix test_next_over_dlclose {} {
- clean_restart $::binfile
+ clean_restart
+ gdb_load $::binfile
if { ![runto_main] } {
return
global gdb_prompt binfile dp_location
with_test_prefix "$style" {
- clean_restart $binfile
+ clean_restart
+ gdb_load $binfile
if ![runto_main] {
return -1
with_test_prefix "$test_prefix" {
# Start with a clean gdb
- clean_restart ${binfile}
+ clean_restart
+ gdb_load $binfile
gdb_test_no_output "set breakpoint always-inserted ${breakpoint_always_inserted}"
gdb_test_no_output "set dprintf-style ${dprintf_style}"
gdb_exit
# Check that the process still exists by attaching a new gdb to it.
- clean_restart ${binfile}
+ clean_restart
+ gdb_load $binfile
set test "re-attach to inferior"
set is_gdbserver [target_is_gdbserver]
# Restart GDB and 'source' the script; this will (still) run the program
# due to the 'run' command in the script.
-clean_restart $binfile
+clean_restart
+gdb_load $binfile
do_test "source $x_file" "load and run script using source command"
# This should leave us at the gdb prompt; Run program again using
gdb_test "" ".*x=3.*x=4.*x=3.*" "run to resolved dprintf"
}
-clean_restart ${binfile}
+clean_restart
+gdb_load $binfile
gdb_load_shlib $lib_sl
#
global binfile
global bp_location1 dp_location1
- clean_restart $binfile
+ clean_restart
+ gdb_load $binfile
if ![runto_main] {
return -1
return -1
}
-clean_restart $binfile
+clean_restart
+gdb_load $binfile
gdb_load_shlib $binfile_libdso2
gdb_load_shlib $binfile_libdso1
return -1
}
- clean_restart ${binfile}
+ clean_restart
+ gdb_load $binfile
if ![runto_main] {
return -1
return -1
}
-clean_restart $binfile
+clean_restart
+gdb_load $binfile
gdb_test "dump mem /dev/null 0x10 0x20" "Cannot access memory at address 0x10" \
"inaccessible memory is reported"
global srcfile
global binfile
- clean_restart ${binfile}
+ clean_restart
+ gdb_load $binfile
if {![runto_main]} {
return 0
return 0
}
-clean_restart ${binfile}
+clean_restart
+gdb_load $binfile
gdb_assert [gdb_breakpoint "*$address" no-message] "set breakpoint on address"
standard_testfile
proc do_tests {{do_xfail_cast 0} {do_xfail 0} {do_xfail_core_test 0}} {
- clean_restart $::binfile
+ clean_restart
+ gdb_load $::binfile
if ![runto_main] {
return
}
return
}
- clean_restart $::binfile
+ clean_restart
+ gdb_load $::binfile
set core_loaded [gdb_core_cmd $corefile "load corefile"]
if { $core_loaded == -1 } {
return -1
}
-clean_restart ${binfile}
+clean_restart
+gdb_load $binfile
if {![runto_main]} {
return -1
}
-clean_restart ${binfile}
+clean_restart
+gdb_load $binfile
# Sanity-check: Verify that the executable exists. This is just to
# make sure that, when we verify later that the file does not exist,
}
# Start with a fresh gdb
-clean_restart $binfile
+clean_restart
+gdb_load $binfile
do_exec_sysroot_test
return -1
}
-clean_restart ${binfile}
+clean_restart
+gdb_load $binfile
#
# set it up at a breakpoint so we can play with the variable values
set oldtimeout $timeout
set timeout [expr "$timeout + 60"]
-clean_restart $binfile
+clean_restart
+gdb_load $binfile
gdb_test_no_output "set print sevenbit-strings"
gdb_test_no_output "set print address off"
gdb_test_no_output "set width 0"
return -1
}
-clean_restart ${binfile}
+clean_restart
+gdb_load $binfile
gdb_test "break $srcfile:stop_here" \
"Breakpoint.*at.* file .*$srcfile, line.*" \
return -1
}
-clean_restart $binfile
+clean_restart
+gdb_load $binfile
gdb_load_shlib ${lib_sl}
if {![runto_main]} {
return -1
}
-clean_restart ${binfile}
+clean_restart
+gdb_load $binfile
if {![runto_main]} {
return
return -1
}
-clean_restart ${binfile}
+clean_restart
+gdb_load $binfile
if {![runto_main]} {
return
}
proc do_test {} {
- clean_restart $::binfile
+ clean_restart
+ gdb_load $::binfile
gdb_locate_shlib $::shlib_path
gdb_test_no_output "set follow-fork-mode child"
gdb_test_no_output "set detach-on-fork off"
foreach_with_prefix print_inferior_events { "on" "off" } {
foreach_with_prefix follow_fork_mode { "child" "parent" } {
foreach_with_prefix detach_on_fork { "on" "off" } {
- clean_restart $binfile
+ clean_restart
+ gdb_load $binfile
gdb_test_no_output "set print inferior-events $print_inferior_events"
gdb_test_no_output "set follow-fork-mode $follow_fork_mode"
gdb_test_no_output "set detach-on-fork $detach_on_fork"
return -1
}
-clean_restart ${binfile}
+clean_restart
+gdb_load $binfile
if {![runto break_me]} {
return
proc test {enable} {
- clean_restart $::binfile
+ clean_restart
+ gdb_load $::binfile
gdb_test_no_output "maint frame-unwinder $enable DEBUGINFO"
# "select-frame view".
proc test_select_frame_view { with_pretty_printer } {
- clean_restart $::binfile
+ clean_restart
+ gdb_load $::binfile
if { $with_pretty_printer } {
require allow_python_tests
# Initialize GDB after getting the line number, to make sure
# symbols aren't loaded.
-clean_restart $binfile
+clean_restart
+gdb_load $binfile
set msg "set breakpoint by full path before loading symbols - built absolute"
if { [gdb_breakpoint [standard_output_file tmp-${srcfile}]:${line} {no-message}] != 0 } {
return -1
}
-clean_restart $binfile
+clean_restart
+gdb_load $binfile
set msg "set breakpoint by full path before loading symbols - built relative"
if { [gdb_breakpoint [standard_output_file tmp-${srcfile}]:${line} {no-message}] != 0 } {
}
}
-clean_restart $binfile
+clean_restart
+gdb_load $binfile
set msg "set breakpoint by full path before loading symbols - built other"
if { [gdb_breakpoint [standard_output_file tmp-${srcfile}]:${line} {no-message}] != 0 } {
# Start with a fresh gdb.
-clean_restart ${binfile}
+clean_restart
+gdb_load $binfile
gdb_test_no_output "set args ${pattern}" \
"set buffer exceeding arguments"
# Now restart gdb with the unstripped binary and load the corefile.
-clean_restart ${binfile}
+clean_restart
+gdb_load $binfile
gdb_test "core ${gcorefile}" \
"Core was generated by .*" "re-load generated corefile"
}
with_test_prefix "first session" {
- clean_restart ${binfile}
+ clean_restart
+ gdb_load $binfile
gdb_load_shlib ${binfile_lib}
if ![runto lib] {
# Now restart gdb and load the corefile.
with_test_prefix "second session" {
- clean_restart ${binfile}
+ clean_restart
+ gdb_load $binfile
gdb_load_shlib ${binfile_lib}
gdb_test "core ${gcorefile}" "Core was generated by .*" \
# Now restart gdb with the unstripped binary and load the corefile.
-clean_restart ${binfile}
+clean_restart
+gdb_load $binfile
gdb_test "core ${gcorefile}" \
"Core was generated by .*" "re-load generated corefile"
}
# Now restart gdb and load the corefile.
-clean_restart $binfile
+clean_restart
+gdb_load $binfile
set core_loaded [gdb_core_cmd "$corefile" "re-load generated corefile"]
if { $core_loaded == -1 } {
return -1
}
-clean_restart ${binfile}
+clean_restart
+gdb_load $binfile
if {![runto abort {allow-pending}]} {
return
return -1
}
-clean_restart ${binfile}
+clean_restart
+gdb_load $binfile
gdb_load_shlib $libobj
if {![runto_main]} {
return -1
}
-clean_restart ${binfile}
+clean_restart
+gdb_load $binfile
# FAIL was: No line number known for stabs_function.
gdb_test "list stabs_function" " marker-here .*"
return -1
}
-clean_restart $binfile
+clean_restart
+gdb_load $binfile
gdb_load_shlib $binfile_lib1
gdb_load_shlib $binfile_lib2
return -1
}
-clean_restart ${binfile}
+clean_restart
+gdb_load $binfile
if { ![runto_main] } {
return -1
return -1
}
-clean_restart ${binfile}
+clean_restart
+gdb_load $binfile
set bp_location [gdb_get_line_number "set breakpoint here" $new_srcfile]
return -1
}
-clean_restart $binfile
+clean_restart
+gdb_load $binfile
set bp_location [gdb_get_line_number "set breakpoint here" ${new_srcfile}]
return -1
}
-clean_restart $binfile
+clean_restart
+gdb_load $binfile
set bp_location [gdb_get_line_number "set breakpoint here" $new_srcfile]
return -1
}
-clean_restart $binfile
+clean_restart
+gdb_load $binfile
gdb_load_shlib $lib_so
if {![runto_main]} {
proc setup {commands} {
global srcfile binfile
- clean_restart $binfile
+ clean_restart
+ gdb_load $binfile
if {![runto_main]} {
return -code return
require {expr $compilation_succeeded}
# Start with a fresh gdb.
-clean_restart ${binfile}
+clean_restart
+gdb_load $binfile
save_vars { timeout } {
set timeout 30
set binfile2 [gdb_remote_download target $binfile2]
}
-clean_restart $binfile
+clean_restart
+gdb_load $binfile
if {![runto_main]} {
return -1
append ::GDBFLAGS \
" -ex \"maintenance set target-async ${target_async}\""
- clean_restart ${::binfile}
+ clean_restart
+ gdb_load $::binfile
}
if { ![runto_main] } {
}
# Start with a fresh gdb.
- clean_restart ${binfile}
+ clean_restart
+ gdb_load $binfile
# Make certain that the output is consistent
gdb_test_no_output "set print sevenbit-strings"
append ::GDBFLAGS \
" -ex \"maintenance set target-async ${target_async}\""
- clean_restart ${::binfile}
+ clean_restart
+ gdb_load $::binfile
}
if {![runto_main]} {
stub_suitable } {
global binfile hex
- clean_restart $binfile
+ clean_restart
+ gdb_load $binfile
gdb_test_no_output "set startup-with-shell $startup_with_shell"
save_vars { GDBFLAGS } {
append GDBFLAGS " -ex \"set non-stop on\""
- clean_restart ${binfile}
+ clean_restart
+ gdb_load $binfile
}
gdb_test_no_output "set detach-on-fork off"
}
set gcorefile [standard_output_file $testfile.gcore]
if {[gdb_gcore_cmd $gcorefile "save a core file"]} {
- clean_restart $binfile
+ clean_restart
+ gdb_load $binfile
gdb_test "core $gcorefile" "Core was generated by.*" \
"core [file tail $gcorefile]"
return -1
}
-clean_restart ${binfile}
+clean_restart
+gdb_load $binfile
set solib_name [gdb_load_shlib $solib_name]
return
}
- clean_restart $::binfile
+ clean_restart
+ gdb_load $::binfile
if {![runto_main]} {
fail "could not run to main"
# Attach to the parent, run it to a known point, extract the
# child's PID, and detach.
with_test_prefix "parent" {
- clean_restart ${binfile}
+ clean_restart
+ gdb_load $binfile
gdb_test "attach $parent_pid" \
"Attaching to program.*, process $parent_pid.*" \
with_test_prefix "child" {
global gdb_prompt
- clean_restart $binfile
+ clean_restart
+ gdb_load $binfile
gdb_test "attach $child_pid" \
"Attaching to program.*, process $child_pid.*" \
global binfile
global gdb_prompt
- clean_restart $binfile
+ clean_restart
+ gdb_load $binfile
gdb_test "set follow-fork-mode child" ".*"
return -1
}
-clean_restart $binfile
+clean_restart
+gdb_load $binfile
if {![runto_main]} {
return
with_test_prefix "initial run" {
if {$standalone} {
- clean_restart $binfile
+ clean_restart
+ gdb_load $binfile
} else {
clean_restart $binfile_dl
}
proc run_test { exit_p checkpoint_p } {
save_vars { ::GDBFLAGS } {
append ::GDBFLAGS " -ex \"set non-stop on\""
- clean_restart $::binfile
+ clean_restart
+ gdb_load $::binfile
}
if {![runto_main]} {
global gdb_prompt
global decimal
- clean_restart ${binfile}
+ clean_restart
+ gdb_load $binfile
if ![runto done] {
return
gdb_continue_to_end "first session"
}
-clean_restart $binfile
+clean_restart
+gdb_load $binfile
# Try exercising the "minimal" language a bit...
return -1
}
-clean_restart ${binfile}
+clean_restart
+gdb_load $binfile
# Any command that causes GDB to read the debugging info for the
# lineinc.c compilation unit will do here.
remote_file host delete $srcfile
# Now start GDB, run to main and try to list the source.
-clean_restart ${binfile}
+clean_restart
+gdb_load $binfile
if {![runto_main]} {
return 0
proc test_list_invalid_args {} {
global binfile
- clean_restart ${binfile}
+ clean_restart
+ gdb_load $binfile
gdb_test "list -INVALID" \
"invalid explicit location argument, \"-INVALID\"" \
"first use of \"list -INVALID\""
"invalid explicit location argument, \"-INVALID\"" \
"second use of \"list -INVALID\""
- clean_restart ${binfile}
+ clean_restart
+ gdb_load $binfile
gdb_test "list +INVALID" "Function \"\\+INVALID\" not defined." \
"first use of \"list +INVALID\""
gdb_test "list +INVALID" "Function \"\\+INVALID\" not defined." \
with_test_prefix "$command after stop: $listsize1, $listsize2" {
global binfile
- clean_restart $binfile
+ clean_restart
+ gdb_load $binfile
if {![runto_main]} {
return
}
return -1
}
-clean_restart ${binfile}
+clean_restart
+gdb_load $binfile
#
# use this to debug:
#log_user 1
-clean_restart ${binfile}
+clean_restart
+gdb_load $binfile
if {![runto known_types]} {
return
}
proc do_test { with_probes } {
- clean_restart ${::binfile}
+ clean_restart
+ gdb_load $::binfile
if { !$with_probes } {
gdb_test "maint ignore-probes libc ^longjmp$"
return -1
}
-clean_restart ${binfile}
+clean_restart
+gdb_load $binfile
# Ask GDB to show the current definition of MACRO, and return a list
inline_func_a inline_func_b] \
"maint info blocks using stored \$pc, inferior still running"
-clean_restart $binfile
+clean_restart
+gdb_load $binfile
# Use the recorded $pc value to check inline frames when the inferior
# is not executing.
foreach cmd {"per-command" "per-command time"} {
with_test_prefix $cmd {
# GDB only warns once, so restart between commands.
- clean_restart $binfile
+ clean_restart
+ gdb_load $binfile
gdb_test "mt set $cmd on" "$maybe_per_command_warning"
gdb_test "mt set $cmd off" "command started"
gdb_test_no_output "mt set $cmd on" \
return -1
}
-clean_restart ${binfile}
+clean_restart
+gdb_load $binfile
#
# Start with a fresh gdb
-clean_restart ${binfile}
+clean_restart
+gdb_load $binfile
global gdb_prompt
# parent's branch.
foreach mode { "child" "parent" } {
- clean_restart ${binfile}
+ clean_restart
+ gdb_load $binfile
runto_main
gdb_test_no_output "set follow-fork $mode"
# Start with a fresh gdb
-clean_restart ${binfile}
+clean_restart
+gdb_load $binfile
runto_main
gdb_breakpoint $exit_bp_loc
# Start with a fresh gdb.
-clean_restart $binfile
+clean_restart
+gdb_load $binfile
# Run to FUNC and unload symbols from system shared libraries, to
# avoid conflicts with the minsyms in the program. E.g.,
set eol "\r\n"
set sp "\[ \t\]*"
-clean_restart ${binfile}
+clean_restart
+gdb_load $binfile
gdb_test "ptype struct not_empty" \
"type = struct not_empty {$eol${sp}void \\*e;$eol${sp}void \\*u;$eol}"
return -1
}
- clean_restart $binfile
+ clean_restart
+ gdb_load $binfile
gdb_breakpoint "*marker"
}
global binfile
- clean_restart $binfile
+ clean_restart
+ gdb_load $binfile
if ![runto_main] {
return
"backtrace no-filters"
global binfile
- clean_restart $binfile
+ clean_restart
+ gdb_load $binfile
if ![runto_main] {
return
set testline [gdb_get_line_number "after sleep"]
with_test_prefix "ctrlc target running" {
- clean_restart $binfile
+ clean_restart
+ gdb_load $binfile
if {![runto_main]} {
return 0
global decimal
with_test_prefix "paginate" {
- clean_restart $binfile
+ clean_restart
+ gdb_load $binfile
if {![runto_main]} {
return 0
global inferior_exited_re
with_test_prefix "paginate" {
- clean_restart $binfile
+ clean_restart
+ gdb_load $binfile
if {![runto_main]} {
return 0
gdb_test "p extern_global = 2" " = 2" "modify value"
gdb_test "p extern_global" " = 2" "value modified"
- clean_restart $binfile
+ clean_restart
+ gdb_load $binfile
gdb_test "p extern_global" " = 2" "value modified persisted"
}
# Generate a core file.
with_test_prefix "gcore" {
- clean_restart $binfile
+ clean_restart
+ gdb_load $binfile
if {![runto_main]} {
return
"check we read the frame's PC"
# Restart and load the Python unwinder script.
-clean_restart $binfile
+clean_restart
+gdb_load $binfile
gdb_test_no_output "source ${remote_python_file}" "load python file"
# Tell the Python unwinder to use the frame-id we cached above.
proc setup_test {detach_on_fork {follow_fork_mode "parent"}} {
global binfile
- clean_restart ${binfile}
+ clean_restart
+ gdb_load $binfile
if ![runto_main] {
return
return -1
}
-clean_restart ${binfile}
+clean_restart
+gdb_load $binfile
#
# Start with a fresh gdb.
-clean_restart ${binfile}
+clean_restart
+gdb_load $binfile
if {![runto_main]} {
return 0
return -1
}
-clean_restart ${binfile}
+clean_restart
+gdb_load $binfile
gdb_load_shlib ${binfile_lib}
if ![runto lib] {
global binfile
global gdb_prompt
with_test_prefix "shlib ${print_symbol_loading}" {
- clean_restart ${binfile}
+ clean_restart
+ gdb_load $binfile
if ![runto_main] {
return -1
}
return -1
}
-clean_restart ${binfile}
+clean_restart
+gdb_load $binfile
if {![runto_main]} {
return
# Get things started.
-clean_restart ${binfile}
+clean_restart
+gdb_load $binfile
if ![runto marker1] {
untested "couldn't run to marker1"
set test_spawn_id ""
if {$appear_how != "attach-nofile"} {
- clean_restart $binfile
+ clean_restart
+ gdb_load $binfile
} else {
clean_restart
}
# while gdb is processing the internal software watchtpoint
# single-step. With remote debugging, the ctrl-c reaches GDB first.
with_test_prefix "run" {
- clean_restart $binfile
+ clean_restart
+ gdb_load $binfile
if {![runto_main]} {
return -1
# reaches GDB first. Test that as well.
with_test_prefix "attach" {
if {[can_spawn_for_attach]} {
- clean_restart $binfile
+ clean_restart
+ gdb_load $binfile
set test_spawn_id [spawn_wait_for_attach $binfile]
set testpid [spawn_id_get_pid $test_spawn_id]
# INPUTRC gets reset for the next testfile.
setenv INPUTRC $inputrc
-clean_restart ${binfile}
+clean_restart
+gdb_load $binfile
if { ![readline_is_used] } {
unsupported "completion doesn't work when readline isn't used."
# arrived. If it is then GDB will start displaying extra blank lines
# after each line of input.
proc run_test {} {
- clean_restart $::binfile
+ clean_restart
+ gdb_load $::binfile
gdb_breakpoint main
# Get things started.
-clean_restart ${binfile}
+clean_restart
+gdb_load $binfile
runto_main
# Get the size of random_data table (defaults to 48K).
set sizeof_random_data [get_sizeof "random_data" 48*1024]
-clean_restart $binfile
+clean_restart
+gdb_load $binfile
#
# Part THREE: Check the upload behavior.
gdb_rename_execfile ${binfile1} ${binfile}
# Restart GDB entirely.
- clean_restart ${binfile}
+ clean_restart
+ gdb_load $binfile
# Set a breakpoint on foo and run to it.
gdb_test "break foo" \
set timeout $prev_timeout
# Test PR cli/23785
-clean_restart $binfile
+clean_restart
+gdb_load $binfile
if { ![runto_main] } {
return -1
}
# Start with a fresh gdb.
-clean_restart ${binfile}
+clean_restart
+gdb_load $binfile
set timeout 30
return2_tests
set ::GDBFLAGS "$::GDBFLAGS -ex \"maint set target-non-stop on\""
}
- clean_restart $::binfile
+ clean_restart
+ gdb_load $::binfile
}
if { ![runto_main] } {
save_vars { ::GDBFLAGS } {
append ::GDBFLAGS " -ex \"maintenance set target-non-stop on\""
- clean_restart $::binfile
+ clean_restart
+ gdb_load $::binfile
}
# Ensure we are at least after the getpid call, should we need it.
proc_with_prefix test {} {
global gdb_prompt binfile
- clean_restart $binfile
+ clean_restart
+ gdb_load $binfile
gdb_test_no_output "set confirm off"
}
# get things started
-clean_restart ${binfile}
+clean_restart
+gdb_load $binfile
# Advance to main
if {![runto_main]} {
set location [gdb_get_line_number "say_hello" "sep-proc.c"]
-clean_restart ${binfile}
+clean_restart
+gdb_load $binfile
# Try to display the source code inside a file which is included by
# another source file. The purpose of this test is to verify that
# Try the same, but this time with a breakpoint. We need to exit
# GDB to make sure that we havn't loaded the full symbols yet when
# we test the breakpoint insertion.
-clean_restart $binfile
+clean_restart
+gdb_load $binfile
set test "breakpoint inside included file"
gdb_test_multiple "break sep-proc.c:$location" "$test" {
return -1
}
-clean_restart ${binfile}
+clean_restart
+gdb_load $binfile
set command "info sym main"
set command_regex [string_to_regexp $command]
}
test_cd_into_dir
-clean_restart $binfile
+clean_restart
+gdb_load $binfile
test_tilde_expansion
-clean_restart $binfile
+clean_restart
+gdb_load $binfile
test_cwd_reset
proc test_set_inferior_tty { command } {
global binfile
- clean_restart ${binfile}
+ clean_restart
+ gdb_load $binfile
gdb_test_no_output "$command hello" "set inferior-tty to hello"
gdb_test "show inferior-tty" \
proc_with_prefix test_setshow_annotate {} {
# Start with a fresh gdb
- clean_restart $::binfile
+ clean_restart
+ gdb_load $::binfile
if {![runto_main]} {
return
}
proc_with_prefix test_setshow_args {} {
- clean_restart $::binfile
+ clean_restart
+ gdb_load $::binfile
if {![runto_main]} {
return
global srcfile binfile
# Load symbols for the completion test below.
- clean_restart $binfile
+ clean_restart
+ gdb_load $binfile
# Use these variables to make sure we don't call the wrong command
# by mistake.
proc do_test { var_value { var_name "" } { var_name_match "" } { var_value_match "" } } {
global binfile test_var_name
- clean_restart $binfile
+ clean_restart
+ gdb_load $binfile
if { $var_name == "" } {
set var_name $test_var_name
proc test_set_unset_vars { } {
global binfile
- clean_restart $binfile
+ clean_restart
+ gdb_load $binfile
with_test_prefix "set 3 environment variables" {
# Set some environment variables
proc test_unset { } {
global hex decimal binfile gdb_prompt
- clean_restart $binfile
+ clean_restart
+ gdb_load $binfile
do_prepare_inferior
}
with_test_prefix "set-then-unset" {
- clean_restart $binfile
+ clean_restart
+ gdb_load $binfile
# Test if setting and then unsetting $HOME works.
gdb_test_no_output "set environment HOME = test" "set HOME as test"
# Start with a fresh gdb.
-clean_restart ${binfile}
+clean_restart
+gdb_load $binfile
gdb_load_shlib $lib1
gdb_load_shlib $lib2
# Start with a fresh gdb.
-clean_restart $binfile
+clean_restart
+gdb_load $binfile
# PR's 16495, 18213
# test that we can re-set breakpoints in shared libraries
return
}
- clean_restart $::binfile
+ clean_restart
+ gdb_load $::binfile
if {![runto_main]} {
return
# Check that GDB disables dprintf breakpoints within a shared library
# when the shared library is unloaded.
proc_with_prefix test_dprintf_after_unload {} {
- clean_restart $::binfile
+ clean_restart
+ gdb_load $::binfile
if {![runto_main]} {
return
# inferior. We should not get an error about re-setting the dprintf
# breakpoint.
proc_with_prefix test_dprintf_with_rerun {} {
- clean_restart $::binfile
+ clean_restart
+ gdb_load $::binfile
if {![runto_main]} {
return
}
foreach_with_prefix type { breakpoint dprintf } {
- clean_restart $::binfile
+ clean_restart
+ gdb_load $::binfile
if {![runto_main]} {
return
# Start with a fresh gdb.
-clean_restart $binfile
+clean_restart
+gdb_load $binfile
gdb_load_shlib $lib1_sl
gdb_load_shlib $lib2_sl
}
# get things started
-clean_restart ${binfile}
+clean_restart
+gdb_load $binfile
# Pass all the alarms straight through (but verbosely)
gdb_test "handle SIGALRM print pass nostop"
return -1
}
-clean_restart ${binfile}
+clean_restart
+gdb_load $binfile
runto_main
# Test siginfo preservation in core files.
if {$gcore_created} {
- clean_restart $binfile
+ clean_restart
+ gdb_load $binfile
gdb_test "core $gcorefile" "Core was generated by.*" \
"core [file tail $gcorefile]"
return -1
}
-clean_restart $binfile
+clean_restart
+gdb_load $binfile
# Advance to main
if {![runto_main]} {
# Test siginfo preservation in core files.
if {$gcore_created} {
- clean_restart $binfile
+ clean_restart
+ gdb_load $binfile
gdb_test "core $gcorefile" "Core was generated by.*" \
"core [file tail $gcorefile]"
# Now run the program through gdb, and dump its initial signal actions
# and mask in "gdb.txt".
-clean_restart $binfile
+clean_restart
+gdb_load $binfile
if {![runto_main]} {
return -1
}
test_handle_all_print
-clean_restart $binfile
+clean_restart
+gdb_load $binfile
if {[runto_main]} {
return -1
}
-clean_restart ${binfile}
+clean_restart
+gdb_load $binfile
#
# Run to `main' where we begin our tests.
}
# get things started
-clean_restart ${binfile}
+clean_restart
+gdb_load $binfile
# Advance to main
if {![runto_main]} {
proc restart {} {
global binfile
- clean_restart $binfile
+ clean_restart
+ gdb_load $binfile
gdb_test "display/i \$pc"
# Start with a fresh gdb
-clean_restart ${binfile}
+clean_restart
+gdb_load $binfile
gdb_load_shlib $lib_sl
# This program implicitly loads SOM shared libraries.
return -1
}
-clean_restart $binfile
+clean_restart
+gdb_load $binfile
if {![runto_main]} {
return 0
return -1
}
-clean_restart $binfile
+clean_restart
+gdb_load $binfile
gdb_load_shlib $libobj
if {![runto_main]} {
return -1
}
-clean_restart $binfile
+clean_restart
+gdb_load $binfile
gdb_load_shlib $binfile_lib
# Set a breakpoint in the binary.
}
with_test_prefix $testopts {
- clean_restart $binfile
+ clean_restart
+ gdb_load $binfile
gdb_load_shlib $lib1
gdb_load_shlib $lib2
}
}
- clean_restart ${binfile}
+ clean_restart
+ gdb_load $binfile
if { [ishost *-*-mingw*] } {
gdb_test_no_output "set directories \$cdir;\$cwd"
return -1
}
-clean_restart ${binfile}
+clean_restart
+gdb_load $binfile
if {![runto_main]} {
return 0
proc initial_setup_simple { startup_with_shell run_args } {
global hex decimal binfile unique_file
- clean_restart $binfile
+ clean_restart
+ gdb_load $binfile
gdb_test_no_output "set startup-with-shell $startup_with_shell"
gdb_test_no_output "set print characters unlimited"
global hex
global binfile
- clean_restart $binfile
+ clean_restart
+ gdb_load $binfile
if ![runto_main] {
return -1
save_vars { GDBFLAGS } {
set GDBFLAGS "$GDBFLAGS -ex \"set non-stop $non_stop\""
- clean_restart $binfile
+ clean_restart
+ gdb_load $binfile
}
gdb_test_no_output "set displaced-stepping $displaced"
return -1
}
-clean_restart ${binfile}
+clean_restart
+gdb_load $binfile
if {![runto_main]} {
return 0
# prompt, the previous line disables styling as expected.
proc test_pagination_prompt_styling {} {
with_ansi_styling_terminal {
- clean_restart $::binfile
+ clean_restart
+ gdb_load $::binfile
}
if {![runto_main]} {
# default style once the logging file has finished.
proc test_pagination_continue_styling_1 { length } {
with_ansi_styling_terminal {
- clean_restart $::binfile
+ clean_restart
+ gdb_load $::binfile
}
set filename [string repeat "ax" $length]
# Check to see if the Python styling of disassembler output is
# expected or not, this styling requires Python support in GDB, and
# the Python pygments module to be available.
-clean_restart ${binfile}
+clean_restart
+gdb_load $binfile
if {[allow_python_tests] && [gdb_py_module_available "pygments"]} {
set python_disassembly_styling true
} else {
proc do_test { remove_expr } {
global lib_basename lib_syms srcfile srcfile3
- clean_restart $::binfile
+ clean_restart
+ gdb_load $::binfile
if {![runto_main]} {
return
# Start with a fresh gdb.
-clean_restart $binfile
+clean_restart
+gdb_load $binfile
gdb_load_shlib $lib1
if ![runto_main] {
proc_with_prefix test_set_unset_env {} {
global binfile
- clean_restart $binfile
+ clean_restart
+ gdb_load $binfile
# First test with no TEST_GDB_VAR.
with_test_prefix "test1" {
save_vars {env(TEST_GDB_GLOBAL)} {
set env(TEST_GDB_GLOBAL) "Global environment value"
- clean_restart $binfile
+ clean_restart
+ gdb_load $binfile
gdb_breakpoint $bp_line
}
proc do_tests {force_internal_tls} {
- clean_restart $::binfile
+ clean_restart
+ gdb_load $::binfile
if ![runto_main] {
return
}
return
}
- clean_restart $::binfile
+ clean_restart
+ gdb_load $::binfile
set core_loaded [gdb_core_cmd $corefile "load corefile"]
if { $core_loaded == -1 } {
set lib3obj [standard_output_file "${testfile}3-lib.so"]
proc do_tests {force_internal_tls {do_kfail_tls_access 0}} {
- clean_restart $::binfile
+ clean_restart
+ gdb_load $::binfile
if ![runto_main] {
return
}
return
}
- clean_restart $::binfile
+ clean_restart
+ gdb_load $::binfile
set core_loaded [gdb_core_cmd $corefile "load corefile"]
if { $core_loaded == -1 } {
standard_testfile
proc do_tests {force_internal_tls {do_kfail_tls_access 0}} {
- clean_restart $::binfile
+ clean_restart
+ gdb_load $::binfile
if ![runto_main] {
return
}
return
}
- clean_restart $::binfile
+ clean_restart
+ gdb_load $::binfile
set core_loaded [gdb_core_cmd $corefile "load corefile"]
if { $core_loaded == -1 } {
# Start with a fresh gdb.
-clean_restart $binfile
+clean_restart
+gdb_load $binfile
if {[runto_main]} {
# Test that GDB can still detect whether we have line numbers
return -1
}
-clean_restart ${binfile}
+clean_restart
+gdb_load $binfile
gdb_load_shlib ${libobj}
if {![runto_main]} {
return -1
}
-clean_restart $binfile
+clean_restart
+gdb_load $binfile
gdb_load_shlib $lib_sl
gdb_load_shlib $lib_sl2
# Start with a fresh gdb.
-clean_restart ${binfile}
+clean_restart
+gdb_load $binfile
gdb_test_no_output "set print sevenbit-strings"
gdb_test_no_output "set print address off"
gdb_test_no_output "set width 0"
return -1
}
-clean_restart ${binfile}
+clean_restart
+gdb_load $binfile
if {![runto_main]} {
return
# A clean restart is needed to force the hardware watchpoint setup
# logic to run post attach rather than post inferior launch.
-clean_restart $binfile
+clean_restart
+gdb_load $binfile
gdb_test "attach $testpid" "Attaching to program: .*, process $testpid.*" "attach twice"
# default.
append ::GDBFLAGS " -ex \"maint set target-non-stop on\""
}
- clean_restart $::binfile
+ clean_restart
+ gdb_load $::binfile
}
gdb_test_no_output "set can-use-hw-watchpoints $hw"
return -1
}
-clean_restart $binfile
+clean_restart
+gdb_load $binfile
gdb_load_shlib $lib_sl
runto_main
with_test_prefix "always-inserted $always_inserted" {
- clean_restart $binfile
+ clean_restart
+ gdb_load $binfile
if {![runto_main]} {
return
# This will turn hardware watchpoints back on and delete the watchpoint
# we just created.
- clean_restart ${binfile}
+ clean_restart
+ gdb_load $binfile
# Disable hardware watchpoints if necessary.
if {!$allow_hw_watchpoint_tests_p} {
return -1
}
-clean_restart $binfile
+clean_restart
+gdb_load $binfile
gdb_test "with language ada -- print g_s" \
" = \\(a => 1, b => 2, c => 3\\)"
return -1
}
-clean_restart $binfile
+clean_restart
+gdb_load $binfile
# Test "maint with". VALUES is a list of values. A nested "with" is
# performed with each combination of pair of values from this list.
# Check repeating.
with_test_prefix "repeat" {
- clean_restart $binfile
+ clean_restart
+ gdb_load $binfile
# "with" with no command reinvokes the previous command.
gdb_test "with language ada" \
# Basic run control.
with_test_prefix "run control" {
- clean_restart $binfile
+ clean_restart
+ gdb_load $binfile
if ![runto_main] {
return