public inbox for gdb-testers@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] [gdb/testsuite] Fix corefile-buildid.exp with check-read1
@ 2020-02-26 14:37 gdb-buildbot
  2020-02-26 14:16 ` Failures on Ubuntu-Aarch64-native-extended-gdbserver-m64, branch master gdb-buildbot
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: gdb-buildbot @ 2020-02-26 14:37 UTC (permalink / raw)
  To: gdb-testers

*** TEST RESULTS FOR COMMIT 623563f79db9c2d576303565f8ba1415c911c452 ***

commit 623563f79db9c2d576303565f8ba1415c911c452
Author:     Tom de Vries <tdevries@suse.de>
AuthorDate: Wed Feb 19 21:33:39 2020 +0100
Commit:     Tom de Vries <tdevries@suse.de>
CommitDate: Wed Feb 19 21:33:39 2020 +0100

    [gdb/testsuite] Fix corefile-buildid.exp with check-read1
    
    When running gdb.base/corefile-buildid.exp using check-read1, I run into:
    ...
    FAIL: gdb.base/corefile-buildid.exp: shared: info files (timeout)
    FAIL: gdb.base/corefile-buildid.exp: symlink shared: info files (timeout)
    FAIL: gdb.base/corefile-buildid.exp: shared sepdebug: info files (timeout)
    FAIL: gdb.base/corefile-buildid.exp: symlink shared sepdebug: info files \
      (timeout)
    ...
    
    This is caused by attempting to match the output of an "info files" command
    using a single gdb_test in check_exec_file.
    
    Fix this by doing line-by-line matching in check_exec_file.
    
    Tested on x86_64-linux, using make targets check and check-read1.
    
    gdb/testsuite/ChangeLog:
    
    2020-02-19  Tom de Vries  <tdevries@suse.de>
    
            * gdb.base/corefile-buildid.exp (check_exec_file): Match info files
            output line-by-line.

diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index b2f20fe38b..e599791f58 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2020-02-19  Tom de Vries  <tdevries@suse.de>
+
+	* gdb.base/corefile-buildid.exp (check_exec_file): Match info files
+	output line-by-line.
+
 2020-02-19  Tom de Vries  <tdevries@suse.de>
 
 	* gdb.cp/cpexprs.exp: Remove c++/14186 kfail.
diff --git a/gdb/testsuite/gdb.base/corefile-buildid.exp b/gdb/testsuite/gdb.base/corefile-buildid.exp
index 158cbb6dc6..b9844ee354 100644
--- a/gdb/testsuite/gdb.base/corefile-buildid.exp
+++ b/gdb/testsuite/gdb.base/corefile-buildid.exp
@@ -108,8 +108,55 @@ proc append_debug_dir {debugdir} {
 # FILE.
 
 proc check_exec_file {file} {
+    global gdb_prompt
     send_log "expecting exec file \"$file\"\n"
-    gdb_test "info files" "Local exec file:\[\r\n\t\ \]+`[string_to_regexp $file]'.*"
+
+    # Get line with "Local exec file:".
+    set ok 0
+    gdb_test_multiple "info files" "" {
+	-re "^Local exec file:\r\n" {
+	    set test_name $gdb_test_name
+	    set ok 1
+	}
+	-re "^$gdb_prompt $" {
+	    fail $gdb_test_name
+	}
+	-re "^\[^\r\n\]*\r\n" {
+	    exp_continue
+	}
+    }
+
+    if { $ok == 0 } {
+	return
+    }
+
+    # Get subsequent line with $file.
+    set ok 0
+    gdb_test_multiple "" $test_name {
+	-re "^\[\t\ \]+`[string_to_regexp $file]'\[^\r\n\]*\r\n" {
+	    set ok 1
+	}
+	-re "^$gdb_prompt $" {
+	    fail $gdb_test_name
+	}
+	-re "^\[^\r\n\]*\r\n" {
+	    exp_continue
+	}
+    }
+
+    if { $ok == 0 } {
+	return
+    }
+
+    # Skip till prompt.
+    gdb_test_multiple "" $test_name {
+	-re "^$gdb_prompt $" {
+	    pass $gdb_test_name
+	}
+	-re "^\[^\r\n\]*\r\n" {
+	    exp_continue
+	}
+    }
 }
 
 # Test whether gdb can find an exec file from a core file's build-id.


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2020-02-29 20:19 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-26 14:37 [binutils-gdb] [gdb/testsuite] Fix corefile-buildid.exp with check-read1 gdb-buildbot
2020-02-26 14:16 ` Failures on Ubuntu-Aarch64-native-extended-gdbserver-m64, branch master gdb-buildbot
2020-02-26 16:12 ` Failures on Ubuntu-Aarch64-native-gdbserver-m64, " gdb-buildbot
2020-02-27 22:00 ` Failures on Fedora-i686, " gdb-buildbot
2020-02-27 22:32 ` Failures on Fedora-x86_64-m32, " gdb-buildbot
2020-02-27 22:34 ` Failures on Fedora-x86_64-cc-with-index, " gdb-buildbot
2020-02-27 23:13 ` Failures on Fedora-x86_64-m64, " gdb-buildbot
2020-02-27 23:40 ` Failures on Fedora-x86_64-native-extended-gdbserver-m32, " gdb-buildbot
2020-02-28  0:10 ` Failures on Fedora-x86_64-native-extended-gdbserver-m64, " gdb-buildbot
2020-02-28  5:16 ` Failures on Fedora-x86_64-native-gdbserver-m64, " gdb-buildbot
2020-02-29 20:58 ` Failures on Fedora-x86_64-native-gdbserver-m32, " gdb-buildbot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).