From patchwork Tue Feb 27 09:13:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom de Vries X-Patchwork-Id: 86423 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 7B5C43858C3A for ; Tue, 27 Feb 2024 09:13:32 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) by sourceware.org (Postfix) with ESMTPS id 87ABD3858420 for ; Tue, 27 Feb 2024 09:12:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 87ABD3858420 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 87ABD3858420 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=195.135.223.131 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1709025179; cv=none; b=SKmchZGZc1CZgCys1dGKBwC3TeW+W+L6FiNXEFMK8xxmsy+/IOj5fYPe3/TBCbYVWBFQJnNo00PcH0zNR8wQ/8rxvPFABP7FO50JWuhlxPGzSWMcgEKoTDx3auUWKqCL+VKzKU+J86KugmkmSIChzZqcJZWpB2F6iIwh9MQ2STw= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1709025179; c=relaxed/simple; bh=z29vHMQJ2KKWNyTl57MHnEbAnVD7u5p2PrvQJvsBQts=; h=DKIM-Signature:DKIM-Signature:DKIM-Signature:DKIM-Signature:From: To:Subject:Date:Message-Id:MIME-Version; b=W0zH6+VA5xUHuL81u7f9FXpsxY30gMNAriMOJ5pyuDJMVereItRFS/KgN1N2SDvvJPIypZjo6iyQpBdKqmgEWW8HnL60IEK8CyiaxlMsQ0qVYRkduStNcibYc17CPfzgVCXNE9WyJLQQvTGjvO6MPVgqUto83oqRpKTsNKlXgSc= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 8BE511F449 for ; Tue, 27 Feb 2024 09:12:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1709025176; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=1t0D+22BHsLvqUFE0+ip9BHlFBijhwYXomwdRUu7O68=; b=pSa6LswgJrH9jSxC/0Kiynhyaxv/yrnQiQavPgJpHJClj0PNDDKXmAkMPshvuvvxxa3lsy LWojoMIvSurXG8/5gZg47ouqH8LK/xrTurJfOB5viRsKSEVdFiPXnuEJrSAfAdjurGxDcf /MBoOaDdxhsKdbVlXQcvZddYuLPMnYk= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1709025176; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=1t0D+22BHsLvqUFE0+ip9BHlFBijhwYXomwdRUu7O68=; b=hb6iRszwJLixZyh8cQx0+/KK3+dYPPv9er4TzbqM1SJS3dB4V+l7sdh9ogE3RTPZrtJtH7 NnI1UobvUamYK0Aw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1709025175; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=1t0D+22BHsLvqUFE0+ip9BHlFBijhwYXomwdRUu7O68=; b=q3XY6dGvC77VHbbl/PG8OB6FYvCrd8Sno4W7iv6L8VsbkGvCt1v0KYT6TriDC5oeZfREed 6OJ88KwV0HfN0QnoycfCeKDAKFPdPi0/chOtOchfvWDGvKDC9+hfC3wdaQ56d4G1Kxbcrz EeMrkFSe/iWs8ugh/fGHpxVGqvorCrI= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1709025175; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=1t0D+22BHsLvqUFE0+ip9BHlFBijhwYXomwdRUu7O68=; b=cuguGiztnopzkqtZ/jM17FxYCft7sZayzQz1fUrYS+lcki9FiQZA4nJfN0kdoMcGuMayRb NPBcnSBxnzr1q6Dw== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 752C513A58 for ; Tue, 27 Feb 2024 09:12:55 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id 2esXG5en3WV8bgAAD6G6ig (envelope-from ) for ; Tue, 27 Feb 2024 09:12:55 +0000 From: Tom de Vries To: gdb-patches@sourceware.org Subject: [PATCH] [gdb/testsuite] Fix test in gdb.python/py-finish-breakpoint.exp Date: Tue, 27 Feb 2024 10:13:06 +0100 Message-Id: <20240227091306.4234-1-tdevries@suse.de> X-Mailer: git-send-email 2.35.3 MIME-Version: 1.0 Authentication-Results: smtp-out2.suse.de; none X-Spam-Score: 3.16 X-Spamd-Result: default: False [3.16 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; R_MISSING_CHARSET(2.50)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[gdb-patches@sourceware.org]; BROKEN_CONTENT_TYPE(1.50)[]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_LONG(-1.00)[-1.000]; RCVD_COUNT_THREE(0.00)[3]; TO_DN_NONE(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MID_CONTAINS_FROM(1.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[sourceware.org:url]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-0.54)[80.68%] X-Spam-Status: No, score=-12.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org With test-case gdb.python/py-finish-breakpoint.exp, we run into: ... (gdb) python print (finishbp_default.hit_count) Traceback (most recent call last): File "", line 1, in RuntimeError: Breakpoint 3 is invalid. Error while executing Python code. (gdb) PASS: gdb.python/py-finish-breakpoint.exp: normal conditions: \ check finishBP on default frame has been hit ... The test producing the pass is: ... gdb_test "python print (finishbp_default.hit_count)" "1.*" \ "check finishBP on default frame has been hit" ... so the pass is produced because the 1 in "line 1" matches "1.*". Temporary breakpoints are removed when hit, and consequently accessing the hit_count attribute of a temporary python breakpoint (gdb.Breakpoint class) is not possible, and as per spec we get a RuntimeError. So the RuntimeError is correct, and not specific to finish breakpoints. The test presumably attempts to match: ... (gdb) python print (finishbp_default.hit_count) 1 ... but most likely this output was never produced by any gdb version. Fix this by checking whether the finishbp_default breakpoint has hit by checking that finishbp_default.is_valid() is False. Tested on aarch64-linux. PR testsuite/31391 Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31391 --- gdb/testsuite/gdb.python/py-finish-breakpoint.exp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) base-commit: 268391acb9fa956bad24533e2cc0d1459dea1b3d diff --git a/gdb/testsuite/gdb.python/py-finish-breakpoint.exp b/gdb/testsuite/gdb.python/py-finish-breakpoint.exp index 45e2630337f..600a2f38392 100644 --- a/gdb/testsuite/gdb.python/py-finish-breakpoint.exp +++ b/gdb/testsuite/gdb.python/py-finish-breakpoint.exp @@ -73,7 +73,8 @@ with_test_prefix "normal conditions" { "check MyFinishBreakpoint hit" gdb_test "python print (finishbp.return_value)" "-5.*" "check return_value" - gdb_test "python print (finishbp_default.hit_count)" "1.*" "check finishBP on default frame has been hit" + gdb_test "python print (finishbp_default.is_valid())" "False" \ + "check finishBP on default frame has been hit" gdb_test "python print (finishbp.is_valid())" "False.*"\ "ensure that finish bp is invalid afer normal hit"