From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id USn6Jy6FQWmX+wMAWB0awg (envelope-from ) for ; Tue, 16 Dec 2025 11:13:34 -0500 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=EYEn2cmh; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=KjnrKUkM; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=EYEn2cmh; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=KjnrKUkM; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 9C37C1E048; Tue, 16 Dec 2025 11:13: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 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 B50761E048 for ; Tue, 16 Dec 2025 11:13:33 -0500 (EST) Received: from vm01.sourceware.org (localhost [127.0.0.1]) by sourceware.org (Postfix) with ESMTP id 494934BA2E1E for ; Tue, 16 Dec 2025 16:13:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 494934BA2E1E Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=EYEn2cmh; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=KjnrKUkM; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=EYEn2cmh; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=KjnrKUkM Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) by sourceware.org (Postfix) with ESMTPS id 1AC2E4BA2E04 for ; Tue, 16 Dec 2025 16:13:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1AC2E4BA2E04 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 1AC2E4BA2E04 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=195.135.223.130 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1765901585; cv=none; b=GgeGmaeohSJHIQ0h+Nctrn9V9+zS8u9pWXMK5TKPfAnKBQRW2F/Zf7ajj/TqEnPvQEsn+Ohwpe6DxgdenCb3uxBZTSHGMAIOo4mi9SMz5d0hCzOzIpB5134/y6uKLbcnFI6oXDmxNuhqug9vqF//ZBYBmSPWq/pyLZrcO5jiDcQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1765901585; c=relaxed/simple; bh=t0juCVDVq5C9Xrnd+hDaiZdfePsd0AhV9dFmDMwqFRs=; h=DKIM-Signature:DKIM-Signature:DKIM-Signature:DKIM-Signature: Message-ID:Date:MIME-Version:Subject:To:From; b=voeVWcXr3Bn7qyTL48q8czsENgYwA+Jaq9j6V+pd5SWr2sEbyr50tRwB2X2T4YBwKLvM/t5cakmpZ+fFkG3KUTbuXbSvKuudIv/SP0ryNfQYysMgi79nlmAJaf1bw4w5kR9rOor8pXlc+rkWeJ8tdyBcIQFwxZ8fzI9Nm0FgNqk= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1AC2E4BA2E04 Received: from imap1.dmz-prg2.suse.org (unknown [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-out1.suse.de (Postfix) with ESMTPS id 29EA6336F6; Tue, 16 Dec 2025 16:13:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1765901584; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=8hB82kUnFuJ4B4iUYBor1xFfHGnzYJIcDv1Y8RDehPQ=; b=EYEn2cmhk1+BWRgi8XR1ciD6a1ywB5G2Vj9upnRj8ZfQOnOLElLvuez0GgxsTABFxB+n26 sUDSp319GwxBIGwP4Vq/HuVsMS4s7cxTOl69DU9BXS0lFKQn/KfbbO2+6NC9eNsvJWmAi2 +eisiAmb50QQhNSeeCPSaJskvj65upI= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1765901584; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=8hB82kUnFuJ4B4iUYBor1xFfHGnzYJIcDv1Y8RDehPQ=; b=KjnrKUkMsd9vYPBFUKoPgtjZpcYym3T3MjVkb621NxnP6B3irMX/sTofZ5F+Af0lqWJbwz eVThgWwNxircNRAw== Authentication-Results: smtp-out1.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1765901584; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=8hB82kUnFuJ4B4iUYBor1xFfHGnzYJIcDv1Y8RDehPQ=; b=EYEn2cmhk1+BWRgi8XR1ciD6a1ywB5G2Vj9upnRj8ZfQOnOLElLvuez0GgxsTABFxB+n26 sUDSp319GwxBIGwP4Vq/HuVsMS4s7cxTOl69DU9BXS0lFKQn/KfbbO2+6NC9eNsvJWmAi2 +eisiAmb50QQhNSeeCPSaJskvj65upI= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1765901584; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=8hB82kUnFuJ4B4iUYBor1xFfHGnzYJIcDv1Y8RDehPQ=; b=KjnrKUkMsd9vYPBFUKoPgtjZpcYym3T3MjVkb621NxnP6B3irMX/sTofZ5F+Af0lqWJbwz eVThgWwNxircNRAw== 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 0B83C3EA63; Tue, 16 Dec 2025 16:13:03 +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 2v80Ow+FQWmRKwAAD6G6ig (envelope-from ); Tue, 16 Dec 2025 16:13:03 +0000 Message-ID: <366d1b78-aa6c-4279-bf88-931b6ee687dc@suse.de> Date: Tue, 16 Dec 2025 17:12:59 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] [gdb/testsuite] Fix gdb.cp/typeid.exp with m32 PIE To: Simon Marchi , gdb-patches@sourceware.org References: <20251216134240.3843501-1-tdevries@suse.de> Content-Language: en-US From: Tom de Vries In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spamd-Result: default: False [-4.24 / 50.00]; BAYES_HAM(-3.00)[100.00%]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.14)[-0.724]; MIME_GOOD(-0.10)[text/plain]; RCVD_VIA_SMTP_AUTH(0.00)[]; FUZZY_RATELIMITED(0.00)[rspamd.com]; ARC_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; MID_RHS_MATCH_FROM(0.00)[]; RCPT_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo,suse.de:mid] 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 12/16/25 4:50 PM, Simon Marchi wrote: > > > 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. > Hi Simon, thanks for the review. > 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? > I don't think it's either, AFAIU it's an implementation detail. I suspect in this case it's related to relocations. But in general, there's nothing that mandates that type info needs to be available before starting an executable, so it's just a YMMV situation. >> 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? > Yes, thanks for catching that. >> + >> + 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? Unsupported. It's not an xfail because the environment is doing nothing wrong. Thanks, - Tom