]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
[gdb/testsuite] Use pagination_prompt var more often
authorTom de Vries <tdevries@suse.de>
Thu, 17 Jul 2025 20:06:38 +0000 (22:06 +0200)
committerTom de Vries <tdevries@suse.de>
Thu, 17 Jul 2025 20:06:38 +0000 (22:06 +0200)
In some test-cases, matching the pagination prompt is split up to address a
matching race but that's no longer necessary, thanks to commit c3f814a1433
("Fix paginate-*.exp races").

Fix this by using the pagination_prompt variable.

Tested on x86_64-linux.

Approved-By: Andrew Burgess <aburgess@redhat.com>
gdb/testsuite/gdb.cp/static-print-quit.exp
gdb/testsuite/gdb.python/py-cmd.exp
gdb/testsuite/gdb.python/python.exp

index 8e0b61d86e7e59ad83dc32c1fad85c634a7ff584..e4bce7f0d8a60f0675ed99874987381160b3ed6b 100644 (file)
@@ -27,32 +27,17 @@ clean_restart $testfile.o
 gdb_test_no_output "set width 80"
 gdb_test_no_output "set height 2"
 
-set test "print c - <return>"
-gdb_test_multiple "print c" $test {
-    -re "\\$\[0-9\]+ = \{loooooooooooooooooooooooooooooooooooooooooooooong = 0, static field = \{\r\n--Type <RET>" {
-       pass $test
+gdb_test_multiple "print c" "" {
+    -re "\\$\[0-9\]+ = \{loooooooooooooooooooooooooooooooooooooooooooooong = 0, static field = \{\r\n$pagination_prompt$" {
+       pass $gdb_test_name
     }
-    -re "\r\n--Type <RET>" {
+    -re "\r\n$pagination_prompt$" {
        # gdb-7.1 did not crash with this testcase but it had the same bug.
        untested "bug does not reproduce"
        return 0
     }
 }
 
-set test "print c - q <return>"
-gdb_test_multiple "" $test {
-    -re " for more, q to quit, " {
-       pass $test
-    }
-}
-
-set test "print c - remainder"
-gdb_test_multiple "" $test {
-    -re "c to continue without paging--$" {
-       pass $test
-    }
-}
-
 gdb_test "q" ".*"
 
 # Now the obstack is uninitialized.  Exercise it.
index 5ac57122f995195d49c92bb3de9c090f099c1cd0..1fa3c73067b5a51c913ba2a00c708321fa5df223 100644 (file)
@@ -278,13 +278,7 @@ gdb_test_multiline "input multi-line-output command" \
 
 set test "verify pagination from test_multiline"
 gdb_test_multiple "test_multiline" $test {
-    -re "--Type <RET>" {
-       exp_continue
-    }
-    -re " for more, q to quit" {
-       exp_continue
-    }
-    -re ", c to continue without paging--$" {
+    -re "$pagination_prompt$" {
        pass $test
     }
 }
index 6b2f671f5e47b3e22cdaa1fb368a372aa9743435..96977dff629e7192538a81e8e1d6c7d4e2bdb21c 100644 (file)
@@ -152,13 +152,7 @@ gdb_test_no_output "set height $lines"
 
 set test "verify pagination beforehand"
 gdb_test_multiple "python print (\"\\n\" * $lines)" $test {
-    -re "--Type <RET>" {
-       exp_continue
-    }
-    -re " for more, q to quit" {
-       exp_continue
-    }
-    -re ", c to continue without paging--$" {
+    -re "$pagination_prompt$" {
        pass $test
     }
 }
@@ -168,13 +162,7 @@ gdb_test "python if gdb.execute('python print (\"\\\\n\" * $lines)', to_string=T
 
 set test "verify pagination afterwards"
 gdb_test_multiple "python print (\"\\n\" * $lines)" $test {
-    -re "--Type <RET>" {
-       exp_continue
-    }
-    -re " for more, q to quit" {
-       exp_continue
-    }
-    -re ", c to continue without paging--$" {
+    -re "$pagination_prompt$" {
        pass $test
     }
 }