From: Tom de Vries Date: Tue, 8 Oct 2024 20:31:12 +0000 (+0200) Subject: [gdb/testsuite] Fix gdb.base/break-interp.exp with check-read1 X-Git-Tag: gdb-16-branchpoint~701 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=09ff58c1ad9b5894aa9b7965071d4133ab2202ac;p=thirdparty%2Fbinutils-gdb.git [gdb/testsuite] Fix gdb.base/break-interp.exp with check-read1 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. --- diff --git a/gdb/testsuite/gdb.base/break-interp.exp b/gdb/testsuite/gdb.base/break-interp.exp index 98f67eee227..fd8afdd0755 100644 --- a/gdb/testsuite/gdb.base/break-interp.exp +++ b/gdb/testsuite/gdb.base/break-interp.exp @@ -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 } }