From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id X90MC2umrV93WQAAWB0awg (envelope-from ) for ; Thu, 12 Nov 2020 16:17:31 -0500 Received: by simark.ca (Postfix, from userid 112) id 20A031F08B; Thu, 12 Nov 2020 16:17:31 -0500 (EST) 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 C124E1E552 for ; Thu, 12 Nov 2020 16:17:29 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 4D70139FF078; Thu, 12 Nov 2020 21:17:29 +0000 (GMT) Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2075.outbound.protection.outlook.com [40.107.236.75]) by sourceware.org (Postfix) with ESMTPS id 0BCD739FF077 for ; Thu, 12 Nov 2020 21:17:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 0BCD739FF077 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=YNuWHZSRSckmB+WebFg5aB1CSVpOB6P3mdDpxWdVPOizpvrWcV0ywDb/jqTgCD8mPIhyZjLm6U1YpLIs7tpCsIblfBaR80omQpJzeha7lycohq81bs8MxEpedtcjsNCOtoI2cVB/eNhgdn3qL1lp+sTS4xqIT2etPIR3ne9z4dlfeDaeIS5pxMkLIDSsndvse0ecVkt9tQu7933JRh//NmEyclziEgsY++Yv+us5Fvp3JLmvEpCRafNPtFGn2HM8nK3DT7Z8NpK8tOxIAJ16MF5J2Yl9rQKAao+Mxu+9D8r0groYNaN3WZ/93cwkMHl4U3jeSrbXRwtjFOagnH1ILQ== 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=Ux7JAq2/OWm6Id9EpkruRkDeJu6v/k7gsVvOME1i/yc=; b=cuDiajkgXHkWLPWaJcgO/cOChFuIqmbfWvnJS036pdJbxcR0Xg5pCNAHS5YRGQ0owZUn6B30OuS5o6O9+WrF2E7i5rEu9X7np+rpV7RsMEgw1WVRDd1pF/iT5VVmw2FLngGdxY+OgfngkUJjGcnbJt+edST6gJxn9GdAhouxTVIsCZxL7lrehdGNtbVmyfzjHQfb/BEoisrIOO2e0CBwkxc5oIoX71pYOHkXEtbj11D6zwnTg3bFNsw4jZwfosy0V8NeMr1M/t4O01kYQ0kluVwLuGZGzAXROvhfTATllnCeBuzcM4Yt0u/Glhekcd4Yn5+YF5lvHaY4CJNB112Dcg== 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=Ux7JAq2/OWm6Id9EpkruRkDeJu6v/k7gsVvOME1i/yc=; b=DDfZCEiFuPtqWNwvYy85hBVXsz1yFV//x/lnXsX1YJrnxCGqxidyBWlDyodB2aow8tznORB/P/Zy4j4I/h1wIzjYKxTTr+0fnowe5MC7n82QBoql+ICDfbCxaziBDoSDGG5h9W8nVmXPrwW2r7y92IFvkgIIAyKrqm6Pmo9Ogug= Received: from DM6PR12MB2762.namprd12.prod.outlook.com (2603:10b6:5:45::15) by DM6PR12MB2762.namprd12.prod.outlook.com (2603:10b6:5:45::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.19; Thu, 12 Nov 2020 21:17:20 +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.3499.034; Thu, 12 Nov 2020 21:17:20 +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/xanFJnFzgAAIqnA= Date: Thu, 12 Nov 2020 21:17:19 +0000 Message-ID: References: <20201007172613.21868-1-Zoran.Zaric@amd.com> <87eekycp3c.fsf@tromey.com> In-Reply-To: <87eekycp3c.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-11-12T21:17:14Z; 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=245ca809-b265-49a1-a059-00007903ed1f; 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-11-12T21:17:14Z 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: 6233003f-3fba-455e-b489-000012e55b70 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: [2a00:23c7:5a85:6801:c060:8992:cfbf:e80b] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: a49f9f22-46d0-41e8-9a4c-08d88750571b x-ms-traffictypediagnostic: DM6PR12MB2762: 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: Fgem8kfpubQPAPTqrHkdHbl25eIt0na1b3faJpxcMT3MaSHXe1QDjQ37uw1ibjTKzbzUzpH54vCTY45b/eGiTC9xMu7AkfVLKuc/kEBEU8AYCqwIoNSKaQjqSuq0X2A9JoUieyw+OGOK3oyy4ELYxG4itanr9mITeizwgEhRv5z5Heb8GeS61z4bD6z0Zs5bXEhj/il+Rnxq6qURuaCpoJxJmNIwRddwUMGna7p9YmC9j/QMXS9i1bcYFs1S/9danwcWZxRKaVZRmDM/bJbsQ6W684RLSOZII+7chQevLThQqgtt8e4ziqEaVPbJnF5x9Aw3WTbKiwDNPeTchHIjvQ== 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)(346002)(396003)(136003)(376002)(366004)(39860400002)(9686003)(64756008)(2906002)(8676002)(86362001)(66446008)(52536014)(478600001)(55016002)(66476007)(66556008)(71200400001)(5660300002)(4326008)(6916009)(8936002)(316002)(76116006)(186003)(33656002)(6506007)(7696005)(66946007); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: 0iOQxpRsWPk8luadV/TxucMyvkbZefxB4364AjMLaTc2vNmr8Y3qRXhUjmhLLCGeO3PDbOC6sh+269VuSQan5J/2zn8LfjRWQTR/kyEsFvDmnLVuddWkUq3b5Nil1+e6NWC0fOCc+gpeSCw7L9lhsRIVFIXcaQ6aXTyCW3/eNe6QwUoqwLeFeQ3CXjo+wW2umN47aGRqiub2i/J7LEzV5/V/0tVAqlDH/0LD4zIlICSruY54Gw8SG8QxXaBXmVNQwHL/O3TKtAZwGQaYB+r3wOqL2pGFgyBxxLHqi0C4JwV7c3B0V7TLNtLpU3nHpM9rd0hKX4R0NXvbBflAhv1DEDw/SRo4fluLCKuSAB9jzmjCwx9UUK3S71mzDcNzgltxnOd9ezKOZfPoFEaHPWgWEad5gCTCQEAgMtHtVrqvmD1bD4S0YCjlKo0Y+I/2GzaHqoyQuBljscDS4BEiG8uh1z7KvM5OzU4RD1ZF9nSn1I35x90DRzdW4o3eDTevCarrdWGDCG9SAt9D4ASkkeB2NgTbnwnkQKBOQZ35lO0MoADBsP1qMyuxlNBphr0XLZHbdKfM/B3FqJOSqDL3ARlTLY1P/gGxr8F7kEOITTItnXQv6Usq4nechkL2hUf9nSjy5DQvcXe15eJGUE3gjNKVmdk7Qj8EUYz/bXvntIu5XuX9q4QGdcAHQ9qaAaIT1eBMi2ok0BP0Kq108Ivy364+MA== 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: a49f9f22-46d0-41e8-9a4c-08d88750571b X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Nov 2020 21:17:20.0256 (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: CpsnwMjkatNuMv5fNWIZdiSVcm7/WIIjBN20rRoz7ToqjoqoFXIqGQhKUMp6AvwuQUHPyAQilpoRfc4+1fkAQA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB2762 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] > >>>>> "Zoran" =3D=3D Zoran Zaric writes: >=20 > Zoran> The problem here is that faking results of target interactions > Zoran> can yield an incorrect evaluation result. >=20 > ... >=20 > Zoran> This is clearly a wrong result and it causes the debugger to crash= . >=20 > Zoran> + /* The DWARF expression might have a bug causing an infinit= e > Zoran> + loop. In that case, quitting is the only way out. */ > Zoran> + QUIT; >=20 > Can this really occur in this scanner? >=20 > For evaluation I can understand it, but this scanner seems to just walk t= he > bytecode once, so I don't see how it is possible. It is not.=20 The test is exposing a bug in the previous evaluator based approach. My poi= nt was to prevent people going back to that approach. >=20 > For gimli (again) we have a maximum operation count to avoid this kind of > problem. gdb could do this as well. >=20 > Meanwhile, about the linear scan -- it seems to me that nothing in DWARF > requires (1) that the expression not contain embedded garbage, and (2) th= at > it not be possible to branch to the middle of some other instruction. (I= f > there is text along these lines, I'd like to hear about it; I looked in t= he past > and couldn't find it.) I am not sure about your point about expressions not contain embedded garb= age. The DWARF expression is a byte stream with clearly defined content for= every operation. Regarding jumping in the middle of another operation, this is true, DWARF d= oesn't prevent that or define what is supposed to be done. And I agree it would be really useful to have a checking mechanism that con= verts that byte stream into an internal representation, where during that c= onversion we could check and report all kind of things that can be wrong wi= th the expression. > This is pathological, of course. But on the other hand, if the motivatio= n is to > avoid crashes, it seems bad to, say, let this function pass through some > bytecode that would then be interpreted a different way by the actual > evaluator. >=20 > Personally I'd be fine with rejecting this bad stuff from the evaluator a= s well. > But anyway the difficulty is that they have to be in sync, and aren't. >=20 > Another approach would be to record which offsets are branched to; and to > pop from such a list when an unconditional branch is encountered. > This would solve both problems as well. I agree with all your points and to be honest I am not advocating for symbo= l needs mechanism (new or old) at all, and nothing would make me happier th= en to get rid of it. My next patch series is supposed to redesign the DWARF evaluator mechanism = in a way that it can be used in places where the symbol needs is currently = used. The downside of that approach is that the scanner is still going to b= e considerable faster, but maybe we don't really care about that. If at that time we feel that it is better to use the new evaluator instead = of the new symbol need scanner, I would be happy to do the switch. Zoran