diff options
author | Tom Tromey <tom@tromey.com> | 2023-01-25 10:44:25 -0700 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2023-01-26 18:28:31 -0700 |
commit | 6dbbae3b67883fe33c3010557b2cb16d1e4c278a (patch) | |
tree | e016a0d4d2972707eadf76667002039430d5eb22 /gdb/testsuite/gdb.arch | |
parent | 888438e2b4146f9b1021ea240f78f04975a9d925 (diff) | |
download | gdb-6dbbae3b67883fe33c3010557b2cb16d1e4c278a.zip gdb-6dbbae3b67883fe33c3010557b2cb16d1e4c278a.tar.gz gdb-6dbbae3b67883fe33c3010557b2cb16d1e4c278a.tar.bz2 |
Use clean_restart in gdb.arch
Change gdb.arch to use clean_restart more consistently.
Diffstat (limited to 'gdb/testsuite/gdb.arch')
27 files changed, 27 insertions, 116 deletions
diff --git a/gdb/testsuite/gdb.arch/alpha-step.exp b/gdb/testsuite/gdb.arch/alpha-step.exp index 07b4c39..f17210b 100644 --- a/gdb/testsuite/gdb.arch/alpha-step.exp +++ b/gdb/testsuite/gdb.arch/alpha-step.exp @@ -25,10 +25,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {}] ! return -1 } -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir -gdb_load ${binfile} +clean_restart $binfile proc test_stepi {function } { # Restart the program from scratch. If GDB got confused during one diff --git a/gdb/testsuite/gdb.arch/altivec-abi.exp b/gdb/testsuite/gdb.arch/altivec-abi.exp index b048589..8417c88 100644 --- a/gdb/testsuite/gdb.arch/altivec-abi.exp +++ b/gdb/testsuite/gdb.arch/altivec-abi.exp @@ -47,10 +47,7 @@ proc altivec_abi_tests { extra_flags force_abi } { } } - gdb_exit - gdb_start - gdb_reinitialize_dir $srcdir/$subdir - gdb_load ${binfile} + clean_restart $binfile # Run to `main' where we begin our tests. if {![runto_main]} { diff --git a/gdb/testsuite/gdb.arch/e500-prologue.exp b/gdb/testsuite/gdb.arch/e500-prologue.exp index 7c32d9d..82898d9 100644 --- a/gdb/testsuite/gdb.arch/e500-prologue.exp +++ b/gdb/testsuite/gdb.arch/e500-prologue.exp @@ -27,10 +27,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {}] ! return -1 } -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir -gdb_load ${binfile} +clean_restart $binfile # Insert a breakpoint in FUNCTION and verifies that the breakpoint was # inserted at the expected location. EXPECTED_LOCATION should be an diff --git a/gdb/testsuite/gdb.arch/e500-regs.exp b/gdb/testsuite/gdb.arch/e500-regs.exp index 615b745..ac196ff 100644 --- a/gdb/testsuite/gdb.arch/e500-regs.exp +++ b/gdb/testsuite/gdb.arch/e500-regs.exp @@ -136,10 +136,7 @@ gdb_expect_list "info vector" ".*$gdb_prompt $" { # We must restart everything, because we have set important registers to # some unusual values. -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir -gdb_load ${binfile} +clean_restart $binfile if {![runto_main]} { return 0 } diff --git a/gdb/testsuite/gdb.arch/gdb1291.exp b/gdb/testsuite/gdb.arch/gdb1291.exp index a81a13f..56119ab 100644 --- a/gdb/testsuite/gdb.arch/gdb1291.exp +++ b/gdb/testsuite/gdb.arch/gdb1291.exp @@ -33,10 +33,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable ""] ! return -1 } -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir -gdb_load ${binfile} +clean_restart $binfile # # Run to `main' where we begin our tests. diff --git a/gdb/testsuite/gdb.arch/gdb1431.exp b/gdb/testsuite/gdb.arch/gdb1431.exp index eee14fb..ab59aa8 100644 --- a/gdb/testsuite/gdb.arch/gdb1431.exp +++ b/gdb/testsuite/gdb.arch/gdb1431.exp @@ -35,10 +35,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable ""] ! return -1 } -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir -gdb_load ${binfile} +clean_restart $binfile # # Run to `main' where we begin our tests. diff --git a/gdb/testsuite/gdb.arch/gdb1558.exp b/gdb/testsuite/gdb.arch/gdb1558.exp index 9090f03..76ae9c9 100644 --- a/gdb/testsuite/gdb.arch/gdb1558.exp +++ b/gdb/testsuite/gdb.arch/gdb1558.exp @@ -32,10 +32,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {"add return -1 } -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir -gdb_load ${binfile} +clean_restart $binfile gdb_test "b -q main" "Breakpoint 1.*" "set breakpoint at main" gdb_test "b -q sub1" "Breakpoint 2.*" "set breakpoint at sub1" diff --git a/gdb/testsuite/gdb.arch/i386-bp_permanent.exp b/gdb/testsuite/gdb.arch/i386-bp_permanent.exp index d75ea64..c56f313 100644 --- a/gdb/testsuite/gdb.arch/i386-bp_permanent.exp +++ b/gdb/testsuite/gdb.arch/i386-bp_permanent.exp @@ -33,10 +33,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list } -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir -gdb_load ${binfile} +clean_restart $binfile # # Run to `main' where we begin our tests. diff --git a/gdb/testsuite/gdb.arch/i386-gnu-cfi.exp b/gdb/testsuite/gdb.arch/i386-gnu-cfi.exp index 56a4eee..d34bc81 100644 --- a/gdb/testsuite/gdb.arch/i386-gnu-cfi.exp +++ b/gdb/testsuite/gdb.arch/i386-gnu-cfi.exp @@ -40,10 +40,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfilec} ${srcdir}/${subdir}/${srcfile # Get things started. -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir -gdb_load ${binfile} +clean_restart $binfile # We should stop in abort(3). diff --git a/gdb/testsuite/gdb.arch/i386-prologue.exp b/gdb/testsuite/gdb.arch/i386-prologue.exp index 8e24b87..d5fa442 100644 --- a/gdb/testsuite/gdb.arch/i386-prologue.exp +++ b/gdb/testsuite/gdb.arch/i386-prologue.exp @@ -53,10 +53,7 @@ proc skip_breakpoint { msg } { } -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir -gdb_load ${binfile} +clean_restart $binfile # # Run to `main' where we begin our tests. diff --git a/gdb/testsuite/gdb.arch/i386-signal.exp b/gdb/testsuite/gdb.arch/i386-signal.exp index 17c6467..f6a8871 100644 --- a/gdb/testsuite/gdb.arch/i386-signal.exp +++ b/gdb/testsuite/gdb.arch/i386-signal.exp @@ -25,10 +25,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" \ return -1 } -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir -gdb_load ${binfile} +clean_restart $binfile runto func gdb_test "backtrace 10" \ diff --git a/gdb/testsuite/gdb.arch/i386-size-overlap.exp b/gdb/testsuite/gdb.arch/i386-size-overlap.exp index a5517b8..8da15f2 100644 --- a/gdb/testsuite/gdb.arch/i386-size-overlap.exp +++ b/gdb/testsuite/gdb.arch/i386-size-overlap.exp @@ -30,10 +30,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" \ return -1 } -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir -gdb_load ${binfile} +clean_restart $binfile # We use gdb_run_cmd so this stands a chance to work for remote # targets too. diff --git a/gdb/testsuite/gdb.arch/i386-size.exp b/gdb/testsuite/gdb.arch/i386-size.exp index 0b616f6..89679f2 100644 --- a/gdb/testsuite/gdb.arch/i386-size.exp +++ b/gdb/testsuite/gdb.arch/i386-size.exp @@ -35,10 +35,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" \ return -1 } -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir -gdb_load ${binfile} +clean_restart $binfile # We use gdb_run_cmd so this stands a chance to work for remote # targets too. diff --git a/gdb/testsuite/gdb.arch/i386-unwind.exp b/gdb/testsuite/gdb.arch/i386-unwind.exp index 04ef771..bdcf3da 100644 --- a/gdb/testsuite/gdb.arch/i386-unwind.exp +++ b/gdb/testsuite/gdb.arch/i386-unwind.exp @@ -33,10 +33,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list return -1 } -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir -gdb_load ${binfile} +clean_restart $binfile # Testcase for backtrace/1435. diff --git a/gdb/testsuite/gdb.arch/ia64-breakpoint-shadow.exp b/gdb/testsuite/gdb.arch/ia64-breakpoint-shadow.exp index e9f98d0..f5f8282 100644 --- a/gdb/testsuite/gdb.arch/ia64-breakpoint-shadow.exp +++ b/gdb/testsuite/gdb.arch/ia64-breakpoint-shadow.exp @@ -23,10 +23,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb return -1 } -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir -gdb_load ${binfile} +clean_restart $binfile # We need to start the inferior to place the breakpoints in the memory at all. if ![runto_main] { diff --git a/gdb/testsuite/gdb.arch/mips-octeon-bbit.exp b/gdb/testsuite/gdb.arch/mips-octeon-bbit.exp index 2b00fe1..40cd029 100644 --- a/gdb/testsuite/gdb.arch/mips-octeon-bbit.exp +++ b/gdb/testsuite/gdb.arch/mips-octeon-bbit.exp @@ -86,10 +86,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable \ pass "compilation" -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir -gdb_load ${binfile} +clean_restart $binfile # Native needs run. runto_main diff --git a/gdb/testsuite/gdb.arch/pa-nullify.exp b/gdb/testsuite/gdb.arch/pa-nullify.exp index 285047c..577bfbd 100644 --- a/gdb/testsuite/gdb.arch/pa-nullify.exp +++ b/gdb/testsuite/gdb.arch/pa-nullify.exp @@ -40,10 +40,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {}] ! return -1 } -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir -gdb_load ${binfile} +clean_restart $binfile # In the first test, we do a "step" on a function whose last instruction # contains a branch-with-nullify. The instruction in the delay slot belongs diff --git a/gdb/testsuite/gdb.arch/powerpc-aix-prologue.exp b/gdb/testsuite/gdb.arch/powerpc-aix-prologue.exp index 8179c03..17bd078 100644 --- a/gdb/testsuite/gdb.arch/powerpc-aix-prologue.exp +++ b/gdb/testsuite/gdb.arch/powerpc-aix-prologue.exp @@ -28,10 +28,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {}] ! return -1 } -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir -gdb_load ${binfile} +clean_restart $binfile # Insert a breakpoint in FUNCTION and verifies that the breakpoint was # inserted at the expected location. EXPECTED_LOCATION should be an diff --git a/gdb/testsuite/gdb.arch/powerpc-d128-regs.exp b/gdb/testsuite/gdb.arch/powerpc-d128-regs.exp index 72ce231..a4faa2d 100644 --- a/gdb/testsuite/gdb.arch/powerpc-d128-regs.exp +++ b/gdb/testsuite/gdb.arch/powerpc-d128-regs.exp @@ -29,12 +29,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {qui return -1 } -# Start with a fresh gdb. - -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir -gdb_load ${binfile} +clean_restart $binfile if {![runto_main]} { return diff --git a/gdb/testsuite/gdb.arch/powerpc-prologue.exp b/gdb/testsuite/gdb.arch/powerpc-prologue.exp index edc7116..f5b2ab6 100644 --- a/gdb/testsuite/gdb.arch/powerpc-prologue.exp +++ b/gdb/testsuite/gdb.arch/powerpc-prologue.exp @@ -31,10 +31,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {}] ! } -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir -gdb_load ${binfile} +clean_restart $binfile # # Run to `main' where we begin our tests. diff --git a/gdb/testsuite/gdb.arch/ppc-dfp.exp b/gdb/testsuite/gdb.arch/ppc-dfp.exp index eca44a6..25269ba 100644 --- a/gdb/testsuite/gdb.arch/ppc-dfp.exp +++ b/gdb/testsuite/gdb.arch/ppc-dfp.exp @@ -31,12 +31,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {quie return -1 } -# Start with a fresh gdb. - -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir -gdb_load ${binfile} +clean_restart $binfile gdb_breakpoint [gdb_get_line_number "Set DFP rounding mode."] diff --git a/gdb/testsuite/gdb.arch/ppc-fp.exp b/gdb/testsuite/gdb.arch/ppc-fp.exp index db7ea12..7307394 100644 --- a/gdb/testsuite/gdb.arch/ppc-fp.exp +++ b/gdb/testsuite/gdb.arch/ppc-fp.exp @@ -31,12 +31,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {quie return -1 } -# Start with a fresh gdb. - -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir -gdb_load ${binfile} +clean_restart $binfile gdb_breakpoint [gdb_get_line_number "Invalid operation."] gdb_breakpoint [gdb_get_line_number "Division by zero."] diff --git a/gdb/testsuite/gdb.arch/pr25124.exp b/gdb/testsuite/gdb.arch/pr25124.exp index 4503377..4b6dbfd 100644 --- a/gdb/testsuite/gdb.arch/pr25124.exp +++ b/gdb/testsuite/gdb.arch/pr25124.exp @@ -25,12 +25,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable debug return -1 } -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir - -# Load the symbol file the first time. -gdb_load ${binfile} +clean_restart $binfile # Check if the disassemble ouput is correct. gdb_test "x /i main+8" \ diff --git a/gdb/testsuite/gdb.arch/s390-multiarch.exp b/gdb/testsuite/gdb.arch/s390-multiarch.exp index 4256d30..68f339c 100644 --- a/gdb/testsuite/gdb.arch/s390-multiarch.exp +++ b/gdb/testsuite/gdb.arch/s390-multiarch.exp @@ -28,8 +28,6 @@ require isnative {istarget s390x-*-*} standard_testfile set binprefix $binfile -gdb_exit - proc compile_and_dump {variant ccopts binfile} { global srcdir subdir srcfile set compile_flags {debug} @@ -136,8 +134,7 @@ if { $core31 != "" } { remote_exec host "$binfile ${core31}.2 ${core31}.3 774" } -gdb_start -gdb_reinitialize_dir $srcdir/$subdir +clean_restart if { $core64 != "" } { test_all_core64 $core64 "no exec" diff --git a/gdb/testsuite/gdb.arch/thumb-prologue.exp b/gdb/testsuite/gdb.arch/thumb-prologue.exp index 1d74a30..a33a59b 100644 --- a/gdb/testsuite/gdb.arch/thumb-prologue.exp +++ b/gdb/testsuite/gdb.arch/thumb-prologue.exp @@ -27,10 +27,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {"add } -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir -gdb_load ${binfile} +clean_restart $binfile # # Run to `main' where we begin our tests. diff --git a/gdb/testsuite/gdb.arch/thumb2-it.exp b/gdb/testsuite/gdb.arch/thumb2-it.exp index 0247186..5ea2963 100644 --- a/gdb/testsuite/gdb.arch/thumb2-it.exp +++ b/gdb/testsuite/gdb.arch/thumb2-it.exp @@ -24,10 +24,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable debug return -1 } -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir -gdb_load ${binfile} +clean_restart $binfile if {![runto_main]} { return -1 diff --git a/gdb/testsuite/gdb.arch/vsx-regs.exp b/gdb/testsuite/gdb.arch/vsx-regs.exp index 2b72a01..ccb4ee3 100644 --- a/gdb/testsuite/gdb.arch/vsx-regs.exp +++ b/gdb/testsuite/gdb.arch/vsx-regs.exp @@ -184,10 +184,7 @@ if {!$core_supported} { return -1 } -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir -gdb_load ${binfile} +clean_restart $binfile set core_loaded [gdb_core_cmd "$corefile" "re-load generated corefile"] if { $core_loaded == -1 } { |