From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id /CtvGaiBiWDlKQAAWB0awg (envelope-from ) for ; Wed, 28 Apr 2021 11:39:20 -0400 Received: by simark.ca (Postfix, from userid 112) id 5ABB31F11C; Wed, 28 Apr 2021 11:39:20 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,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 25AA81E01F for ; Wed, 28 Apr 2021 11:39:19 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 95B6F393D024; Wed, 28 Apr 2021 15:39:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 95B6F393D024 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1619624358; bh=nZ4NYbYnRjDSdzgMuUtC6rHvW5rQQeWmaEC6nqhQEiw=; h=Subject:To:References:Date:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=IuaVHFiACs1AhB7dV9SpPbcatpyEC/AcI/KJrbnR9COQU171rvzwEm91LFR0lhtvY yCqOt35U7WD03Ycm0HAOjOoONBlAXvaCm6R/k2BHOcIK+Rtrmy877fdthdMmQIukgx 5av7PYHKnK8nUx5H01J+epv9LihqmAC6PiH1m+eE= Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2080.outbound.protection.outlook.com [40.107.92.80]) by sourceware.org (Postfix) with ESMTPS id 80DC9393D00B for ; Wed, 28 Apr 2021 15:39:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 80DC9393D00B ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EzSPQ5GU3HUoTZf6OqEoxmBUyJdsD52ebZ2pge0QgV3pIYOFmsAIZIB1pUsuSf/xy+eUdkFwD5J8KfI+yFwQlZdF12qNy/8o0wddEwZJdFgE8Fncof52TQ+1jttA+UhmN5BZfaN9c72ICS3lTU/20ggSUBBbcReoXscm95qKnyVMgVSPRhn8cLGK6JLABrxKQFUXz/mLr0N3KIuShorY82tjLJlfYm5krIkVt/YgKmjUhHZeJX6Z7N7ckkkUfpLzP4F6QT4V8Od7XtWsaq3Tnh/hJDrmDppVbDKgzQ0gJfvLA9kI1BhthI8d2MOAXp2GJKRrNutjwcbJHupb63ZIpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=nZ4NYbYnRjDSdzgMuUtC6rHvW5rQQeWmaEC6nqhQEiw=; b=CN8kVmNDRFTVvj52Qy83UcJ++9G32r2JzVdvVFqvvgmhF/S4fmulwLeyjEV7EMx04fgBT4nLmZauvaqh8JZh6h0noiyjdWgbpnUusq/TIcqdq4Ag7bYCE+DR8U0UUwc6612xmENTfzPyAOnfoDr8t0iZuZbNAo0JiCg3tF41cbcwmVvXN55DTQ/k5CQPBKvfx8tAb0mlAJ48Bg25a/3HJCTeJwWr/VGmFBGdLQfu8vHZWVYpmgMKUMPXkPA2kYAIdubIo3uT60nULWI3TObBQf4gnapn06MFdTHdV4dGk55nSe1zWGkAuTGXkSC8gwdk03qvy7FvXFYtDQ1sATlWfw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none Received: from DM6PR12MB2762.namprd12.prod.outlook.com (2603:10b6:5:45::15) by DM6PR12MB4779.namprd12.prod.outlook.com (2603:10b6:5:172::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4065.21; Wed, 28 Apr 2021 15:39:14 +0000 Received: from DM6PR12MB2762.namprd12.prod.outlook.com ([fe80::49d0:1ee5:47ef:e0e5]) by DM6PR12MB2762.namprd12.prod.outlook.com ([fe80::49d0:1ee5:47ef:e0e5%7]) with mapi id 15.20.4065.023; Wed, 28 Apr 2021 15:39:14 +0000 Subject: Re: [PATCH 16/43] Simplify dwarf_expr_context class interface To: Simon Marchi , gdb-patches@sourceware.org References: <20210301144620.103016-1-Zoran.Zaric@amd.com> <20210301144620.103016-17-Zoran.Zaric@amd.com> <94a19b5a-1e38-53af-8b96-956f138f8303@polymtl.ca> Message-ID: Date: Wed, 28 Apr 2021 16:39:09 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.9.1 In-Reply-To: <94a19b5a-1e38-53af-8b96-956f138f8303@polymtl.ca> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [2a00:23c7:5a85:6801:f5b0:44e8:2b3e:76c1] X-ClientProxiedBy: LO4P123CA0260.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:194::13) To DM6PR12MB2762.namprd12.prod.outlook.com (2603:10b6:5:45::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from [IPv6:2a00:23c7:5a85:6801:f5b0:44e8:2b3e:76c1] (2a00:23c7:5a85:6801:f5b0:44e8:2b3e:76c1) by LO4P123CA0260.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:194::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4087.27 via Frontend Transport; Wed, 28 Apr 2021 15:39:13 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 239302b9-2355-48f1-731f-08d90a5bc69b X-MS-TrafficTypeDiagnostic: DM6PR12MB4779: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:9508; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: OLQ0b3pFwPUC7d4wN7fkFXhcNmt5yWH+hCrZvLpoZtSyn/qCR73xZgINwPqCoybjs9Xtuh0ivHn2X5duqb2p63UPtfe6GlwdGJavgOfzS/+s9PeftVTbB/uJmE9/68rQr69Wgv0ThpiST5MI9NN2SJoNQ0O9xp/dwqNIYtMhSPi7GsbhgybofyRTiD7AgJWJdD6q/XQDwwRVlqDVeulAyQG4Pzq4ubAKTfYbnoptEwwqkV6beoc+aPbDiIwaO9DEM1LzuTVzrgMpPU9l/Qc5YMbM/i50K8AKt2SERptRkm1mV6KVnbBqfkzqaMaKNgozEQtK8kpImDBZ19l9SGShu5zUARdvW25HKq/Kv+bsSpcynYGx7vPANEv8ORkZOeXc8HdejpiksMmzbJ12LOiK6XxD/GRbmmxM9HWoO7YtaFvPsF1zUIDBs9vqQy07L0mSbwx3eaPXg7bm4s1C6iEBSixxngmpx17tDeJHym0IFOsunwtTbTtujnAaCyC/0mg63kngqxNrZIBM9KuB2rHgI6Dpv5rNnwe8S7FcCat1CGcIUZL6yFVX576qdNDXF3JkAEP4W6eMBys3Q7gx0iBITuFu3nlUslC33aTPaE+Me33G33nbo+/HOIhBtgTZ/IDHUbUvDwaEwaZ+EjWR0GXhPnYysqHzm6d76vHkJiNqR/lsQFfitF0z0r5D2qcOHQ1e X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR12MB2762.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(396003)(346002)(366004)(136003)(39860400002)(376002)(52116002)(6666004)(31696002)(2906002)(6486002)(478600001)(66946007)(38100700002)(8676002)(86362001)(31686004)(66556008)(316002)(16526019)(5660300002)(66476007)(186003)(36756003)(2616005)(8936002)(43740500002)(45980500001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: =?utf-8?B?RU0rTm9mWHlremRJeVZTY1FxTU9Ed2l2N1kwY3NpUjFMbVhLdEppNnZTUzZi?= =?utf-8?B?U1FLdW54SFdpNlQ0eWxPNTJ0bTRINFg2V0FiS2haUkppSlhXZ3Fzd1ZtQ29D?= =?utf-8?B?ZFpWZkIxYjF4TWF3SFZwSk9DWWVYWVdwVU4yQ2RhbWVpS2JIaGtubDhzdGtO?= =?utf-8?B?bUJsNXJzbEJXMGozTTJrTE1pREhhNi9KQ243N1JwN0VGVkFUMW9Ea1FGZHVC?= =?utf-8?B?Yld3c2Ixd0ZoSng1RzU1ZDhIL3J4NTllcUIvWjR2WUVwblMwdk1JUFlmZlBK?= =?utf-8?B?R1NUejVjUW5UbWlRdzZRRjFnK0ZibVFKb2dWams2SUhuWFl1UFpvVEFGRGh2?= =?utf-8?B?OWdBdkl5SG5xN2ZUcm1xYXh3NmVHQXhJd3BkSVRMelgrQkVGM0xCV3hIcmVB?= =?utf-8?B?SC9QTzBOWDNIWmNvWVlrcUlUbXNuWnIwWWpldmx5aGJkWnk2dERmL3o3ZE5I?= =?utf-8?B?WVhwWHZNZWJlNkZwbXZORDB5U3JpWlBDeWw0aHNiSUFnR0Z4NWZ2cTl0a1Vt?= =?utf-8?B?QkpTUUNERWxpelI3OFFEdVVSZmwxZ1FJSkprUjdHQTJYeHNlUDNwa1I0Z29P?= =?utf-8?B?WUNKSWF1K01XTlltb2MzWkdnUzZTcG43cmM4cXNJLzZpdFgyR3o3RUFQcHpS?= =?utf-8?B?OVY0R2VmZjJIU1lUY0p0SDRCc0p2cWJVZERsTExnaGlva1NKWEh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TmU1SkFrUUNwem9QOXRrSXV0WDdDMHN3dy9w?= =?utf-8?B?MFNvWDhLaFRDWTYyUGJKV0h5Zlo0NDJsTEx2UkRpSVp4REs3cGpFN00wYS9J?= =?utf-8?B?eDZkUUJQSVJRanR1d2JLU2FNN0UvZklpakk2ZDdCZDZ2WHhReHBPL1FhQk0z?= =?utf-8?B?SzA2N05NZVNsVGtzUDhsY2plSm9hdmZPSnZaU3RKeTM4NzduQjBlRkRmVVQx?= =?utf-8?B?ZzFxL1BCcW0xaWpxWHJ4SEw1SytrT29ySkVQM3JFVnUzSkY2WXAxWHNWQ3B2?= =?utf-8?Q?qxbr6jwUoD7xQ?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 239302b9-2355-48f1-731f-08d90a5bc69b X-MS-Exchange-CrossTenant-AuthSource: DM6PR12MB2762.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Apr 2021 15:39:14.0903 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: ifgHUsAZvP09YN0C23rKTCfB53a9g8mgoHX2Y461tbnllobPTKsYB4p5U45Z1YtScOMlJ59gH3nKMQCxW88q5g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4779 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: Zoran Zaric via Gdb-patches Reply-To: Zoran Zaric Errors-To: gdb-patches-bounces@sourceware.org Sender: "Gdb-patches" >> >> This was more me venting about that particular design choice > > Haha, it indeed did feel this way. > >> because the reality is that an address size has to be consistent with what is defined in the original object file but there is no interface to always get it in a clean way in gdb. > > In this case, it looks like it's because an expression can come from a > DIE attribute, directly linked to a CU. So the address size comes from > that CU's header. And at other times, the expression comes from a frame > description entry (FDE) / common information entry (CIE), so the address > size comes from that CIE's header. So I don't see any other easy way than > making the caller provide it. > >> It makes sense for me to remove that comment altogether in the next iteration and thing about a future change that would clean it up. > > Ok. Or, just make a simple comment. You could say that ADDRESS_SIZE is > the address size coming from the CU's header or the CIE's header, > depending on the context. Right, but all these sources come from a single object file and by the standard they all need to be consistent, otherwise things couldn't really work. > > Anyway, this is all perhaps subject to change if I understand correctly. > In the end do you still expose a class, or just one function, to > evaluate a DWARF expression? > > Simon > Right, and ideally, because the per_objfile always has to be present, it would make sense that it also contains the address size information that should get it from any header that is present in that objfile and if there are more then one, they should all be consistent. Does this makes sense? Zoran