From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1551) id AEE38385840C; Tue, 17 May 2022 10:15:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AEE38385840C Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Pedro Alves To: gdb-cvs@sourceware.org Subject: [binutils-gdb] gdb.base/scope.exp: Remove bogus gdb_test questions X-Act-Checkin: binutils-gdb X-Git-Author: Pedro Alves X-Git-Refname: refs/heads/master X-Git-Oldrev: bc6004dfd2654e53d6f167b985b38ca780e79228 X-Git-Newrev: 35b72e4e5baabef35b34db7f12c627e7232ee204 Message-Id: <20220517101504.AEE38385840C@sourceware.org> Date: Tue, 17 May 2022 10:15:04 +0000 (GMT) X-BeenThere: gdb-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2022 10:15:04 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D35b72e4e5baa= bef35b34db7f12c627e7232ee204 commit 35b72e4e5baabef35b34db7f12c627e7232ee204 Author: Pedro Alves Date: Wed Mar 30 14:31:56 2022 +0100 gdb.base/scope.exp: Remove bogus gdb_test questions =20 This test is abusing the QUESTION/RESPONSE feature to send an alternative command to GDB if the first command fails. Like so: =20 gdb_test "print 'scope0.c'::filelocal" \ "\\\$$decimal =3D 1" "print 'scope0.c'::filelocal at main" \ "No symbol \"scope0.c\" in current context.*" \ "print '$srcdir/$subdir/scope0.c'::filelocal" =20 So if 'scope0.c' doesn't work, we try again with '$srcdir/$subdir/scope0.c'. I strongly suspect this is really an obsolete test. I think that if '$srcdir/$subdir/scope0.c' works, then 'scope0.c' should have worked too, thus I'd think that if we pass due to the question path, then it's a bug. So just remove the question part passed to gdb_test. =20 Change-Id: I2acc99285f1d519284051b49693b5441fbdfe3cd Diff: --- gdb/testsuite/gdb.base/scope.exp | 60 ++++++++++++++++++++----------------= ---- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/gdb/testsuite/gdb.base/scope.exp b/gdb/testsuite/gdb.base/scop= e.exp index 19a85bcd244..a8ddb61350a 100644 --- a/gdb/testsuite/gdb.base/scope.exp +++ b/gdb/testsuite/gdb.base/scope.exp @@ -49,11 +49,11 @@ proc_with_prefix test_at_main {} { =20 # Print scope0.c::filelocal, which is 1 gdb_test "print filelocal" "\\\$$decimal =3D 1" - gdb_test "print 'scope0.c'::filelocal" "\\\$$decimal =3D 1" "print 'sc= ope0.c'::filelocal at main" "No symbol \"scope0.c\" in current context.*" = "print '$srcdir/$subdir/scope0.c'::filelocal" + gdb_test "print 'scope0.c'::filelocal" "\\\$$decimal =3D 1" "print 'sc= ope0.c'::filelocal at main" =20 # Print scope0.c::filelocal_bss, which is 101 gdb_test "print filelocal_bss" "\\\$$decimal =3D 101" - gdb_test "print 'scope0.c'::filelocal_bss" "\\\$$decimal =3D 101" "pri= nt 'scope0.c'::filelocal_bss in test_at_main" "No symbol \"scope0.c\" in c= urrent context.*" "print '$srcdir/$subdir/scope0.c'::filelocal_bss" + gdb_test "print 'scope0.c'::filelocal_bss" "\\\$$decimal =3D 101" "pri= nt 'scope0.c'::filelocal_bss in test_at_main" =20 # Print scope0.c::filelocal_ro, which is 201 =20 @@ -62,37 +62,37 @@ proc_with_prefix test_at_main {} { gdb_test "print filelocal_ro" "\\\$$decimal =3D 201" "print filelocal_= ro in test_at_main" =20 if { [test_compiler_info gcc-*-*] } then { setup_xfail "rs6000-*-*" } - gdb_test "print 'scope0.c'::filelocal_ro" "\\\$$decimal =3D 201" "prin= t 'scope0.c'::filelocal_ro" "No symbol \"scope0.c\" in current context.*" = "print '$srcdir/$subdir/scope0.c'::filelocal_ro" + gdb_test "print 'scope0.c'::filelocal_ro" "\\\$$decimal =3D 201" "prin= t 'scope0.c'::filelocal_ro" =20 # Print scope1.c::filelocal, which is 2 if { [test_compiler_info gcc-*-*] } then { setup_xfail "rs6000-*-*" } - gdb_test "print 'scope1.c'::filelocal" "\\\$$decimal =3D 2" "print 'sc= ope1.c'::filelocal" "No symbol \"scope1.c\" in current context.*" "print '= $srcdir/$subdir/scope1.c'::filelocal" + gdb_test "print 'scope1.c'::filelocal" "\\\$$decimal =3D 2" "print 'sc= ope1.c'::filelocal" =20 # Print scope1.c::filelocal_bss, which is 102 if { [test_compiler_info gcc-*-*] } then { setup_xfail "rs6000-*-*" } - gdb_test "print 'scope1.c'::filelocal_bss" "\\\$$decimal =3D 102" "pri= nt 'scope1.c'::filelocal_bss" "No symbol \"scope1.c\" in current context.*= " "print '$srcdir/$subdir/scope1.c'::filelocal_bss" + gdb_test "print 'scope1.c'::filelocal_bss" "\\\$$decimal =3D 102" "pri= nt 'scope1.c'::filelocal_bss" =20 # Print scope1.c::filelocal_ro, which is 202 if { [test_compiler_info gcc-*-*] } then { setup_xfail "rs6000-*-*" } - gdb_test "print 'scope1.c'::filelocal_ro" "\\\$$decimal =3D 202" "prin= t 'scope1.c'::filelocal_ro" "No symbol \"scope1.c\" in current context.*" = "print '$srcdir/$subdir/scope1.c'::filelocal_ro" + gdb_test "print 'scope1.c'::filelocal_ro" "\\\$$decimal =3D 202" "prin= t 'scope1.c'::filelocal_ro" =20 # Print scope1.c::foo::funclocal, which is 3 gdb_test "print foo::funclocal" "\\\$$decimal =3D 3" =20 if { [test_compiler_info gcc-*-*] } then { setup_xfail "rs6000-*-*" } - gdb_test "print 'scope1.c'::foo::funclocal" "\\\$$decimal =3D 3" "prin= t 'scope1.c'::foo::funclocal" "No symbol \"scope1.c\" in current context.*= " "print '$srcdir/$subdir/scope1.c'::foo::funclocal" + gdb_test "print 'scope1.c'::foo::funclocal" "\\\$$decimal =3D 3" "prin= t 'scope1.c'::foo::funclocal" =20 # Print scope1.c::foo::funclocal_ro, which is 203 gdb_test "print foo::funclocal_ro" "\\\$$decimal =3D 203" =20 if { [test_compiler_info gcc-*-*] } then { setup_xfail "rs6000-*-*" } - gdb_test "print 'scope1.c'::foo::funclocal_ro" "\\\$$decimal =3D 203" = "print 'scope1.c'::foo::funclocal_ro" "No symbol \"scope1.c\" in current c= ontext.*" "print '$srcdir/$subdir/scope1.c'::foo::funclocal_ro" + gdb_test "print 'scope1.c'::foo::funclocal_ro" "\\\$$decimal =3D 203" = "print 'scope1.c'::foo::funclocal_ro" =20 # Print scope1.c::bar::funclocal, which is 4 gdb_test "print bar::funclocal" "\\\$$decimal =3D 4" =20 if { [test_compiler_info gcc-*-*] } then { setup_xfail "rs6000-*-*" } - gdb_test "print 'scope1.c'::bar::funclocal" "\\\$$decimal =3D 4" "prin= t 'scope1.c'::bar::funclocal" "No symbol \"scope1.c\" in current context.*= " "print '$srcdir/$subdir/scope1.c'::bar::funclocal" + gdb_test "print 'scope1.c'::bar::funclocal" "\\\$$decimal =3D 4" "prin= t 'scope1.c'::bar::funclocal" } =20 proc_with_prefix test_at_foo {} { @@ -105,34 +105,34 @@ proc_with_prefix test_at_foo {} { gdb_test "next" ".*bar \\(\\);" =20 # Print scope0.c::filelocal, which is 1 - gdb_test "print 'scope0.c'::filelocal" "\\\$$decimal =3D 1" "print 'sc= ope0.c'::filelocal at foo" "No symbol \"scope0.c\" in current context.*" "= print '$srcdir/$subdir/scope0.c'::filelocal" + gdb_test "print 'scope0.c'::filelocal" "\\\$$decimal =3D 1" "print 'sc= ope0.c'::filelocal at foo" =20 # Print scope0.c::filelocal_bss, which is 101 - gdb_test "print 'scope0.c'::filelocal_bss" "\\\$$decimal =3D 101" "pri= nt 'scope0.c'::filelocal_bss in test_at_foo" "No symbol \"scope0.c\" in cu= rrent context.*" "print '$srcdir/$subdir/scope0.c'::filelocal_bss" + gdb_test "print 'scope0.c'::filelocal_bss" "\\\$$decimal =3D 101" "pri= nt 'scope0.c'::filelocal_bss in test_at_foo" =20 # Print scope0.c::filelocal_ro, which is 201 if { [test_compiler_info gcc-*-*] } then { setup_xfail "rs6000-*-*" } - gdb_test "print 'scope0.c'::filelocal_ro" "\\\$$decimal =3D 201" "prin= t 'scope0.c'::filelocal_ro" "No symbol \"scope0.c\" in current context.*" = "print '$srcdir/$subdir/scope0.c'::filelocal_ro" + gdb_test "print 'scope0.c'::filelocal_ro" "\\\$$decimal =3D 201" "prin= t 'scope0.c'::filelocal_ro" =20 =20 # Print scope1.c::filelocal, which is 2 gdb_test "print filelocal" "\\\$$decimal =3D 2" "print filelocal at fo= o" =20 if { [test_compiler_info gcc-*-*] } then { setup_xfail "rs6000-*-*" } - gdb_test "print 'scope1.c'::filelocal" "\\\$$decimal =3D 2" "print 'sc= ope1.c'::filelocal at foo" "No symbol \"scope1.c\" in current context.*" "= print '$srcdir/$subdir/scope1.c'::filelocal" + gdb_test "print 'scope1.c'::filelocal" "\\\$$decimal =3D 2" "print 'sc= ope1.c'::filelocal at foo" =20 gdb_test "print filelocal_bss" "\\\$$decimal =3D 102" \ "print filelocal_bss at foo" =20 if { [test_compiler_info gcc-*-*] } then { setup_xfail "rs6000-*-*" } - gdb_test "print 'scope1.c'::filelocal_bss" "\\\$$decimal =3D 102" "pri= nt 'scope1.c'::filelocal_bss at foo" "No symbol \"scope1.c\" in current co= ntext.*" "print '$srcdir/$subdir/scope1.c'::filelocal_bss" + gdb_test "print 'scope1.c'::filelocal_bss" "\\\$$decimal =3D 102" "pri= nt 'scope1.c'::filelocal_bss at foo" =20 =20 gdb_test "print filelocal_ro" "\\\$$decimal =3D 202" \ "print filelocal_ro at foo" =20 if { [test_compiler_info gcc-*-*] } then { setup_xfail "rs6000-*-*" } - gdb_test "print 'scope1.c'::filelocal_ro" "\\\$$decimal =3D 202" "prin= t 'scope1.c'::filelocal_ro at foo" "No symbol \"scope1.c\" in current cont= ext.*" "print '$srcdir/$subdir/scope1.c'::filelocal_ro" + gdb_test "print 'scope1.c'::filelocal_ro" "\\\$$decimal =3D 202" "prin= t 'scope1.c'::filelocal_ro at foo" =20 =20 # Print scope1.c::foo::funclocal, which is 3 @@ -143,7 +143,7 @@ proc_with_prefix test_at_foo {} { "print foo::funclocal at foo" =20 if { [test_compiler_info gcc-*-*] } then { setup_xfail "rs6000-*-*" } - gdb_test "print 'scope1.c'::foo::funclocal" "\\\$$decimal =3D 3" "prin= t 'scope1.c'::foo::funclocal at foo" "No symbol \"scope1.c\" in current co= ntext.*" "print '$srcdir/$subdir/scope1.c'::foo::funclocal" + gdb_test "print 'scope1.c'::foo::funclocal" "\\\$$decimal =3D 3" "prin= t 'scope1.c'::foo::funclocal at foo" =20 =20 # Print scope1.c::foo::funclocal_bss, which is 103 @@ -155,7 +155,7 @@ proc_with_prefix test_at_foo {} { "print foo::funclocal_bss at foo" =20 if { [test_compiler_info gcc-*-*] } then { setup_xfail "rs6000-*-*" } - gdb_test "print 'scope1.c'::foo::funclocal_bss" "\\\$$decimal =3D 103"= "print 'scope1.c'::foo::funclocal_bss at foo" "No symbol \"scope1.c\" in = current context.*" "print '$srcdir/$subdir/scope1.c'::foo::funclocal_bss" + gdb_test "print 'scope1.c'::foo::funclocal_bss" "\\\$$decimal =3D 103"= "print 'scope1.c'::foo::funclocal_bss at foo" =20 =20 # Print scope1.c::foo::funclocal_ro, which is 203 @@ -167,7 +167,7 @@ proc_with_prefix test_at_foo {} { "print foo::funclocal_ro at foo" =20 if { [test_compiler_info gcc-*-*] } then { setup_xfail "rs6000-*-*" } - gdb_test "print 'scope1.c'::foo::funclocal_ro" "\\\$$decimal =3D 203" = "print 'scope1.c'::foo::funclocal_ro at foo" "No symbol \"scope1.c\" in cu= rrent context.*" "print '$srcdir/$subdir/scope1.c'::foo::funclocal_ro" + gdb_test "print 'scope1.c'::foo::funclocal_ro" "\\\$$decimal =3D 203" = "print 'scope1.c'::foo::funclocal_ro at foo" =20 =20 # Print scope1.c::bar::funclocal, which is 4 @@ -176,7 +176,7 @@ proc_with_prefix test_at_foo {} { "print bar::funclocal at foo" =20 if { [test_compiler_info gcc-*-*] } then { setup_xfail "rs6000-*-*" } - gdb_test "print 'scope1.c'::bar::funclocal" "\\\$$decimal =3D 4" "prin= t 'scope1.c'::bar::funclocal at foo" "No symbol \"scope1.c\" in current co= ntext.*" "print '$srcdir/$subdir/scope1.c'::bar::funclocal" + gdb_test "print 'scope1.c'::bar::funclocal" "\\\$$decimal =3D 4" "prin= t 'scope1.c'::bar::funclocal at foo" =20 } =20 @@ -190,64 +190,64 @@ proc_with_prefix test_at_bar {} { gdb_test "next" =20 # Print scope0.c::filelocal, which is 1 - gdb_test "print 'scope0.c'::filelocal" "\\\$$decimal =3D 1" "print 'sc= ope0.c'::filelocal at bar" "No symbol \"scope0.c\" in current context.*" "= print '$srcdir/$subdir/scope0.c'::filelocal" + gdb_test "print 'scope0.c'::filelocal" "\\\$$decimal =3D 1" "print 'sc= ope0.c'::filelocal at bar" =20 # Print scope0.c::filelocal_bss, which is 101 - gdb_test "print 'scope0.c'::filelocal_bss" "\\\$$decimal =3D 101" "pri= nt 'scope0.c'::filelocal_bss in test_at_bar" "No symbol \"scope0.c\" in cu= rrent context.*" "print '$srcdir/$subdir/scope0.c'::filelocal_bss" + gdb_test "print 'scope0.c'::filelocal_bss" "\\\$$decimal =3D 101" "pri= nt 'scope0.c'::filelocal_bss in test_at_bar" =20 # Print scope0.c::filelocal_ro, which is 201 if { [test_compiler_info gcc-*-*] } then { setup_xfail "rs6000-*-*" } - gdb_test "print 'scope0.c'::filelocal_ro" "\\\$$decimal =3D 201" "prin= t 'scope0.c'::filelocal_ro at bar" "No symbol \"scope0.c\" in current cont= ext.*" "print '$srcdir/$subdir/scope0.c'::filelocal_ro" + gdb_test "print 'scope0.c'::filelocal_ro" "\\\$$decimal =3D 201" "prin= t 'scope0.c'::filelocal_ro at bar" =20 # Print scope1.c::filelocal, which is 2 gdb_test "print filelocal" "\\\$$decimal =3D 2" "print filelocal at ba= r" =20 if { [test_compiler_info gcc-*-*] } then { setup_xfail "rs6000-*-*" } - gdb_test "print 'scope1.c'::filelocal" "\\\$$decimal =3D 2" "print 'sc= ope1.c'::filelocal at bar" "No symbol \"scope1.c\" in current context.*" "= print '$srcdir/$subdir/scope1.c'::filelocal" + gdb_test "print 'scope1.c'::filelocal" "\\\$$decimal =3D 2" "print 'sc= ope1.c'::filelocal at bar" =20 # Print scope1.c::filelocal_bss, which is 102 gdb_test "print filelocal_bss" "\\\$$decimal =3D 102" "print filelocal= _bss at bar" =20 if { [test_compiler_info gcc-*-*] } then { setup_xfail "rs6000-*-*" } - gdb_test "print 'scope1.c'::filelocal_bss" "\\\$$decimal =3D 102" "pri= nt 'scope1.c'::filelocal_bss at bar" "No symbol \"scope1.c\" in current co= ntext.*" "print '$srcdir/$subdir/scope1.c'::filelocal_bss" + gdb_test "print 'scope1.c'::filelocal_bss" "\\\$$decimal =3D 102" "pri= nt 'scope1.c'::filelocal_bss at bar" =20 # Print scope1.c::filelocal_ro, which is 202 gdb_test "print filelocal_ro" "\\\$$decimal =3D 202" "print filelocal_= ro in test_at_bar" =20 if { [test_compiler_info gcc-*-*] } then { setup_xfail "rs6000-*-*" } - gdb_test "print 'scope1.c'::filelocal_ro" "\\\$$decimal =3D 202" "prin= t 'scope1.c'::filelocal_ro at bar" "No symbol \"scope1.c\" in current cont= ext.*" "print '$srcdir/$subdir/scope1.c'::filelocal_ro" + gdb_test "print 'scope1.c'::filelocal_ro" "\\\$$decimal =3D 202" "prin= t 'scope1.c'::filelocal_ro at bar" =20 # Print scope1.c::foo::funclocal, which is 3 gdb_test "print foo::funclocal" "\\\$$decimal =3D 3" "print foo::funcl= ocal at bar" =20 if { [test_compiler_info gcc-*-*] } then { setup_xfail "rs6000-*-*" } - gdb_test "print 'scope1.c'::foo::funclocal" "\\\$$decimal =3D 3" "prin= t 'scope1.c'::foo::funclocal at bar" "No symbol \"scope1.c\" in current co= ntext.*" "print '$srcdir/$subdir/scope1.c'::foo::funclocal" + gdb_test "print 'scope1.c'::foo::funclocal" "\\\$$decimal =3D 3" "prin= t 'scope1.c'::foo::funclocal at bar" =20 # Print scope1.c::foo::funclocal_bss, which is 103 gdb_test "print foo::funclocal_bss" "\\\$$decimal =3D 103" "print foo:= :funclocal_bss at bar" =20 if { [test_compiler_info gcc-*-*] } then { setup_xfail "rs6000-*-*" } - gdb_test "print 'scope1.c'::foo::funclocal_bss" "\\\$$decimal =3D 103"= "print 'scope1.c'::foo::funclocal_bss at bar" "No symbol \"scope1.c\" in = current context.*" "print '$srcdir/$subdir/scope1.c'::foo::funclocal_bss" + gdb_test "print 'scope1.c'::foo::funclocal_bss" "\\\$$decimal =3D 103"= "print 'scope1.c'::foo::funclocal_bss at bar" =20 # Print scope1.c::foo::funclocal_ro, which is 203 gdb_test "print foo::funclocal_ro" "\\\$$decimal =3D 203" "print foo::= funclocal_ro at bar" =20 if { [test_compiler_info gcc-*-*] } then { setup_xfail "rs6000-*-*" } - gdb_test "print 'scope1.c'::foo::funclocal_ro" "\\\$$decimal =3D 203" = "print 'scope1.c'::foo::funclocal_ro at bar" "No symbol \"scope1.c\" in cu= rrent context.*" "print '$srcdir/$subdir/scope1.c'::foo::funclocal_ro" + gdb_test "print 'scope1.c'::foo::funclocal_ro" "\\\$$decimal =3D 203" = "print 'scope1.c'::foo::funclocal_ro at bar" =20 # Print scope1.c::bar::funclocal, which is 4 gdb_test "print funclocal" "\\\$$decimal =3D 4" "print funclocal at ba= r" gdb_test "print bar::funclocal" "\\\$$decimal =3D 4" "print bar::funcl= ocal at bar" =20 if { [test_compiler_info gcc-*-*] } then { setup_xfail "rs6000-*-*" } - gdb_test "print 'scope1.c'::bar::funclocal" "\\\$$decimal =3D 4" "prin= t 'scope1.c'::bar::funclocal at bar" "No symbol \"scope1.c\" in current co= ntext.*" "print '$srcdir/$subdir/scope1.c'::bar::funclocal" + gdb_test "print 'scope1.c'::bar::funclocal" "\\\$$decimal =3D 4" "prin= t 'scope1.c'::bar::funclocal at bar" =20 # Print scope1.c::bar::funclocal_bss, which is 104 gdb_test "print funclocal_bss" "\\\$$decimal =3D 104" "print funclocal= _bss at bar" gdb_test "print bar::funclocal_bss" "\\\$$decimal =3D 104" "print bar:= :funclocal_bss at bar" =20 if { [test_compiler_info gcc-*-*] } then { setup_xfail "rs6000-*-*" } - gdb_test "print 'scope1.c'::bar::funclocal_bss" "\\\$$decimal =3D 104"= "print 'scope1.c'::bar::funclocal_bss at bar" "No symbol \"scope1.c\" in = current context.*" "print '$srcdir/$subdir/scope1.c'::bar::funclocal_bss" + gdb_test "print 'scope1.c'::bar::funclocal_bss" "\\\$$decimal =3D 104"= "print 'scope1.c'::bar::funclocal_bss at bar" } =20 # This test has little to do with local scopes, but it is in scope.exp any= way.