gdb/testsuite: use gdb_test_no_output instead of send_gdb
authorAndrew Burgess <andrew.burgess@embecosm.com>
Fri, 7 May 2021 21:14:27 +0000 (22:14 +0100)
committerAndrew Burgess <andrew.burgess@embecosm.com>
Fri, 7 May 2021 21:19:41 +0000 (22:19 +0100)
I noticed gdb.base/ptype-offsets.exp failing occasionally, this was
due to lines like this in the test script:

  send_gdb "set print type hex on\n"

As this does not match the '(gdb)' prompt that is produced, the prompt
would sometimes be matched against the next test, causing the next
test to think its output was missing and fail.

Fix this by switching to:

  gdb_test_no_output "set print type hex on"

gdb/testsuite/ChangeLog:

* gdb.base/ptype-offsets.exp: Replace use of send_gdb with
gdb_test_no_output.

gdb/testsuite/ChangeLog
gdb/testsuite/gdb.base/ptype-offsets.exp

index 3813c19ac5bf2b69aae415fefd42294d65f62839..2fac86e2cea905e585f245e9b586363006dd68dd 100644 (file)
@@ -1,3 +1,8 @@
+2021-05-07  Andrew Burgess  <andrew.burgess@embecosm.com>
+
+       * gdb.base/ptype-offsets.exp: Replace use of send_gdb with
+       gdb_test_no_output.
+
 2021-05-07  Simon Marchi  <simon.marchi@polymtl.ca>
 
        * Re-format all Python files using black.
index cc017ad79093c8647eb4525acf8f787538f2f5e7..3f42250c07f39425ee2aeb343c8b8a78a869662c 100644 (file)
@@ -413,7 +413,7 @@ gdb_test "ptype/o empty_member" \
 
 with_test_prefix "with_hex_default" {
   # Test setting default display to hex
-  send_gdb "set print type hex on\n"
+  gdb_test_no_output "set print type hex on"
   gdb_test "show print type hex" \
            "Display of struct members offsets and sizes in hexadecimal is on"
 
@@ -467,5 +467,5 @@ with_test_prefix "with_hex_default" {
   "                             \}"]]
 
   # restore
-  send_gdb "set print type hex off\n"
+  gdb_test_no_output "set print type hex off"
 }
This page took 0.045509 seconds and 4 git commands to generate.