]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
[gdb/testsuite] Fix gdb.base/break-interp.exp with check-read1
authorTom de Vries <tdevries@suse.de>
Tue, 8 Oct 2024 20:31:12 +0000 (22:31 +0200)
committerTom de Vries <tdevries@suse.de>
Tue, 8 Oct 2024 20:31:12 +0000 (22:31 +0200)
When running test-case gdb.base/break-interp.exp with check-read1, I run into:
...
(gdb) info files^M
  ...
0x00007ffff7e75980 - 0x00007ffff7e796a0 @ 0x001f1970 is .bss in /data/vries/gdb/leap-15-5/build/gdb/testsuite/outputs/gdb.base/break-interp/break-interp-BINprelinkNOdebugNOFAIL: gdb.base/break-interp.exp: ldprelink=NO: ldsepdebug=NO: binprelink=NO: binsepdebug=NO: binpie=NO: INNER: symbol-less: info files (timeout)
pieNO.d/libc.so.6^M
...

The code has two adaptations to deal with the large output:
- nested gdb_test_multiple, and
- an exp_continue in the inner gdb_test_multiple.

The former seems unnecessary, and the latter doesn't trigger often enough
because of an incomplete hex number regexp, causing the timeout.

Get rid of both of these, and use -lbl instead.

Tested on x86_64-linux.

gdb/testsuite/gdb.base/break-interp.exp

index 98f67eee2278a82ba62a47bc1ddc6d7e929a0686..fd8afdd0755c6e4c1640fdecf08f444eee2b2d83 100644 (file)
@@ -495,26 +495,14 @@ proc test_ld {file ifmain trynosym displacement} {
        if $ifmain {
            reach $solib_bp run $displacement 3
 
-           # Use two separate gdb_test_multiple statements to avoid timeouts due
-           # to slow processing of wildcard capturing long output
-           set test "info files"
            set entrynohex ""
-           set info_line [join [list \
-                                    "\r\n" "\[\t\]" "0x\[0-9af\]+" " - " \
-                                    "0x\[0-9af\]+" " @ " "0x\[0-9af\]+"  \
-                                    " is " "\[^\r\n\]+"] ""]
-           gdb_test_multiple $test $test {
+           gdb_test_multiple "info files" "" -lbl {
                -re "\r\n\[\t \]*Entry point:\[\t \]*0x(\[0-9a-f\]+)\r\n" {
                    set entrynohex $expect_out(1,string)
-                   gdb_test_multiple "" $test {
-                       -re "\r\n$gdb_prompt $" {
-                           pass $test
-                       }
-                       -re $info_line {
-                           # Avoid timeout with check-read1
-                           exp_continue
-                       }
-                   }
+                   exp_continue
+               }
+               -re -wrap "" {
+                   gdb_assert { ![string equal $entrynohex ""] } $gdb_test_name
                }
            }