From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id cjrREo5g4mLN3BsAWB0awg (envelope-from ) for ; Thu, 28 Jul 2022 06:10:22 -0400 Received: by simark.ca (Postfix, from userid 112) id 3E3231E9ED; Thu, 28 Jul 2022 06:10:22 -0400 (EDT) Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=jR79tu/r; dkim-atps=neutral X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-3.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (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 ESMTPS id 34E231E5EA for ; Thu, 28 Jul 2022 06:10:21 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 69E933857374 for ; Thu, 28 Jul 2022 10:10:20 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 69E933857374 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1659003020; bh=sBa4gOV+GsHFFSNVJqyyRyzD3mO0CsPLOok2jhAm63k=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=jR79tu/r7FUlw0ZPfYfOpWUrjVTGvzwcBDd3+EvP4vMxEzVHzzS1/o1Z8xQbc3D8I l3jnsrPksKqP6HHmWmOnEak5kbiZriaXBgmsaswdwrB4Gsg1jnJtjy/1AUPfjE8e1Q UvLfdflLmXenVbsStJ+bVR7iNsexAiELFFC4MHko= Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by sourceware.org (Postfix) with ESMTPS id C9CB9385841D for ; Thu, 28 Jul 2022 10:09:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org C9CB9385841D Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 0D3DC372DD for ; Thu, 28 Jul 2022 10:09:59 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id F070413A7E for ; Thu, 28 Jul 2022 10:09:58 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id tU6xOXZg4mIdYQAAMHmgww (envelope-from ) for ; Thu, 28 Jul 2022 10:09:58 +0000 Date: Thu, 28 Jul 2022 12:09:57 +0200 To: gdb-patches@sourceware.org Subject: [PATCH][gdb/testsuite] Fix ERROR in gdb.base/watchpoint-unaligned.exp Message-ID: <20220728100956.GA28055@delia.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Tom de Vries via Gdb-patches Reply-To: Tom de Vries Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" Hi, In PR23888 an error is reported: ... ERROR: tcl error sourcing watchpoint-unaligned.exp. ERROR: expected boolean value but got "" while executing "if {$wpnum} { ... This presumably happens when: - skip_hw_watchpoint_tests returns 0 meaning hw watchpoints are supported - gdb fails to set a hw watchpoint and instead sets a sw watchpoint That particular situation is handled for arm: ... -re "Watchpoint (\[0-9\]+): .*\r\n$gdb_prompt $" { if {[istarget "arm*-*-*"]} { untested $test set wpnum 0 } } ... but not for any other targets so wpnum remains "", triggering the ERROR. Possibly this has been fixed for powerpc by commit 8d4e4d13afb ("gdb Power 9 add test for HW watchpoint support."), but it's still possible for other targets. Fix this by: - initializing wpnum to 0 instead of "" - signalling the failure to set a hw watchpoint by a fail Tested on x86_64-linux, also by adding: ... gdb_test_no_output "set can-use-hw-watchpoints 0" ... and verifying that it triggers the fail. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=23888 Any comments? Thanks, - Tom [gdb/testsuite] Fix ERROR in gdb.base/watchpoint-unaligned.exp --- gdb/testsuite/gdb.base/watchpoint-unaligned.exp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/gdb/testsuite/gdb.base/watchpoint-unaligned.exp b/gdb/testsuite/gdb.base/watchpoint-unaligned.exp index 4dbd3692995..00c6ebcf4eb 100644 --- a/gdb/testsuite/gdb.base/watchpoint-unaligned.exp +++ b/gdb/testsuite/gdb.base/watchpoint-unaligned.exp @@ -157,15 +157,17 @@ if ![runto_main] { } gdb_breakpoint [gdb_get_line_number "final_return"] "Breakpoint $decimal at $hex" "final_return" set test {watch data.u.size8twice[1]} -set wpnum "" +set wpnum 0 gdb_test_multiple $test $test { -re "Hardware watchpoint (\[0-9\]+): .*\r\n$gdb_prompt $" { set wpnum $expect_out(1,string) + pass $gdb_test_name } -re "Watchpoint (\[0-9\]+): .*\r\n$gdb_prompt $" { if {[istarget "arm*-*-*"]} { - untested $test - set wpnum 0 + untested $gdb_test_name + } else { + fail $gdb_test_name } } }