public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] gdb/testsuite: Remove duplicates from gdb.base/shlib-call.exp
@ 2022-01-07 22:46 Lancelot SIX
  0 siblings, 0 replies; only message in thread
From: Lancelot SIX @ 2022-01-07 22:46 UTC (permalink / raw)
  To: gdb-cvs

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=5bdd79dff95269a7bf6428c449c1cfd5eab0c3ae

commit 5bdd79dff95269a7bf6428c449c1cfd5eab0c3ae
Author: Lancelot SIX <lsix@lancelotsix.com>
Date:   Sun Nov 21 01:33:13 2021 +0000

    gdb/testsuite: Remove duplicates from gdb.base/shlib-call.exp
    
    When I run the testsuite, I have:
    
        Running .../gdb/testsuite/gdb.base/shlib-call.exp ...
        DUPLICATE: gdb.base/shlib-call.exp: print g
        DUPLICATE: gdb.base/shlib-call.exp: set print sevenbit-strings
        DUPLICATE: gdb.base/shlib-call.exp: set print address off
        DUPLICATE: gdb.base/shlib-call.exp: set width 0
        DUPLICATE: gdb.base/shlib-call.exp: continue until exit
    
    Fix by adjusting the test names when required, and by removing
    un-necessary commands.
    
    While at it, do some cleanup:
    - Replace an explicit GDB restart sequence with a call to clean_restart.
    - Remove trailing whitespaces.
    - Use $gdb_test_name in gdb_test_multiple.
    
    Tested on x86_64-linux.

Diff:
---
 gdb/testsuite/gdb.base/shlib-call.exp | 25 +++++++------------------
 1 file changed, 7 insertions(+), 18 deletions(-)

diff --git a/gdb/testsuite/gdb.base/shlib-call.exp b/gdb/testsuite/gdb.base/shlib-call.exp
index 699d912fbf0..6c766e148de 100644
--- a/gdb/testsuite/gdb.base/shlib-call.exp
+++ b/gdb/testsuite/gdb.base/shlib-call.exp
@@ -60,10 +60,6 @@ clean_restart ${binfile}
 gdb_load_shlib $lib1
 gdb_load_shlib $lib2
 
-gdb_test_no_output "set print sevenbit-strings"
-gdb_test_no_output "set print address off"
-gdb_test_no_output "set width 0"
-
 
 if ![runto_main] then {
         perror "C function calling tests suppressed"
@@ -90,7 +86,7 @@ if ![gdb_skip_stdio_test "next over shr1"] {
 
 
 #print g
-gdb_test "print g" "\[0-9\]* = 2"
+gdb_test "print g" "\[0-9\]* = 2" "print g two"
 
 #print shr1(1)
 if ![gdb_skip_stdio_test "print shr1(1)"] {
@@ -137,7 +133,7 @@ gdb_test "print mainshr1(1)" "\[0-9\]* = 2" \
 # behavior will differ depending upon upon whether or not
 # the compiler emits line number information for the epilogue.
 gdb_test_multiple "step" "step out of shr2 to main" {
-    -re "main \\(\\) at.*g = mainshr1\\(g\\);.*$gdb_prompt $" { 
+    -re "main \\(\\) at.*g = mainshr1\\(g\\);.*$gdb_prompt $" {
 	pass "step out of shr2 to main"
     }
     -re ".*\\\}.*$gdb_prompt $" {
@@ -152,7 +148,7 @@ gdb_test_multiple "step" "step out of shr2 to main" {
 	}
     }
 }
-    
+
 #print mainshr1(1)
 gdb_test "print mainshr1(1)" "\[0-9\]* = 2"
 
@@ -162,14 +158,7 @@ gdb_test "step" "mainshr1 \\(g=4\\) at.*return 2.g;" \
 
 # Start with a fresh gdb.
 
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-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"
-
+clean_restart $binfile
 
 # PR's 16495, 18213
 # test that we can re-set breakpoints in shared libraries
@@ -179,7 +168,7 @@ set test "run to bp in shared library"
 gdb_run_cmd
 gdb_test_multiple "" $test {
     -re "Breakpoint .,.*${gdb_prompt} " {
-	pass $test
+	pass $gdb_test_name
     }
 }
 
@@ -189,8 +178,8 @@ set test "re-run to bp in shared library (PR's 16495, 18213)"
 gdb_run_cmd
 gdb_test_multiple "" $test {
     -re "Breakpoint .,.*${gdb_prompt} " {
-	pass $test
+	pass $gdb_test_name
     }
 }
 
-gdb_continue_to_end "" continue 1
+gdb_continue_to_end "after re-run" continue 1


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-01-07 22:46 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-07 22:46 [binutils-gdb] gdb/testsuite: Remove duplicates from gdb.base/shlib-call.exp Lancelot SIX

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).