[gdb/testsuite] Fix dw2-ranges-psym.exp with -readnow
authorTom de Vries <tdevries@suse.de>
Mon, 23 Aug 2021 10:08:25 +0000 (12:08 +0200)
committerTom de Vries <tdevries@suse.de>
Mon, 23 Aug 2021 10:08:25 +0000 (12:08 +0200)
When running test-case gdb.dwarf2/dw2-ranges-psym.exp with target board
-readnow, I run into:
...
(gdb) file dw2-ranges-psym^M
Reading symbols from dw2-ranges-psym...^M
Expanding full symbols from dw2-ranges-psym...^M
(gdb) set complaints 0^M
(gdb) FAIL: gdb.dwarf2/dw2-ranges-psym.exp: No complaints
...

The problem is that the regexp expects a gdb prompt immediately after the
"Reading symbols" line.

Fix this by updating the regexp.

Tested on x86_64-linux.

gdb/testsuite/ChangeLog:

2021-08-22  Tom de Vries  <tdevries@suse.de>

* lib/gdb.exp (gdb_load_no_complaints): Update regexp to allow
"Expanding full symbols" Line.

gdb/testsuite/lib/gdb.exp

index 2f95989440a7e965d94eccf50e969bf2c152a4bc..093392709b4272e5f3d2f2957301c227be09de50 100644 (file)
@@ -5328,7 +5328,11 @@ proc gdb_load_no_complaints { arg } {
     }
 
     # Verify that there were no complaints.
-    set re "^Reading symbols from \[^\r\n\]*\r\n$gdb_prompt $"
+    set re \
+       [multi_line \
+            "^Reading symbols from \[^\r\n\]*" \
+            "(Expanding full symbols from \[^\r\n\]*" \
+            ")?$gdb_prompt $"]
     gdb_assert {[regexp $re $gdb_file_cmd_msg]} "No complaints"
 }