From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id iOUWIcsYf2eysgcAWB0awg (envelope-from ) for ; Wed, 08 Jan 2025 19:31:07 -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=GIWFXwuH; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 702821E0C0; Wed, 8 Jan 2025 19:31:07 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-5.1 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_INVALID,DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=4.0.0 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 7DEDC1E091 for ; Wed, 8 Jan 2025 19:31:03 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 13A4C3858D35 for ; Thu, 9 Jan 2025 00:31:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 13A4C3858D35 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=GIWFXwuH Received: from omta034.useast.a.cloudfilter.net (omta034.useast.a.cloudfilter.net [44.202.169.33]) by sourceware.org (Postfix) with ESMTPS id 1C6F03858D29 for ; Thu, 9 Jan 2025 00:30:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1C6F03858D29 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 1C6F03858D29 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=44.202.169.33 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1736382619; cv=none; b=UiK4ur5bHUxtuOmJlyCeIYd3FtbvPP2AfctLQngmDk2FY7Y9Hy2q1xrWeOIPTMxxxTE+vMMZGYAyzJaz1v3PFItXKHNW0nrR84g0C9oQcdL5qSulxTBY1Cqn2MFbPG6/bJAngYenUfu/DOJgLXsO9ZdkGqcCdGtlCMSpWYUZD+4= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1736382619; c=relaxed/simple; bh=fkQjIBjV8LWlsxa+deTCTbls9XQYzrnHii5sOkNvILw=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=akqUnXaHlM521LNeVbvnEFyCVLoSDstvXhblEDC34saERBtAMcm++5JvY6lOoJc3Gi016xhVnGt46uFU6E3Xux/j5EsDprTFnSrLJ2J9X0QvNhAyWNzOW2X7ttn/00ue71XgERGYoZgM48IedntFri9ZJ15XUj2JHkQtv5wLASI= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1C6F03858D29 Received: from eig-obgw-6006a.ext.cloudfilter.net ([10.0.30.182]) by cmsmtp with ESMTPS id VYyDtshmRrKrbVgRGtlJtP; Thu, 09 Jan 2025 00:30:18 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id VgRFtnAGkhhqDVgRGtkqeL; Thu, 09 Jan 2025 00:30:18 +0000 X-Authority-Analysis: v=2.4 cv=XeiPzp55 c=1 sm=1 tr=0 ts=677f189a a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=IkcTkHD0fZMA:10 a=VdSt8ZQiCzkA:10 a=ItBw4LHWJt0A:10 a=Owld7cy60idD_prpOSoA:9 a=QEXdDO2ut3YA:10 a=6Ogn3jAGHLSNbaov7Orx:22 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID: Date:References:In-Reply-To:Subject:Cc:To:From:Sender:Reply-To: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=JhZS1hfrnkvtrILgmFD9KLyHknvbIWnxm+DJnhDbUKY=; b=GIWFXwuHvmbJNCMiocuZ+sbgCA fNQ179mx+1uHGRe1d+YwelE6NnWejYjDsIYFuB/+jKxAvB2gdIdhWCqcMoLNIyvEmSTshIgJMxj9o lqW1T47fNmpRJqFZWUIWSM2Do; Received: from [50.214.9.178] (port=34696 helo=prentzel) by box5379.bluehost.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96.2) (envelope-from ) id 1tVgRF-000KAZ-1b; Wed, 08 Jan 2025 17:30:17 -0700 From: Tom Tromey To: Jan =?utf-8?Q?Vran=C3=BD?= Cc: "gdb@sourceware.org" , "tom@tromey.com" Subject: Re: Question about struct type* ownership In-Reply-To: <078460761931d0f4a1574e18173e51464ee4ccb2.camel@labware.com> ("Jan =?utf-8?Q?Vran=C3=BD=22's?= message of "Wed, 8 Jan 2025 13:32:33 +0000") References: <078460761931d0f4a1574e18173e51464ee4ccb2.camel@labware.com> X-Attribution: Tom Date: Wed, 08 Jan 2025 17:30:16 -0700 Message-ID: <8734hsx207.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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: 50.214.9.178 X-Source-L: No X-Exim-ID: 1tVgRF-000KAZ-1b X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: (prentzel) [50.214.9.178]:34696 X-Source-Auth: tom+tromey.com X-Email-Count: 5 X-Org: HG=bhshared;ORG=bluehost; X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfIhWGDVJ2pgf/fykSYjsBZqlyh9IEjNy68EFcGngSEYZh81mScGmeqRnAy3nPhOvyM+wAwqydWoZu2bVsT63Dym5BIzP4bqwp+fqw+nH68l4+8uhKE/b +aH0IGFa+4zj/wDf11PEKZaP1Y+3fKmmQIzJdPkQADGJB7IS0d/N8zf41nifOsUPb1pjxlc/gF3bBw== X-BeenThere: gdb@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-bounces~public-inbox=simark.ca@sourceware.org Sender: "Gdb" Jan> Let's say I'd like to create new function type "int(struct s)", where Jan> type "int" is arch-owned and "struct s" is objfile-owned. Am I correct Jan> thinking that resulting function type should be objfile-owned?=20 Yes, in particular by the same objfile that owns "struct s". Jan> Generally speaking, if composing new type out of other types, if at Jan> least one of the types is objfile-owned then the new type must by Jan> also objfile-owned (by that very objfile), right?=20 Yes. Jan> Looking at lookup_function_type_with_arguments, it allocated new Jan> function type is always "owned" by whoever "owns" the return type Jan> (first param to lookup_function_type_with_arguments). So if I'm correct Jan> about the above, I'd have to extend lookup_function_type_with_arguments Jan> to pass down type allocator (like in create_array_type). Or is there Jan> a better way? It's new territory, so just whatever looks reasonably clean. I think in the past this wasn't an issue because essentially only symbol readers made types. Jan> Also, when experimenting with the example above, I realized that=C2=A0 Jan> the arch-owner of "int" struct type* is a different struct gdbarch * Jan> then gdbarch associated with objfile-owner of "struct s" type Jan> (i mean, pointer values are different). Jan> While I would think it is okay to compose new type from types owned by= =C2=A0 Jan> two distinct gdbarchs from lifecycle POV, it still puzzles me why Jan> there are two different gdbarch instances (both are i386:x86-64)? Offhand I don't know but there are a lot of ways a gdbarch can be initialized. Maybe they have different registers available. Tom