Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Andrew Burgess <andrew.burgess@embecosm.com>
To: gdb-patches@sourceware.org
Cc: Simon Marchi <simark@simark.ca>,
	Andrew Burgess <andrew.burgess@embecosm.com>
Subject: [PATCHv2 3/3] gdb: Update test pattern to deal with native-extended-gdbserver
Date: Tue, 27 Nov 2018 11:13:00 -0000	[thread overview]
Message-ID: <dd043f853380d0e02c6a09897a086a87e96d6033.1543317060.git.andrew.burgess@embecosm.com> (raw)
In-Reply-To: <cover.1543317060.git.andrew.burgess@embecosm.com>
In-Reply-To: <cover.1543317060.git.andrew.burgess@embecosm.com>

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 unexpecte 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            |  4 ++++
 gdb/testsuite/gdb.base/annota1.exp | 23 +++++++++++++++++++++--
 2 files changed, 25 insertions(+), 2 deletions(-)

diff --git a/gdb/testsuite/gdb.base/annota1.exp b/gdb/testsuite/gdb.base/annota1.exp
index 4b34aa84f29..b5a0e87c3ad 100644
--- a/gdb/testsuite/gdb.base/annota1.exp
+++ b/gdb/testsuite/gdb.base/annota1.exp
@@ -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
-- 
2.14.5


  parent reply	other threads:[~2018-11-27 11:13 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-21 18:17 [PATCH] gdb/regcache: When saving, ignore registers that can't be read Andrew Burgess
2018-11-26  2:48 ` Simon Marchi
2018-11-27 11:13   ` [PATCHv2 0/3] Handle Errors While Preparing For Inferior Call Andrew Burgess
2018-12-12 15:16     ` [PATCHv3 1/2] gdb/infcall: Make infcall_suspend_state more class like Andrew Burgess
2018-12-12 16:13       ` Pedro Alves
2018-12-12 15:16     ` [PATCHv3 0/2] Handle Errors While Preparing For Inferior Call Andrew Burgess
2018-12-12 16:14       ` Pedro Alves
2018-12-12 17:40         ` Andrew Burgess
2018-12-12 15:16     ` [PATCHv3 2/2] gdb: Update test pattern to deal with native-extended-gdbserver Andrew Burgess
2018-12-12 16:13       ` Pedro Alves
2018-11-27 11:13   ` [PATCHv2 1/3] gdb/infcall: Make infcall_suspend_state more class like Andrew Burgess
2018-11-27 11:13   ` Andrew Burgess [this message]
2018-11-27 11:13   ` [PATCHv2 2/3] gdb/regcache: When saving, ignore registers that can't be read Andrew Burgess
2018-11-27 12:41     ` Pedro Alves
2018-11-27 15:30       ` Andrew Burgess
2018-11-27 16:57         ` Pedro Alves

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=dd043f853380d0e02c6a09897a086a87e96d6033.1543317060.git.andrew.burgess@embecosm.com \
    --to=andrew.burgess@embecosm.com \
    --cc=gdb-patches@sourceware.org \
    --cc=simark@simark.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox