Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom de Vries <tdevries@suse.de>
To: gdb-patches@sourceware.org
Subject: [committed][gdb/testsuite, 1/2] Fix gdb.linespec/explicit.exp with check-read1
Date: Mon, 29 Jul 2019 14:25:00 -0000	[thread overview]
Message-ID: <20190729142547.GA21025@delia> (raw)

Hi,

When running gdb.linespec/explicit.exp with check-read1, we get:
...
(gdb) PASS: gdb.linespec/explicit.exp: complete unique file name: break -source "3explicit.c"
break -source exp^Glicit^G^M
explicit.c   explicit2.c  ^M
(gdb) FAIL: gdb.linespec/explicit.exp: complete non-unique file name
...

The problem is that we have a gdb_test_multiple where we match two regexps:
...
        set tst "complete non-unique file name"
        send_gdb "break -source exp\t"
        gdb_test_multiple "" $tst {
            -re "break -source exp\\\x07licit" {
                ...
            }

            -re "break -source exp\\\x07l" {
                # This pattern may occur when glibc debuginfo is installed.
		...
            }
        }
...
but since second is a substring of the first, we'll usually match the first,
but with check-read1 we'll match the second.

Fix this by using a single regexp and merging the related code.

Tested on x86_64-linux.

Committed to trunk.

Thanks,
- Tom

[gdb/testsuite, 1/2] Fix gdb.linespec/explicit.exp with check-read1

gdb/testsuite/ChangeLog:

2019-07-29  Tom de Vries  <tdevries@suse.de>

	* gdb.linespec/explicit.exp: Fix gdb_test_multiple regexps where second
	is a substring of the first for "complete non-unique file name".

---
 gdb/testsuite/gdb.linespec/explicit.exp | 15 +--------------
 1 file changed, 1 insertion(+), 14 deletions(-)

diff --git a/gdb/testsuite/gdb.linespec/explicit.exp b/gdb/testsuite/gdb.linespec/explicit.exp
index 11656ca5c5..90181b3acb 100644
--- a/gdb/testsuite/gdb.linespec/explicit.exp
+++ b/gdb/testsuite/gdb.linespec/explicit.exp
@@ -241,20 +241,7 @@ namespace eval $testfile {
 	    -re "break -source exp\\\x07licit" {
 		send_gdb "\t\t"
 		gdb_test_multiple "" $tst {
-		    -re "\\\x07\r\nexplicit.c\[ \t\]+explicit2.c\[ \t\]+\r\n$gdb_prompt" {
-			send_gdb "\n"
-			gdb_test "" \
-			    {Source filename requires function, label, or line offset.} \
-			    $tst
-		    }
-		}
-	    }
-
-	    -re "break -source exp\\\x07l" {
-		# This pattern may occur when glibc debuginfo is installed.
-		send_gdb "\t\t"
-		gdb_test_multiple "" $tst {
-		    -re "\\\x07\r\nexplicit.c\[ \t\]+explicit2.c\[ \t\]+expl.*\r\n$gdb_prompt" {
+		    -re "\\\x07\r\nexplicit.c\[ \t\]+explicit2.c\[ \t\]+\(expl.*\)?\r\n$gdb_prompt" {
 			send_gdb "\n"
 			gdb_test "" \
 			    {Source filename requires function, label, or line offset.} \


                 reply	other threads:[~2019-07-29 14:25 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20190729142547.GA21025@delia \
    --to=tdevries@suse.de \
    --cc=gdb-patches@sourceware.org \
    /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