From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id 526223858D1E for ; Sat, 22 Oct 2022 04:04:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 526223858D1E Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=polymtl.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=polymtl.ca Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id 29M44luV018468 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 22 Oct 2022 00:04:52 -0400 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 29M44luV018468 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=polymtl.ca; s=default; t=1666411492; bh=KAcZnXpJUmEDFTb11hsoi8Vs8kzW47/D6WCpt/d531I=; h=From:To:Cc:Subject:Date:From; b=F9Algtp5kFp/XsS2efVGY/BLXRyuOW8lhy8FmN8OxYiy65YE1M52PsS4NwNI0XFe+ Ik7wnrlWRr0TJQ7egsgr3PlSch4lJTFnF1QWDW/GpCFGgkL+k6+bjY0WiTcjVJ23E3 jfmUuf584OVUuqYeGQ8ERnx/bn9vrxmxtBu1YtFk= Received: from simark.localdomain (unknown [217.28.27.60]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 952AF1E0CB; Sat, 22 Oct 2022 00:04:47 -0400 (EDT) From: Simon Marchi To: gdb-patches@sourceware.org Cc: Simon Marchi Subject: [pushed] gdb/testsuite: add max number of instructions check in gdb.base/unwind-on-each-insn.exp Date: Sat, 22 Oct 2022 00:04:46 -0400 Message-ID: <20221022040446.2312735-1-simon.marchi@polymtl.ca> X-Mailer: git-send-email 2.38.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Sat, 22 Oct 2022 04:04:47 +0000 X-Spam-Status: No, score=-3189.8 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Message-ID: <20221022040446.Dvp8irbakL_AtWTFz7q7UB_GjN9yJ8RAbCvgucJkzy4@z> 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: FAIL: gdb.base/unwind-on-each-insn.exp - instruction 104340: maint print frame-id DUPLICATE: gdb.base/unwind-on-each-insn.exp - instruction 104340: maint print frame-id FAIL: gdb.base/unwind-on-each-insn.exp - instruction 104340: [string equal $fid $main_fid] FAIL: gdb.base/unwind-on-each-insn.exp - instruction 104340: get hexadecimal valueof "$pc" 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. Change-Id: I77978d593aca046068f9209272d82e1675ba17c2 --- 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 46bea800c1bb..faa6a1a3f064 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 } + 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" ".*" } } base-commit: 095e74caa783c9db83bc771510e7586bbc512397 -- 2.38.0