From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id uJ2lNDiekV/zPwAAWB0awg (envelope-from ) for ; Thu, 22 Oct 2020 10:59:04 -0400 Received: by simark.ca (Postfix, from userid 112) id C9C591E89B; Thu, 22 Oct 2020 10:59:04 -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.0 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,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 496B51E552 for ; Thu, 22 Oct 2020 10:59:03 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 8DE20386EC23; Thu, 22 Oct 2020 14:59:02 +0000 (GMT) Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2076.outbound.protection.outlook.com [40.107.94.76]) by sourceware.org (Postfix) with ESMTPS id 1FE2B3861925 for ; Thu, 22 Oct 2020 14:59:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 1FE2B3861925 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=amd.com Authentication-Results: sourceware.org; spf=none smtp.mailfrom=Zoran.Zaric@amd.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=W2/Y7BWFPTV9m7THbMqGeYs73O+SNex4DZhgKzbhdpHovSXtLG+npid+qJsEpBKBvfZJU1BJHZh93jcsBIqJlXVyLS2WNkmxBT+CWUPtpg9WrA7NEC/yUb1EJkOyYQicXfkcmvaaA2V6kH8A6cDqwKq3J2CCA7zsNPUTNV//v38Bn2HtatH0jx7d81NELpB3VC/mi5EVbqy6a5hsQOrDRif5P+/VjjDyKosdaktzPaSepS2m7qnUJxz0i8cvBL4/zDgKvq197yCOxSYJKvEbsdR4dG9O+4EL0N/it/NcG2xaC8eaUjv+iysZb+5ErfLkASTzWuy4BUSt1L79WEaQsw== 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=Ctf4CjkWb8demncPqfe50EVkCtXo6DyBv77anyjHmaI=; b=kfeLpxwSjkjZnXHcXkHaYduhH+/8bfTC3VKgLQowVsfcSGhdYP8Q/b1QsY4/4bHYK+lkLHNW4KpgBEcZegEixjxb+rWbRnCfp3zLYDPM6Uc9DlHBbs7VmMjKvPgg1YwO/ebVPvkIhrG/JxiJkF1Uk2G16ETGTb1iYnyk2h42iLapTKHXnjvlO4wl6Os+kPTj0eJtorE04PKDYOW5q+80I8sJ8U8DlNR9BtWoq5IaNTkgvSX4rpwEcsszQXrZ2XssJ8gxC48cBPqgCPfjALeWsxCVW1jamHbkSxMwFSFAi4vomgmYmQRAUtQbkHCYDFfGPCOrzzCvE+BYqy0Xq817+A== 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector2-amdcloud-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Ctf4CjkWb8demncPqfe50EVkCtXo6DyBv77anyjHmaI=; b=xIE3ORXJaa+3WK2jfPHMdqqsfqs1WCYfw5rwGgOEowGHR8sHCzTfIf7MV/G1os4krOflTh25XQqZQH07s0za7Ols0dW5Sec/FuPz3G153oPcXHF+G59I/ANp4Q4RRx9bJSMPdq68D18aCQ9foZEryxYM47WrgcDZYA0HHZbgFc4= Received: from DM6PR12MB2762.namprd12.prod.outlook.com (2603:10b6:5:45::15) by DM6PR12MB4468.namprd12.prod.outlook.com (2603:10b6:5:2ac::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.18; Thu, 22 Oct 2020 14:58:58 +0000 Received: from DM6PR12MB2762.namprd12.prod.outlook.com ([fe80::d85e:8fb6:ec3c:755]) by DM6PR12MB2762.namprd12.prod.outlook.com ([fe80::d85e:8fb6:ec3c:755%4]) with mapi id 15.20.3477.028; Thu, 22 Oct 2020 14:58:58 +0000 From: "Zaric, Zoran (Zare)" To: Tom Tromey Subject: RE: [PATCH v2] Replace the symbol needs evaluator with a parser Thread-Topic: [PATCH v2] Replace the symbol needs evaluator with a parser Thread-Index: AQHWnM8BS9sMk1Du9UuvdFT6FSm/xamime/mgADkCGA= Date: Thu, 22 Oct 2020 14:58:57 +0000 Message-ID: References: <20201007172613.21868-1-Zoran.Zaric@amd.com> <87imb3gvvc.fsf@tromey.com> In-Reply-To: <87imb3gvvc.fsf@tromey.com> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_76546daa-41b6-470c-bb85-f6f40f044d7f_Enabled=true; MSIP_Label_76546daa-41b6-470c-bb85-f6f40f044d7f_SetDate=2020-10-22T14:58:51Z; MSIP_Label_76546daa-41b6-470c-bb85-f6f40f044d7f_Method=Standard; MSIP_Label_76546daa-41b6-470c-bb85-f6f40f044d7f_Name=Internal Use Only - Unrestricted; MSIP_Label_76546daa-41b6-470c-bb85-f6f40f044d7f_SiteId=3dd8961f-e488-4e60-8e11-a82d994e183d; MSIP_Label_76546daa-41b6-470c-bb85-f6f40f044d7f_ActionId=c81abb26-5522-48a7-8e7e-00001d977985; MSIP_Label_76546daa-41b6-470c-bb85-f6f40f044d7f_ContentBits=1 msip_label_76546daa-41b6-470c-bb85-f6f40f044d7f_enabled: true msip_label_76546daa-41b6-470c-bb85-f6f40f044d7f_setdate: 2020-10-22T14:58:51Z msip_label_76546daa-41b6-470c-bb85-f6f40f044d7f_method: Standard msip_label_76546daa-41b6-470c-bb85-f6f40f044d7f_name: Internal Use Only - Unrestricted msip_label_76546daa-41b6-470c-bb85-f6f40f044d7f_siteid: 3dd8961f-e488-4e60-8e11-a82d994e183d msip_label_76546daa-41b6-470c-bb85-f6f40f044d7f_actionid: e89dc1cc-e603-4cee-a92a-00000002ca39 msip_label_76546daa-41b6-470c-bb85-f6f40f044d7f_contentbits: 0 msip_justification: I confirm the recipients are approved for sharing this content authentication-results: tromey.com; dkim=none (message not signed) header.d=none;tromey.com; dmarc=none action=none header.from=amd.com; x-originating-ip: [188.2.8.215] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: bb42dfce-d1a0-4fc4-d98e-08d8769b013f x-ms-traffictypediagnostic: DM6PR12MB4468: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:10000; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: dwRWvRyrzqZ/cDFRTpOyFjVPWKiKrAYES2yhJI7MU/SwxvaPoynSy1ZYrnsXy7UMeHOKptjO1wcRyij4FEnxuuX6CYBlvtC/KkNE/mjprAr/B1LKEn5rvAKY286SiAu9WgtuUtrQtF6SFuNtevYysnJEYc+D6kJrzNc1PullrzyLuObOm3wkVdzdLOYxXBqxTbooDuwF+qcZmp/iebIjheZjHWTvx5I6UG4bkQhE0byYWpOz97XRZjFKOSniQuyJYmaa2tPoSj+JUpcu7mBG65sIJJLeKVvv7xe/Hr3b3ymiSCsbMeet+Q8wUHJ1vPp3751in7RiTTsatUekkeOaAiDGA1NREHe2neM5+ur/6c2DbWpo6Lcwc/Vyo1Mg9G/bTZEQnWe5skdA8wsEGJxw2g== 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)(376002)(346002)(366004)(396003)(136003)(39860400002)(186003)(966005)(26005)(316002)(6506007)(4326008)(478600001)(7696005)(86362001)(33656002)(2906002)(76116006)(71200400001)(52536014)(9686003)(8936002)(6916009)(8676002)(55016002)(66556008)(64756008)(66446008)(66946007)(5660300002)(83380400001)(66476007); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: w/FEk2kJvaiNtqKwyg/M80a5oQVErEIXBeKUVzW01Fzx37RlYdjh2QWAwEPNjXmDyZXpIkExMZzg7VnlvPeQAbwQDAIbrlyfLa0xcozCNrzYhcNbZTyu23uA5j0RG80iVD6OYeqPDoyuyZ8yeqQckFp4/lN9icPJAg9HJbo1Rvz+1FBkJtng8Np/aC2C6RfMESJ16YT7TI3175uvBoMNsm7ORnBNNj5wJFI3FR8f53/7xNSO4VG42BR4N1JZEfb7KdaWbTfTL1iaHlwVGRQhF9flfUJOFc9FD4zQAuOAXyAVubJigU5PImDNdwrWdCTMMTF7CNfi5EIqVyZwduDgveEpbMqziQQMi7HP01+Uzd5IYabHZrtPxS4/KuFcDctRwThqqFben9nCnUjlA0UIzqHlN0u2+2aYN7/9czKC3bgk9c7c01dODXSfNzBZ9PuxmqK9DW91S1qOQbgsjZ6lDjvtaKopJePUHZ3HpF2a2CkuHstxOh0IOr3FgKkUerCbEpSdNJdUkX1QSsbDVahOHSzyhD7fkUNarc9WGxp4VFB5wHi29dztxKf/byEdLLKMNg4tcnohG/zrFtlXpn0F6/MB0r0rpzFc67yiXgkyrDZb0jeH5AZoU92t9so821BhxK3bufoetDyIiLHFm8eEHg== x-ms-exchange-transport-forked: True Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM6PR12MB2762.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: bb42dfce-d1a0-4fc4-d98e-08d8769b013f X-MS-Exchange-CrossTenant-originalarrivaltime: 22 Oct 2020 14:58:58.4506 (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: mHAd5P1qCPes5Qgl6EB4hB4s6Bjw2RJQ/wVBhFOLoz3uC9edVKkNrrNeMXPtU1sbLAUNe0DUBpm2NDWVzH7zPA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4468 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: , Cc: "gdb-patches@sourceware.org" Errors-To: gdb-patches-bounces@sourceware.org Sender: "Gdb-patches" [AMD Official Use Only - Internal Distribution Only] Thank you for looking at my patch Tom. I realize that I am new here and that might make some reviewers a bit reserved. > From: Tom Tromey > One question I have here is whether we even need this symbol-needs-frame > stuff. What if, instead, we just had gdb throw an exception in the situa= tion > where a frame is needed but not available? Then we could get rid of the > asserts and gdb would simply print an error rather than crash. >=20 > Can you look to see if that is feasible? The main advantage I see here i= s that > this approach would avoid the problem we sometimes have of updating one > DWARF expression-decoder and then forgetting to update the others... I've spoken with Pedro Alves and Simon Marchi about this and the difficulty here is that both "python" and "scheme" interfaces expose this functionalit= y to the user.=20 Another concern is that symbol_read_needs check is sometimes used as an optimization of sorts to determine if the lexical block for a given symbol needs to be tracked or not. My fear is that replacing all of these use cases with a call to the full evaluator would be unacceptable overhead. That being said, I am currently working on a patch series that I am planning to submit soon.=20 The idea is to change the design of the DWARF expression evaluator so that it throws an exception based on a context requirements of a given operation. Without going to much into details here, this new approach will remove certain context restrictions that currently exist for standard DWARF (like using composite location description in CFI) and allow=20 implementation of future DWARF extensions for better support of optimized code debugging. More on this work can be found here: https://llvm.org/docs/AMDGPUDwarfExtensionsForHeterogeneousDebugging.html In the same way, this new implementation can be used to remove the symbol-needs-frame stuff, if we decide that the benefit of having this check (instead of full-fledged evaluation) is not important. > What I did in gimli is have a parser that converts the DWARF expression t= o an > internal form. Then users of the API can decide how to manipulate this f= orm > -- dump it, evaluate it, etc. This separates the low-level parsing bits = from the > decisions about what operations to perform. I like this approach, but it does require a bit more analysis of the existi= ng DWARF handling infrastructure, because at the moment it is all over the pla= ce. Thanks, Zoran