diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index a9c28522511..520e4533fa5 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2020-03-14  Tom de Vries  <tdevries@suse.de>
+
+	* gdb.threads/attach-many-short-lived-threads.exp: Read "info threads"
+	result in line-by-line fashion.
+
 2020-03-14  Tom de Vries  <tdevries@suse.de>
 
 	* lib/gdb.exp (supports_statement_frontiers): New proc.
diff --git a/gdb/testsuite/gdb.threads/attach-many-short-lived-threads.exp b/gdb/testsuite/gdb.threads/attach-many-short-lived-threads.exp
index 9a08e5738b2..13014347b40 100644
--- a/gdb/testsuite/gdb.threads/attach-many-short-lived-threads.exp
+++ b/gdb/testsuite/gdb.threads/attach-many-short-lived-threads.exp
@@ -108,12 +108,18 @@ proc test {} {
 	    sleep 1
 
 	    set test "no new threads"
-	    gdb_test_multiple "info threads" $test {
-		-re "New .*$gdb_prompt $" {
-		    fail $test
+	    set status 1
+	    gdb_test_multiple "info threads" $test -lbl {
+		-re "\r\n\[^\r\n\]*New " {
+		    set status 0
+		    exp_continue
 		}
-		-re "$gdb_prompt $" {
-		    pass $test
+		-re -wrap "" {
+		    if { $status == 1 } {
+			pass $gdb_test_name
+		    } else {
+			fail $gdb_test_name
+		    }
 		}
 	    }