From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id IXCHLmZ7GmkBuQoAWB0awg (envelope-from ) for ; Sun, 16 Nov 2025 20:33:26 -0500 Authentication-Results: simark.ca; dkim=fail reason="signature verification failed" (768-bit key; unprotected) header.d=tromey.com header.i=@tromey.com header.a=rsa-sha256 header.s=default header.b=nCN7OwNj; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id BA0691E0AB; Sun, 16 Nov 2025 20:33:26 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_INVALID,DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED autolearn=ham autolearn_force=no version=4.0.1 Received: from server2.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 ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 37DA81E08D for ; Sun, 16 Nov 2025 20:33:26 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id DAB583858C60 for ; Mon, 17 Nov 2025 01:33:25 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DAB583858C60 Authentication-Results: sourceware.org; dkim=fail reason="signature verification failed" (768-bit key, unprotected) header.d=tromey.com header.i=@tromey.com header.a=rsa-sha256 header.s=default header.b=nCN7OwNj Received: from omta040.useast.a.cloudfilter.net (omta040.useast.a.cloudfilter.net [44.202.169.39]) by sourceware.org (Postfix) with ESMTPS id 591143858CD1 for ; Mon, 17 Nov 2025 01:28:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 591143858CD1 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=tromey.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tromey.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 591143858CD1 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=44.202.169.39 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1763342899; cv=none; b=n4zBaOdm6mmCp8sK6R7y9svS48r47HKC2sj0OeFJymgIAtME2Dp19921S/lIuQd1HTme1AoDW6aQMct3WLuvhGFLUg+ub6a8TvG7yMvrCJ16f7fAIuCEXyUZUctKzIUVHHJmvMC8JqOPGBVugwS3X4E4wnKrDVAM/MXcGEQYX8Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1763342899; c=relaxed/simple; bh=MRpcmAv0GK/Ond7FqrqnYuTlCWCewhu+QK3bXtaQMyA=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=l15eQ1EWRpuCNriXiDL+b69wwYIJ+NumHp0hrTtxe4T/kuLKmEGNRcA0b+RPRCzm1UXaGLA2czqFrGPqJZKPeLVJbv1+TlxQ3UypdiQuJsTi0218/uCDlY/eUlSR+XGD1FOY9L6NSDPF1Pvk86u9N8/hW30/rUQ6LyAAlEVvtj4= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 591143858CD1 Received: from eig-obgw-5005b.ext.cloudfilter.net ([10.0.29.189]) by cmsmtp with ESMTPS id Klplv542hv724Ko2VvSuPx; Mon, 17 Nov 2025 01:28:19 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id Ko2Uvff85GzqvKo2Uv5tJZ; Mon, 17 Nov 2025 01:28:19 +0000 X-Authority-Analysis: v=2.4 cv=I5JlRMgg c=1 sm=1 tr=0 ts=691a7a33 a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=6UeiqGixMTsA:10 a=ItBw4LHWJt0A:10 a=KZ5T2YihgsUpGAlmDScA:9 a=VS4QxaUSPT0UtbFnIvSC:22 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=lbWF3r1lZ0JQQfGBpM3xUxua0ZMG3vc+PIp3xQmWYhU=; b=nCN7OwNj9wkRD2PKDYy4mlouwf XAoa5JjacPXpcwWsqSObUL3uwLNkhaUSq85cHBg8A4/YnM7ylnWvBe1i11Pey6s3SeUaKA5hn6LGm OHRlmEOQbJe6fy2guScVKkylb; Received: from 97-122-120-205.hlrn.qwest.net ([97.122.120.205]:41170 helo=localhost.localdomain) by box5379.bluehost.com with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1vKo2M-00000000Q3v-2W6w; Sun, 16 Nov 2025 18:28:10 -0700 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH 2/7] Make the gdb.objc tests compile Date: Sun, 16 Nov 2025 18:27:01 -0700 Message-ID: <20251117012752.2657208-3-tom@tromey.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20251117012752.2657208-1-tom@tromey.com> References: <20251117012752.2657208-1-tom@tromey.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box5379.bluehost.com X-AntiAbuse: Original Domain - sourceware.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tromey.com X-BWhitelist: no X-Source-IP: 97.122.120.205 X-Source-L: No X-Exim-ID: 1vKo2M-00000000Q3v-2W6w X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 97-122-120-205.hlrn.qwest.net (localhost.localdomain) [97.122.120.205]:41170 X-Source-Auth: tom+tromey.com X-Email-Count: 3 X-Org: HG=bhshared;ORG=bluehost; X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfI8pU4o/+XE6dYKWDXwjBrTIcpqUUTeMa58jjw7tk0pfcCZIBr5pCz5OqxpU/6k/LbLzAXnZa+05CxxVJagw2XhZ0q49piZGCg9spUo5t2p2j854BFyn XXs7yESpqZINkC2Jf/9GvXux/sj1ctRQH3wdMf4tnE/Av8xK7gBX+tSkEYTkZYwWAPoQZyhvYP+mNLIU55vKowSaZBwrmFphwdk= 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~public-inbox=simark.ca@sourceware.org The gdb.objc tests haven't compiled in years. This patch fixes this, based on a comment in bug 31671. I don't know whether this approach works with the clang implementation of Objective-C. However, it does work with GCC, provided that gnustep-base is installed. --- gdb/testsuite/gdb.objc/basicclass.m | 6 +++--- gdb/testsuite/gdb.objc/nondebug.m | 6 +++--- gdb/testsuite/gdb.objc/objcdecode.m | 6 +++--- gdb/testsuite/lib/gdb.exp | 10 +++------- 4 files changed, 12 insertions(+), 16 deletions(-) diff --git a/gdb/testsuite/gdb.objc/basicclass.m b/gdb/testsuite/gdb.objc/basicclass.m index d9b3f23954c..d1d54dfff19 100644 --- a/gdb/testsuite/gdb.objc/basicclass.m +++ b/gdb/testsuite/gdb.objc/basicclass.m @@ -1,7 +1,7 @@ #include -#include +#include -@interface BasicClass: Object +@interface BasicClass: NSObject { id object; } @@ -75,7 +75,7 @@ const char *_NSPrintForDebugger(id object) { /* This is not really what _NSPrintForDebugger should do, but it is a simple test if gdb can call this function */ - if (object && [object respondsTo: @selector(myDescription)]) + if (object) return [object myDescription]; return NULL; diff --git a/gdb/testsuite/gdb.objc/nondebug.m b/gdb/testsuite/gdb.objc/nondebug.m index 352a71c30e3..1ab876443a4 100644 --- a/gdb/testsuite/gdb.objc/nondebug.m +++ b/gdb/testsuite/gdb.objc/nondebug.m @@ -1,11 +1,11 @@ #include -#include +#include -@interface NonDebug: Object +@interface NonDebug: NSObject { } @end -@interface NonDebug2: Object +@interface NonDebug2: NSObject { } @end diff --git a/gdb/testsuite/gdb.objc/objcdecode.m b/gdb/testsuite/gdb.objc/objcdecode.m index a061661ed93..78ff301f3e0 100644 --- a/gdb/testsuite/gdb.objc/objcdecode.m +++ b/gdb/testsuite/gdb.objc/objcdecode.m @@ -1,7 +1,7 @@ #include -#include +#include -@interface Decode: Object +@interface Decode: NSObject { } - multipleDef; @@ -43,7 +43,7 @@ const char *_NSPrintForDebugger(id object) { /* This is not really what _NSPrintForDebugger should do, but it is a simple test if gdb can call this function */ - if (object && [object respondsTo: @selector(myDescription)]) + if (object) return [object myDescription]; return NULL; diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index 856c96771c6..97a9692b4ce 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -6884,15 +6884,11 @@ proc gdb_compile_shlib_pthreads {sources dest options} { proc gdb_compile_objc {source dest type options} { set built_binfile 0 set why_msg "unrecognized error" - foreach lib {-lobjc -lpthreads -lpthread -lthread solaris} { + set base_libs {-lgnustep-base -lobjc} + foreach lib {-lpthreads -lpthread -lthread "-lpthread -lposix4"} { # This kind of wipes out whatever libs the caller may have # set. Or maybe theirs will override ours. How infelicitous. - if { $lib == "solaris" } { - set lib "-lpthread -lposix4" - } - if { $lib != "-lobjc" } { - set lib "-lobjc $lib" - } + set lib "$base_libs $lib" set options_with_lib [concat $options [list libs=$lib quiet]] set ccout [gdb_compile $source $dest $type $options_with_lib] switch -regexp -- $ccout { -- 2.49.0