From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id qVSkJ8p/QWmN9QMAWB0awg (envelope-from ) for ; Tue, 16 Dec 2025 10:50:34 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1765900234; bh=H6s5jyvnivLQnD+DLx+ouH+5P1yZMhyg8prq/x/WMNs=; h=Date:Subject:To:References:From:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=SRWmays+wq1Aj2RKitD/jdTLeh0zvy3ozmgqhqWhvwVmmaDTQd5AywXX7q0s8x/3P 08WfeXF40XfPPuu/X5JipB+ZAocFHT2CKuePXbpu+RTiP5KebXkK0Ru85uQTqXcDDu fXI6/ID6PsTNZCK8MFIBl+2rUdF651HaYge0tB/k= Received: by simark.ca (Postfix, from userid 112) id 9E2751E0BC; Tue, 16 Dec 2025 10:50:34 -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.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,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 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=simark.ca header.i=@simark.ca header.a=rsa-sha256 header.s=mail header.b=ZySpmCfF; dkim-atps=neutral Received: from vm01.sourceware.org (vm01.sourceware.org [38.145.34.32]) (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 EA67E1E048 for ; Tue, 16 Dec 2025 10:50:33 -0500 (EST) Received: from vm01.sourceware.org (localhost [127.0.0.1]) by sourceware.org (Postfix) with ESMTP id 7B13B4BA23D4 for ; Tue, 16 Dec 2025 15:50:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7B13B4BA23D4 Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=simark.ca header.i=@simark.ca header.a=rsa-sha256 header.s=mail header.b=ZySpmCfF Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id D15FF4BA2E34 for ; Tue, 16 Dec 2025 15:50:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D15FF4BA2E34 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=simark.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=simark.ca ARC-Filter: OpenARC Filter v1.0.0 sourceware.org D15FF4BA2E34 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=158.69.221.121 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1765900208; cv=none; b=DNUwN1ckMD3DWK7Dsdb+qiw5VKrkzXgxHIRmnN2yc8XBq5TYRrj4pbOV+tZbDH+lKRplYjs6DKT6+Iojna4nXcEGV0ETA3aDxSOrSsMktsreS9V3iY8Ihk1QmF4ak4NNzDmXAdjd7qrM/rhbFWzOatK9ii1JmdpuoTINFHAvWhQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1765900208; c=relaxed/simple; bh=H6s5jyvnivLQnD+DLx+ouH+5P1yZMhyg8prq/x/WMNs=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=cFcgMCtagXJtEZF9KkjOyNvlDmG75uZZenLLj3ywsc/PXfufEEseY8ahB6L8jWr3D2RhgsLFs1FtrgzcPgZHwGfwOog5NmRgLoMLc8iG21An/xIy/mn7BOkFE9GKAubwvrd95uaV4kExtEL4pgBdoqxhFFE2D3upQonmyYDnWcw= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D15FF4BA2E34 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1765900208; bh=H6s5jyvnivLQnD+DLx+ouH+5P1yZMhyg8prq/x/WMNs=; h=Date:Subject:To:References:From:In-Reply-To:From; b=ZySpmCfFDz1/SK1HsooDUO3p9iwz3rurXTfKy6YX27fn/4dHaeedu+nMK1OO4ndxx 6ZnBkTR4XEX1MjHIzQor+HhNnpIqO8GY72h4S0zk5i3obFsgg0FSvt5eXIJO0Nns2c htk5N8VFqzdQQQO1ouGPyHqVBfS1DeuKAgnUN3FQ= Received: by simark.ca (Postfix) id 2C1AF1E048; Tue, 16 Dec 2025 10:50:08 -0500 (EST) Message-ID: Date: Tue, 16 Dec 2025 10:50:07 -0500 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] [gdb/testsuite] Fix gdb.cp/typeid.exp with m32 PIE To: Tom de Vries , gdb-patches@sourceware.org References: <20251216134240.3843501-1-tdevries@suse.de> Content-Language: en-US From: Simon Marchi In-Reply-To: <20251216134240.3843501-1-tdevries@suse.de> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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 On 2025-12-16 08:42, Tom de Vries wrote: > On x86_64-linux, if I run test-case gdb.cp/typeid.exp with target boards: > - unix/-m64 > - unix/-m32 > - unix/-fPIE/-pie/-m64 > - unix/-fPIE/-pie/-m32 > for only target board unix/-fPIE/-pie/-m32 I get: > ... > (gdb) print &typeid(i)^M > could not find typeinfo symbol for 'int'^M > (gdb) FAIL: gdb.cp/typeid.exp: before starting: print &typeid(i) > print &typeid(i) == &typeid(typeof(i))^M > could not find typeinfo symbol for 'int'^M > (gdb) FAIL: gdb.cp/typeid.exp: before starting: print &typeid(i) == &typeid(typeof(i)) > print &typeid(cp)^M > could not find typeinfo symbol for 'char*'^M > (gdb) FAIL: gdb.cp/typeid.exp: before starting: print &typeid(cp) > print &typeid(cp) == &typeid(typeof(cp))^M > could not find typeinfo symbol for 'char*'^M > (gdb) FAIL: gdb.cp/typeid.exp: before starting: print &typeid(cp) == &typeid(typeof(cp)) > print &typeid(ccp)^M > could not find typeinfo symbol for 'char const*'^M > (gdb) FAIL: gdb.cp/typeid.exp: before starting: print &typeid(ccp) > print &typeid(ccp) == &typeid(typeof(ccp))^M > could not find typeinfo symbol for 'char const*'^M > (gdb) FAIL: gdb.cp/typeid.exp: before starting: print &typeid(ccp) == &typeid(typeof(ccp)) > ... > > This is yet another configuration for which these tests don't work. > > We're already allowing this for clang and istarget "powerpc*-*-*". > > I don't think there is value in trying to detect yet another configuration. > > Instead, just allow it in general. I don't know the history of this test. Why is the type info for these base types missing before running? Is it a compiler bug or feature? > diff --git a/gdb/testsuite/gdb.cp/typeid.exp b/gdb/testsuite/gdb.cp/typeid.exp > index e12b032f32b..58f0a928a63 100644 > --- a/gdb/testsuite/gdb.cp/typeid.exp > +++ b/gdb/testsuite/gdb.cp/typeid.exp > @@ -27,29 +27,35 @@ proc do_typeid_tests {started} { > # We might see the standard type or gdb's internal type. > set type_re "(std::type_info|gdb_gnu_v3_type_info)" > > - set var {ca b} > - set have_base_types 1 > - if {!$started} { > - if {[test_compiler_info clang-*-* c++]} { > - # Note that we test pointer equality rather than object > - # Clang doesn't place type information for the base types in > - # the executable, and relies on this being linked in from the > - # standard library. As a result, type information for these > - # variables is only available once the inferior is started. > - set have_base_types 0 > - } elseif {[istarget "powerpc*-*-*"]} { > - # On PowerPC, RTTI typeinfo for base types (i, cp, ccp) may not be > - # emitted until the inferior is started. > - set have_base_types 0 > - } > - } > - if { $have_base_types } { > - lappend var i cp ccp > - } > + # The typeinfo for some of these variables may or may not be present > + # before the inferior has started. Mark these by listing them in > + # maybe_missing_var. > + set maybe_missing_var {i cp ccp} > + set var [concat {ca b} $maybe_missing_var] > > foreach simple_var $var { > - gdb_test "print &typeid($simple_var)" \ > - " = \\($type_re \\*\\) $hex.*" > + set maybe_missing \ > + [expr {[lsearch -exact $maybe_missing_var $simple_var] != -1}] >From the comment, it sounds like the type info for these should be available once the inferior is started. So, should maybe_missing stay false if $started is true? > + > + set missing 0 > + set re [subst_vars { = \($type_re \*\) $hex.*}] > + gdb_test_multiple "print &typeid($simple_var)" "" { > + -re -wrap $re { > + pass $gdb_test_name > + } > + -re -wrap "could not find typeinfo symbol for '.*'" { > + if { $maybe_missing } { > + unsupported $gdb_test_name unsupported or xfail? Simon