@@ -17,10 +17,6 @@
load_lib "trace-support.exp"
-
-gdb_exit
-gdb_start
-
standard_testfile
require gdb_trace_common_supports_arch
if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \
@@ -28,12 +24,8 @@ if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \
untested "failed to compile"
return -1
}
-gdb_reinitialize_dir $srcdir/$subdir
-
-# If testing on a remote host, download the source file.
-# remote_download host $srcdir/$subdir/$srcfile
-gdb_file_cmd $binfile
+clean_restart $binfile
# define relative source line numbers:
# all subsequent line numbers are relative to this first one (baseline)
@@ -325,10 +317,7 @@ gdb_test "tsave -ctf ${tracefile}.ctf" \
"save ctf trace file"
# Restart GDB and read the trace data in tfile target.
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_file_cmd $binfile
+clean_restart $binfile
gdb_test "target tfile ${tracefile}.tf" ".*" \
"change to tfile target"
check_tracepoint "tfile"
@@ -345,10 +334,7 @@ gdb_test_multiple "target ctf" "" {
}
if { $gdb_can_read_ctf_data } {
- gdb_exit
- gdb_start
- gdb_reinitialize_dir $srcdir/$subdir
- gdb_file_cmd $binfile
+ clean_restart $binfile
gdb_test "target ctf ${tracefile}.ctf" ".*" \
"change to ctf target"
check_tracepoint "ctf"
@@ -20,9 +20,6 @@
load_lib "trace-support.exp"
-
-gdb_exit
-gdb_start
standard_testfile actions.c
require gdb_trace_common_supports_arch
@@ -33,9 +30,8 @@ if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \
return -1
}
-gdb_load $binfile
+clean_restart $binfile
runto_main
-gdb_reinitialize_dir $srcdir/$subdir
gdb_test "maint agent 12" ".*const8 12.*pop.*end.*"
@@ -175,9 +175,7 @@ proc tracepoint_change_loc_2 { trace_type } {
global binfile
global gdb_prompt
- gdb_exit
- gdb_start
- gdb_reinitialize_dir $srcdir/$subdir
+ clean_restart
gdb_test_multiple "${trace_type} set_tracepoint" "set pending tracepoint" {
-re ".*Make \(|fast \)tracepoint pending.*y or \\\[n\\\]. $" {
@@ -17,10 +17,6 @@
load_lib "trace-support.exp"
-
-gdb_exit
-gdb_start
-
standard_testfile actions.c
require gdb_trace_common_supports_arch
@@ -30,12 +26,8 @@ if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \
untested "failed to compile"
return -1
}
-gdb_reinitialize_dir $srcdir/$subdir
-
-# If testing on a remote host, download the source file.
-# remote_download host $srcdir/$subdir/$srcfile
-gdb_file_cmd $binfile
+clean_restart $binfile
# define relative source line numbers:
# all subsequent line numbers are relative to this first one (baseline)
@@ -29,14 +29,7 @@ if {[gdb_compile [list ${binfile}1.o] \
return -1
}
-# Start GDB and load executable file, compute the offset of the
-# instruction in bar returned from foo. It is needed in the Dwarf
-# Assembler.
-
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}1
+clean_restart ${binfile}1
set returned_from_foo ""
@@ -83,8 +76,6 @@ if { [string equal $returned_from_foo ""] } {
return -1
}
-gdb_exit
-
# Make some DWARF for the test.
set asm_file [standard_output_file $srcfile2]
Dwarf::assemble $asm_file {
@@ -18,9 +18,6 @@
load_lib "trace-support.exp"
-gdb_exit
-gdb_start
-
standard_testfile actions.c
require gdb_trace_common_supports_arch
@@ -30,12 +27,8 @@ if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \
untested "failed to compile"
return -1
}
-gdb_reinitialize_dir $srcdir/$subdir
-
-# If testing on a remote host, download the source file.
-# remote_download host $srcdir/$subdir/$srcfile
-gdb_file_cmd $binfile
+clean_restart $binfile
#
# test "info tracepoints" command
@@ -17,10 +17,6 @@
load_lib "trace-support.exp"
-
-gdb_exit
-gdb_start
-
standard_testfile actions.c
require gdb_trace_common_supports_arch
if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \
@@ -28,11 +24,11 @@ if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \
untested "failed to compile"
return -1
}
-gdb_load $binfile
+
+clean_restart $binfile
gdb_test "tstop" ".*" ""
gdb_test "tfind none" ".*" ""
runto_main
-gdb_reinitialize_dir $srcdir/$subdir
if {![gdb_target_supports_trace]} {
unsupported "current target does not support trace"
@@ -17,9 +17,6 @@
load_lib "trace-support.exp"
-
-gdb_exit
-gdb_start
standard_testfile actions.c
require gdb_trace_common_supports_arch
if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \
@@ -27,9 +24,9 @@ if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \
untested "failed to compile"
return -1
}
-gdb_load $binfile
+
+clean_restart $binfile
runto_main
-gdb_reinitialize_dir $srcdir/$subdir
if {![gdb_target_supports_trace]} {
unsupported "current target does not support trace"
@@ -17,9 +17,6 @@
load_lib "trace-support.exp"
-
-gdb_exit
-gdb_start
standard_testfile actions.c
require gdb_trace_common_supports_arch
if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \
@@ -27,12 +24,8 @@ if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \
untested "failed to compile"
return -1
}
-gdb_reinitialize_dir $srcdir/$subdir
-
-# If testing on a remote host, download the source file.
-# remote_download host $srcdir/$subdir/$srcfile
-gdb_file_cmd $binfile
+clean_restart $binfile
# define relative source line numbers:
# all subsequent line numbers are relative to this first one (baseline)
@@ -66,9 +66,7 @@ proc pending_tracepoint_resolved { trace_type } {
global lib_sl1
# Start with a fresh gdb.
- gdb_exit
- gdb_start
- gdb_reinitialize_dir $srcdir/$subdir
+ clean_restart
gdb_test_multiple "$trace_type set_point1" "set pending tracepoint" {
-re ".*Make \(fast |\)tracepoint pending.*y or \\\[n\\\]. $" {
@@ -127,10 +127,7 @@ proc teset_from_exec { target } {
global tracefile
# Restart GDB and read the trace data in ${target} target.
- gdb_exit
- gdb_start
- gdb_reinitialize_dir $srcdir/$subdir
- gdb_file_cmd $binfile
+ clean_restart $binfile
gdb_test "target ${target} ${tracefile}.${target}" ".*" \
"change to ${target} target"
@@ -17,10 +17,6 @@
load_lib "trace-support.exp"
-
-gdb_exit
-gdb_start
-
standard_testfile actions.c
require gdb_trace_common_supports_arch
if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \
@@ -28,9 +24,8 @@ if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \
untested "failed to compile"
return -1
}
-gdb_load $binfile
+clean_restart $binfile
runto_main
-gdb_reinitialize_dir $srcdir/$subdir
if {![gdb_target_supports_trace]} {
unsupported "current target does not support trace"
@@ -18,9 +18,6 @@
load_lib "trace-support.exp"
-gdb_exit
-gdb_start
-
standard_testfile actions.c
require gdb_trace_common_supports_arch
if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \
@@ -28,12 +25,8 @@ if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \
untested "failed to compile"
return -1
}
-gdb_reinitialize_dir $srcdir/$subdir
-
-# If testing on a remote host, download the source file.
-# remote_download host $srcdir/$subdir/$srcfile
-gdb_file_cmd $binfile
+clean_restart $binfile
# define relative source line numbers:
# all subsequent line numbers are relative to this first one (baseline)
@@ -121,10 +121,7 @@ gdb_test "info registers" "The program has no registers now\." \
# Now start afresh, using only a trace file.
-gdb_exit
-gdb_start
-
-gdb_load $binfile
+clean_restart $binfile
gdb_test "target tfile $tfile_error" "Created tracepoint.*" \
"target tfile [file tail $tfile_error]"
@@ -17,10 +17,6 @@
load_lib "trace-support.exp"
-
-gdb_exit
-gdb_start
-
standard_testfile actions.c
require gdb_trace_common_supports_arch
@@ -30,7 +26,8 @@ if { [gdb_compile "$srcdir/$subdir/$srcfile" "$binfile" \
untested "failed to compile"
return -1
}
-gdb_load $binfile
+
+clean_restart $binfile
# 6.2 test help tstart
gdb_test "help tstart" \
@@ -60,7 +57,6 @@ gdb_test "help tfind trace" "Select a trace frame by tracepoint number.*" \
"8.38: help tfind tracepoint"
runto_main
-gdb_reinitialize_dir $srcdir/$subdir
if {![gdb_target_supports_trace]} {
unsupported "current target does not support trace"
@@ -17,9 +17,6 @@
load_lib "trace-support.exp"
-
-gdb_exit
-gdb_start
standard_testfile actions.c
require gdb_trace_common_supports_arch
if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \
@@ -27,12 +24,8 @@ if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \
untested "failed to compile"
return -1
}
-gdb_reinitialize_dir $srcdir/$subdir
-
-# If testing on a remote host, download the source file.
-# remote_download host $srcdir/$subdir/$srcfile
-gdb_file_cmd $binfile
+clean_restart $binfile
# define relative source line numbers:
# all subsequent line numbers are relative to this first one (baseline)
@@ -15,9 +15,6 @@
load_lib "trace-support.exp"
-
-gdb_exit
-gdb_start
standard_testfile actions.c
require gdb_trace_common_supports_arch
if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \
@@ -25,7 +22,8 @@ if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \
untested "failed to compile"
return -1
}
-gdb_load $binfile
+
+clean_restart $binfile
# PR gdb/21352: Command tsave does not support -r argument
gdb_test "tsave -r" "Argument required \\\(file in which to save trace data\\\)\." \
@@ -202,10 +202,7 @@ proc gdb_collect_args_test {} {
foreach target_name ${trace_file_targets} {
# Restart GDB and read the trace data in ${TARGET_NAME} target.
- gdb_exit
- gdb_start
- gdb_reinitialize_dir $srcdir/$subdir
- gdb_file_cmd $binfile
+ clean_restart $binfile
gdb_test "target ${target_name} ${tracefile}.args.${target_name}" ".*" \
"change to ${target_name} target"
@@ -286,10 +283,7 @@ proc gdb_collect_locals_test { func msg } {
foreach target_name ${trace_file_targets} {
# Restart GDB and read the trace data in ${TARGET_NAME} target.
- gdb_exit
- gdb_start
- gdb_reinitialize_dir $srcdir/$subdir
- gdb_file_cmd $binfile
+ clean_restart $binfile
gdb_test "target ${target_name} ${tracefile}.locals.${target_name}" ".*" \
"change to ${target_name} target"
@@ -369,10 +363,7 @@ proc gdb_unavailable_registers_test { } {
foreach target_name ${trace_file_targets} {
# Restart GDB and read the trace data in ${TARGET_NAME} target.
- gdb_exit
- gdb_start
- gdb_reinitialize_dir $srcdir/$subdir
- gdb_file_cmd $binfile
+ clean_restart $binfile
gdb_test "target ${target_name} ${tracefile}.registers.${target_name}" ".*" \
"change to ${target_name} target"
@@ -433,10 +424,7 @@ proc gdb_unavailable_floats { } {
foreach target_name ${trace_file_targets} {
# Restart GDB and read the trace data in ${TARGET_NAME} target.
- gdb_exit
- gdb_start
- gdb_reinitialize_dir $srcdir/$subdir
- gdb_file_cmd $binfile
+ clean_restart $binfile
gdb_test "target ${target_name} ${tracefile}.floats.${target_name}" ".*" \
"change to ${target_name} target"
@@ -701,10 +689,7 @@ proc gdb_collect_globals_test { } {
foreach target_name ${trace_file_targets} {
# Restart GDB and read the trace data in ${TARGET_NAME} target.
- gdb_exit
- gdb_start
- gdb_reinitialize_dir $srcdir/$subdir
- gdb_file_cmd $binfile
+ clean_restart $binfile
gdb_test "target ${target_name} ${tracefile}.globals.${target_name}" ".*" \
"change to ${target_name} target"
@@ -17,10 +17,6 @@
load_lib "trace-support.exp"
-
-gdb_exit
-gdb_start
-
standard_testfile actions.c
set executable $testfile
require gdb_trace_common_supports_arch
@@ -29,9 +25,9 @@ if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \
untested "failed to compile"
return -1
}
-gdb_load $binfile
+
+clean_restart $binfile
runto_main
-gdb_reinitialize_dir $srcdir/$subdir
if {![gdb_target_supports_trace]} {
unsupported "current target does not support trace"
@@ -17,10 +17,6 @@
load_lib "trace-support.exp"
-
-gdb_exit
-gdb_start
-
standard_testfile actions.c
require gdb_trace_common_supports_arch
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" $binfile \
@@ -28,12 +24,8 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" $binfile \
untested "failed to compile"
return -1
}
-gdb_reinitialize_dir $srcdir/$subdir
-
-# If testing on a remote host, download the source file.
-# remote_download host $srcdir/$subdir/$srcfile
-gdb_file_cmd $binfile
+clean_restart $binfile
#
# test while-stepping command
@@ -151,10 +143,7 @@ gdb_test "tsave -ctf ${tracefile}.ctf" \
"save ctf trace file"
# Restart GDB and read the trace data in tfile target.
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_file_cmd $binfile
+clean_restart $binfile
gdb_test "target tfile ${tracefile}.tf" ".*" \
"change to tfile target"
check_tracepoint "tfile"
@@ -171,10 +160,7 @@ gdb_test_multiple "target ctf" "" {
}
if { $gdb_can_read_ctf_data } {
- gdb_exit
- gdb_start
- gdb_reinitialize_dir $srcdir/$subdir
- gdb_file_cmd $binfile
+ clean_restart $binfile
gdb_test "target ctf ${tracefile}.ctf" ".*" \
"change to ctf target"
check_tracepoint "ctf"