From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2126) id 788333858D20; Fri, 27 Jan 2023 01:30:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 788333858D20 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1674783006; bh=YpI2cOMQmH7+mN+796uwFy/hyLOudM4Yfn2hlULDuhk=; h=From:To:Subject:Date:From; b=wHLg7sdxIl+tp6i18RM/vxJ9uJFIXdqU6JB1OC6U2sHSrUqGm0FWMrMjOYvdEF/cp gxsF9UrP0QEuFKD/TOPkGeebMR/UbcJ8iyK8azYTOVkLwi4q5nCRCFIuKMe4K9RnFT XZWa3HLYVM88/HZDrT096yTtEfQlGJyQZ8pn7Mpg= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Tom Tromey To: gdb-cvs@sourceware.org Subject: [binutils-gdb] Use clean_restart in gdb.arch X-Act-Checkin: binutils-gdb X-Git-Author: Tom Tromey X-Git-Refname: refs/heads/master X-Git-Oldrev: 888438e2b4146f9b1021ea240f78f04975a9d925 X-Git-Newrev: 6dbbae3b67883fe33c3010557b2cb16d1e4c278a Message-Id: <20230127013006.788333858D20@sourceware.org> Date: Fri, 27 Jan 2023 01:30:06 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D6dbbae3b6788= 3fe33c3010557b2cb16d1e4c278a commit 6dbbae3b67883fe33c3010557b2cb16d1e4c278a Author: Tom Tromey Date: Wed Jan 25 10:44:25 2023 -0700 Use clean_restart in gdb.arch =20 Change gdb.arch to use clean_restart more consistently. Diff: --- gdb/testsuite/gdb.arch/alpha-step.exp | 5 +---- gdb/testsuite/gdb.arch/altivec-abi.exp | 5 +---- gdb/testsuite/gdb.arch/e500-prologue.exp | 5 +---- gdb/testsuite/gdb.arch/e500-regs.exp | 5 +---- gdb/testsuite/gdb.arch/gdb1291.exp | 5 +---- gdb/testsuite/gdb.arch/gdb1431.exp | 5 +---- gdb/testsuite/gdb.arch/gdb1558.exp | 5 +---- gdb/testsuite/gdb.arch/i386-bp_permanent.exp | 5 +---- gdb/testsuite/gdb.arch/i386-gnu-cfi.exp | 5 +---- gdb/testsuite/gdb.arch/i386-prologue.exp | 5 +---- gdb/testsuite/gdb.arch/i386-signal.exp | 5 +---- gdb/testsuite/gdb.arch/i386-size-overlap.exp | 5 +---- gdb/testsuite/gdb.arch/i386-size.exp | 5 +---- gdb/testsuite/gdb.arch/i386-unwind.exp | 5 +---- gdb/testsuite/gdb.arch/ia64-breakpoint-shadow.exp | 5 +---- gdb/testsuite/gdb.arch/mips-octeon-bbit.exp | 5 +---- gdb/testsuite/gdb.arch/pa-nullify.exp | 5 +---- gdb/testsuite/gdb.arch/powerpc-aix-prologue.exp | 5 +---- gdb/testsuite/gdb.arch/powerpc-d128-regs.exp | 7 +------ gdb/testsuite/gdb.arch/powerpc-prologue.exp | 5 +---- gdb/testsuite/gdb.arch/ppc-dfp.exp | 7 +------ gdb/testsuite/gdb.arch/ppc-fp.exp | 7 +------ gdb/testsuite/gdb.arch/pr25124.exp | 7 +------ gdb/testsuite/gdb.arch/s390-multiarch.exp | 5 +---- gdb/testsuite/gdb.arch/thumb-prologue.exp | 5 +---- gdb/testsuite/gdb.arch/thumb2-it.exp | 5 +---- gdb/testsuite/gdb.arch/vsx-regs.exp | 5 +---- 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 07b4c3912d9..f17210ba5d6 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}" "${bi= nfile}" executable {}] ! return -1 } =20 -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir -gdb_load ${binfile} +clean_restart $binfile =20 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.arc= h/altivec-abi.exp index b04858950e8..8417c8828e7 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 } { } } =20 - gdb_exit - gdb_start - gdb_reinitialize_dir $srcdir/$subdir - gdb_load ${binfile} + clean_restart $binfile =20 # 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.a= rch/e500-prologue.exp index 7c32d9dd5b0..82898d98aa9 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}" "${bi= nfile}" executable {}] ! return -1 } =20 -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir -gdb_load ${binfile} +clean_restart $binfile =20 # 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 615b745d251..ac196ff4722 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. =20 -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/gd= b1291.exp index a81a13ff151..56119ab1e29 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}" "${bi= nfile}" executable ""] ! return -1 } =20 -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir -gdb_load ${binfile} +clean_restart $binfile =20 # # Run to `main' where we begin our tests. diff --git a/gdb/testsuite/gdb.arch/gdb1431.exp b/gdb/testsuite/gdb.arch/gd= b1431.exp index eee14fb3025..ab59aa87522 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}" "${bi= nfile}" executable ""] ! return -1 } =20 -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir -gdb_load ${binfile} +clean_restart $binfile =20 # # Run to `main' where we begin our tests. diff --git a/gdb/testsuite/gdb.arch/gdb1558.exp b/gdb/testsuite/gdb.arch/gd= b1558.exp index 9090f03d6d9..76ae9c9a0a3 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}" "${bi= nfile}" executable {"add return -1 } =20 -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir -gdb_load ${binfile} +clean_restart $binfile =20 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/g= db.arch/i386-bp_permanent.exp index d75ea648148..c56f31366c5 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}" "${bi= nfile}" executable [list } =20 =20 -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir -gdb_load ${binfile} +clean_restart $binfile =20 # # Run to `main' where we begin our tests. diff --git a/gdb/testsuite/gdb.arch/i386-gnu-cfi.exp b/gdb/testsuite/gdb.ar= ch/i386-gnu-cfi.exp index 56a4eee32a6..d34bc81a299 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} ${src= dir}/${subdir}/${srcfile =20 # Get things started. =20 -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir -gdb_load ${binfile} +clean_restart $binfile =20 # We should stop in abort(3). =20 diff --git a/gdb/testsuite/gdb.arch/i386-prologue.exp b/gdb/testsuite/gdb.a= rch/i386-prologue.exp index 8e24b879fd1..d5fa4421dbe 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 } { } =20 =20 -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir -gdb_load ${binfile} +clean_restart $binfile =20 # # Run to `main' where we begin our tests. diff --git a/gdb/testsuite/gdb.arch/i386-signal.exp b/gdb/testsuite/gdb.arc= h/i386-signal.exp index 17c6467076c..f6a88719a40 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}" "${bi= nfile}" \ return -1 } =20 -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir -gdb_load ${binfile} +clean_restart $binfile =20 runto func gdb_test "backtrace 10" \ diff --git a/gdb/testsuite/gdb.arch/i386-size-overlap.exp b/gdb/testsuite/g= db.arch/i386-size-overlap.exp index a5517b836f3..8da15f25c18 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}" "${bi= nfile}" \ return -1 } =20 -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir -gdb_load ${binfile} +clean_restart $binfile =20 # 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 0b616f68893..89679f217ae 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}" "${bi= nfile}" \ return -1 } =20 -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir -gdb_load ${binfile} +clean_restart $binfile =20 # 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.arc= h/i386-unwind.exp index 04ef77132eb..bdcf3da9b94 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}" "${bi= nfile}" executable [list return -1 } =20 -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir -gdb_load ${binfile} +clean_restart $binfile =20 # Testcase for backtrace/1435. =20 diff --git a/gdb/testsuite/gdb.arch/ia64-breakpoint-shadow.exp b/gdb/testsu= ite/gdb.arch/ia64-breakpoint-shadow.exp index e9f98d0eb9e..f5f8282dc68 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}" "${b= infile}" executable {deb return -1 } =20 -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir -gdb_load ${binfile} +clean_restart $binfile =20 # 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/gd= b.arch/mips-octeon-bbit.exp index 2b00fe14ce0..40cd02946c2 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}" "${b= infile}" executable \ =20 pass "compilation" =20 -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir -gdb_load ${binfile} +clean_restart $binfile # Native needs run. runto_main =20 diff --git a/gdb/testsuite/gdb.arch/pa-nullify.exp b/gdb/testsuite/gdb.arch= /pa-nullify.exp index 285047cc95f..577bfbde6f9 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}" "${bi= nfile}" executable {}] ! return -1 } =20 -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir -gdb_load ${binfile} +clean_restart $binfile =20 # In the first test, we do a "step" on a function whose last instruction=20 # contains a branch-with-nullify. The instruction in the delay slot belon= gs diff --git a/gdb/testsuite/gdb.arch/powerpc-aix-prologue.exp b/gdb/testsuit= e/gdb.arch/powerpc-aix-prologue.exp index 8179c03f2f1..17bd0787a6c 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}" "${bi= nfile}" executable {}] ! return -1 } =20 -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir -gdb_load ${binfile} +clean_restart $binfile =20 # 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/g= db.arch/powerpc-d128-regs.exp index 72ce2316b16..a4faa2d13dc 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}" "${b= infile}" executable {qui return -1 } =20 -# Start with a fresh gdb. - -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir -gdb_load ${binfile} +clean_restart $binfile =20 if {![runto_main]} { return diff --git a/gdb/testsuite/gdb.arch/powerpc-prologue.exp b/gdb/testsuite/gd= b.arch/powerpc-prologue.exp index edc7116754a..f5b2ab6e102 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}" "${bi= nfile}" executable {}] ! } =20 =20 -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir -gdb_load ${binfile} +clean_restart $binfile =20 # # Run to `main' where we begin our tests. diff --git a/gdb/testsuite/gdb.arch/ppc-dfp.exp b/gdb/testsuite/gdb.arch/pp= c-dfp.exp index eca44a683e4..25269ba4a2b 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}" "${bi= nfile}" executable {quie return -1 } =20 -# Start with a fresh gdb. - -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir -gdb_load ${binfile} +clean_restart $binfile =20 gdb_breakpoint [gdb_get_line_number "Set DFP rounding mode."] =20 diff --git a/gdb/testsuite/gdb.arch/ppc-fp.exp b/gdb/testsuite/gdb.arch/ppc= -fp.exp index db7ea1202d5..73073940947 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}" "${bi= nfile}" executable {quie return -1 } =20 -# Start with a fresh gdb. - -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir -gdb_load ${binfile} +clean_restart $binfile =20 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/pr= 25124.exp index 45033771d79..4b6dbfd86a2 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}" "${bi= nfile}" executable debug return -1 } =20 -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir - -# Load the symbol file the first time. -gdb_load ${binfile} +clean_restart $binfile =20 # 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 4256d30b0b9..68f339cc283 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 =20 -gdb_exit - proc compile_and_dump {variant ccopts binfile} { global srcdir subdir srcfile set compile_flags {debug} @@ -136,8 +134,7 @@ if { $core31 !=3D "" } { remote_exec host "$binfile ${core31}.2 ${core31}.3 774" } =20 -gdb_start -gdb_reinitialize_dir $srcdir/$subdir +clean_restart =20 if { $core64 !=3D "" } { 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 1d74a30905a..a33a59b1e6f 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}" "${bi= nfile}" executable {"add } =20 =20 -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir -gdb_load ${binfile} +clean_restart $binfile =20 # # 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 024718677de..5ea2963dbf7 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}" "${bi= nfile}" executable debug return -1 } =20 -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir -gdb_load ${binfile} +clean_restart $binfile =20 if {![runto_main]} { return -1 diff --git a/gdb/testsuite/gdb.arch/vsx-regs.exp b/gdb/testsuite/gdb.arch/v= sx-regs.exp index 2b72a012ef9..ccb4ee3df9d 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 } =20 -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir -gdb_load ${binfile} +clean_restart $binfile =20 set core_loaded [gdb_core_cmd "$corefile" "re-load generated corefile"] if { $core_loaded =3D=3D -1 } {