From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id dKrfL546VGLYLgAAWB0awg (envelope-from ) for ; Mon, 11 Apr 2022 10:26:38 -0400 Received: by simark.ca (Postfix, from userid 112) id BB1A21F202; Mon, 11 Apr 2022 10:26:38 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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.2 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 234F51ED17 for ; Mon, 11 Apr 2022 10:26:38 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 76D23383DBA9 for ; Mon, 11 Apr 2022 14:26:37 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 76D23383DBA9 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1649687197; bh=MsB82eV1k13LXLbG8gdalz51nSmdgcaPsby8dtg1PZ4=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=Hf513y+fPqZQPStaoapQo9hMfATtDfuJ8y5Ek4xjNN7uB6GOXKmxYwoew5+hwBIim aDOhLHpKji4tT55LeH4OYS70cw6WwfWPZTkCVZckrEcbPHkjW2MMcIVCdcb83iWAI9 r8cG45ks/hpkVr7vYDqgH5RxeyXnL2JP8hACAAOE= Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by sourceware.org (Postfix) with ESMTPS id 2AD76384191F for ; Mon, 11 Apr 2022 14:25:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 2AD76384191F 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 327BA215FF for ; Mon, 11 Apr 2022 14:25:56 +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 1C4C513A93 for ; Mon, 11 Apr 2022 14:25:56 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id UWFvBXQ6VGKpSgAAMHmgww (envelope-from ) for ; Mon, 11 Apr 2022 14:25:56 +0000 Date: Mon, 11 Apr 2022 16:25:54 +0200 To: gdb-patches@sourceware.org Subject: [PATCH][gdb/testsuite] Detect 'No MPX support' Message-ID: <20220411142553.GA13322@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, On openSUSE Leap 15.3, mpx support has been disabled for m32, so I run into: ... (gdb) run ^M Starting program: outputs/gdb.arch/i386-mpx/i386-mpx ^M [Thread debugging using libthread_db enabled]^M Using host libthread_db library "/lib64/libthread_db.so.1".^M No MPX support^M ... and eventually into all sort of fails in this and other mpx test-cases. Fix this by detecting the "No MPX support" message in have_mpx. Tested on x86_64-linux with target boards unix and unix/-m32. Any comments? Thanks, - Tom [gdb/testsuite] Detect 'No MPX support' --- gdb/testsuite/lib/gdb.exp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index 2eb711748e7..9eb01e0b4b2 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -8329,6 +8329,29 @@ gdb_caching_proc have_mpx { remote_file build delete $obj + if { $status == 0 } { + verbose "$me: returning $status" 2 + return $status + } + + # Compile program with -mmpx -fcheck-pointer-bounds, try to trigger + # 'No MPX support', in other words, see if kernel supports mpx. + set src { int main (void) { return 0; } } + set comp_flags {} + append comp_flags " additional_flags=-mmpx" + append comp_flags " additional_flags=-fcheck-pointer-bounds" + if {![gdb_simple_compile $me-2 $src executable $comp_flags]} { + return 0 + } + + set result [remote_exec target $obj] + set status [lindex $result 0] + set output [lindex $result 1] + set status [expr ($status == 0) \ + && ![string equal $output "No MPX support\r\n"]] + + remote_file build delete $obj + verbose "$me: returning $status" 2 return $status }