From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1879) id 32AFB3858C62; Sat, 22 Oct 2022 04:04:41 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 32AFB3858C62 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1666411481; bh=/4bEXNLptZYwnEu/7LkjJtJ3JJT1dpHSAs/NEQnp3Rk=; h=From:To:Subject:Date:From; b=B2LWLA8VK3a4pivFMpu77NLWTvxXvAhjTuBxv6ND7TNkiWg18pRX1TgfgtxAr956o NxErBSUX9/f92GEt3q4kZNTBtVfj9kIXNZqN3MOifz7oFRh52qNE8GQ2CPffBDZkzy W5XaMzzsAtrM7LbYGiRjUByfmMryB17hnAmImvQI= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Simon Marchi To: gdb-cvs@sourceware.org Subject: [binutils-gdb] gdb/testsuite: add max number of instructions check in gdb.base/unwind-on-each-insn.exp X-Act-Checkin: binutils-gdb X-Git-Author: Simon Marchi X-Git-Refname: refs/heads/master X-Git-Oldrev: 095e74caa783c9db83bc771510e7586bbc512397 X-Git-Newrev: 49c843e6d2d0577200e7c1d2d02855f21a3a9dde Message-Id: <20221022040441.32AFB3858C62@sourceware.org> Date: Sat, 22 Oct 2022 04:04:41 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D49c843e6d2d0= 577200e7c1d2d02855f21a3a9dde commit 49c843e6d2d0577200e7c1d2d02855f21a3a9dde Author: Simon Marchi Date: Fri Oct 21 23:58:15 2022 -0400 gdb/testsuite: add max number of instructions check in gdb.base/unwind-= on-each-insn.exp =20 This test sends my CI in an infinite loop of failures. We expect to have a handful of iterations (5 on my development machine, where the test passes fine)but the log shows that it went up to 104340 iterations: =20 FAIL: gdb.base/unwind-on-each-insn.exp - instruction 104340: maint = print frame-id DUPLICATE: gdb.base/unwind-on-each-insn.exp - instruction 104340: m= aint print frame-id FAIL: gdb.base/unwind-on-each-insn.exp - instruction 104340: [strin= g equal $fid $main_fid] FAIL: gdb.base/unwind-on-each-insn.exp - instruction 104340: get he= xadecimal valueof "$pc" =20 Add a max instruction check, exit the loop if we reach 100 iterations. This should allow the test to fail fast if there's a problem, but 100 iterations should be more than enough for when things are working. =20 Change-Id: I77978d593aca046068f9209272d82e1675ba17c2 Diff: --- gdb/testsuite/gdb.base/unwind-on-each-insn.exp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/gdb/testsuite/gdb.base/unwind-on-each-insn.exp b/gdb/testsuite= /gdb.base/unwind-on-each-insn.exp index 46bea800c1b..faa6a1a3f06 100644 --- a/gdb/testsuite/gdb.base/unwind-on-each-insn.exp +++ b/gdb/testsuite/gdb.base/unwind-on-each-insn.exp @@ -149,6 +149,13 @@ for { set i_count 1 } { true } { incr i_count } { break } =20 + if { $i_count > 100 } { + # We expect a handful of instructions, if we reach 100, + # something is going wrong. Avoid an infinite loop. + fail "exceeded max number of instructions" + break + } + gdb_test "stepi" ".*" } }