gdb: Update test pattern to deal with native-extended-gdbserver
authorAndrew Burgess <andrew.burgess@embecosm.com>
Mon, 26 Nov 2018 17:56:39 +0000 (17:56 +0000)
committerAndrew Burgess <andrew.burgess@embecosm.com>
Wed, 12 Dec 2018 17:33:52 +0000 (17:33 +0000)
When running the test gdb.base/annota1.exp with:

  make check-gdb RUNTESTFLAGS="--target_board=native-extended-gdbserver gdb.base/annota1.exp"

I would see a failure due to some unexpected lines in GDB's output.
The extra lines (when compared with a native run) were about file
transfer from the remote back to GDB.

This commit extends the regexp for this test to allow for these extra
lines, and also splits the rather long regexp up into a list of parts.

With this change in place I see no failures for gdb.base/annota1.exp
when using the native-extended-gdbserver target board, nor with a
native run on X86-64/Linux.

gdb/testsuite/ChangeLog:

* gdb.base/annota1.exp: Update a test regexp.

gdb/testsuite/ChangeLog
gdb/testsuite/gdb.base/annota1.exp

index b85ea3bfc1f221b23705a7a89dd4894b16856bb6..ab3a74fffd6232ad0d08d268ea3c6217127f1854 100644 (file)
@@ -1,3 +1,7 @@
+2018-12-12  Andrew Burgess  <andrew.burgess@embecosm.com>
+
+       * gdb.base/annota1.exp: Update a test regexp.
+
 2018-12-11  Andrew Burgess  <andrew.burgess@embecosm.com>
 
        * gdb.base/float.exp: Handle RISC-V targets without an FPU.
index 4b34aa84f298f6e9269e0cdeadf614098c7a8343..b5a0e87c3ade3522017488200166c6537c495220 100644 (file)
@@ -127,8 +127,27 @@ gdb_test_multiple "info break" "breakpoint info" {
 #exp_internal 1
 set binexp [string_to_regexp $binfile]
 gdb_test_multiple "run" "run until main breakpoint" {
-    -re "\r\n\032\032post-prompt\r\nStarting program: $binexp \(\r\nwarning: Skipping \[^\r\n\]+ .gdb_index section in \[^\r\n\]+\r\nDo \"set use-deprecated-index-sections on\" before the file is read\r\nto use the section anyway\\.\)?\(\(\r\n\r\n\032\032frames-invalid\)|\(\r\n\r\n\032\032breakpoints-invalid\)\)*\r\n\r\n\032\032starting\(\(\r\n\r\n\032\032frames-invalid\)|\(\r\n\r\n\032\032breakpoints-invalid\)\)*\r\n\r\n\032\032breakpoint 1\r\n\r\nBreakpoint 1, \r\n\032\032frame-begin 0 $hex\r\n\r\n\032\032frame-function-name\r\nmain\r\n\032\032frame-args\r\n \\(\\)\r\n\032\032frame-source-begin\r\n at \r\n\032\032frame-source-file\r\n.*annota1.c\r\n\032\032frame-source-file-end\r\n:\r\n\032\032frame-source-line\r\n$main_line\r\n\032\032frame-source-end\r\n\r\n\r\n\032\032source.*$srcfile:$main_line:.*:beg:$hex\r\n\r\n\032\032frame-end\r\n\r\n\032\032stopped.*$gdb_prompt$" {
-       pass "run until main breakpoint" 
+    -re [join { "\r\n\032\032post-prompt\r\nStarting program: $binexp " \
+                   "\(\(\r\nReading \[^\r\n\]+\)|\(\r\nwarning: File transfers from remote targets can be slow\[^\r\n\]+\)\)*" \
+                   "\(\r\nwarning: Skipping \[^\r\n\]+ .gdb_index section in \[^\r\n\]+\r\nDo \"set use-deprecated-index-sections on\" before the file is read\r\nto use the section anyway\\.\)?" \
+                   "\(\(\r\n\r\n\032\032frames-invalid\)|\(\r\n\r\n\032\032breakpoints-invalid\)\)*\r\n\r\n" \
+                   "\032\032starting\(\(\r\nReading \[^\r\n\]+\)|\(\r\nwarning: File transfers from remote targets can be slow\[^\r\n\]+\)\)*" \
+                   "\(\(\r\n\r\n\032\032frames-invalid\)|\(\r\n\r\n\032\032breakpoints-invalid\)\)*\r\n\r\n" \
+                   "\032\032breakpoint 1\r\n\r\n" \
+                   "Breakpoint 1, \r\n" \
+                   "\032\032frame-begin 0 $hex\r\n\r\n" \
+                   "\032\032frame-function-name\r\n" \
+                   "main\r\n" \
+                   "\032\032frame-args\r\n \\(\\)\r\n" \
+                   "\032\032frame-source-begin\r\n at \r\n" \
+                   "\032\032frame-source-file\r\n.*annota1.c\r\n" \
+                   "\032\032frame-source-file-end\r\n:\r\n" \
+                   "\032\032frame-source-line\r\n$main_line\r\n" \
+                   "\032\032frame-source-end\r\n\r\n\r\n" \
+                   "\032\032source.*$srcfile:$main_line:.*:beg:$hex\r\n\r\n" \
+                   "\032\032frame-end\r\n\r\n" \
+                   "\032\032stopped.*$gdb_prompt$" } ] {
+       pass "run until main breakpoint"
     }
 }
 #exp_internal 0