From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on2053.outbound.protection.outlook.com [40.107.13.53]) by sourceware.org (Postfix) with ESMTPS id 31D613858D28 for ; Fri, 10 Feb 2023 15:28:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 31D613858D28 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=arm.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=bnkE9intPwuVaqYphZGSn2IlA22FEHw+22KhqlcV5WI=; b=XSpLRp0yBTtvrFq4P1H/Wria7kUZywBmew6l+ScS12rXheTywEhQ+/20+Tke2vzSk9v1q1dvDjuZ90wK151JmfOT9OGulAjy8hCu0AnYvn+AKzCT4M6In0DF4Ww8Z4GOufUfwaM5vgTqQVpNdAi57IweN+1nofYIlsXXS7yU7aM= Received: from AS9PR06CA0517.eurprd06.prod.outlook.com (2603:10a6:20b:49d::21) by DBBPR08MB6010.eurprd08.prod.outlook.com (2603:10a6:10:20a::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6086.21; Fri, 10 Feb 2023 15:28:19 +0000 Received: from AM7EUR03FT031.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:49d:cafe::3e) by AS9PR06CA0517.outlook.office365.com (2603:10a6:20b:49d::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6086.21 via Frontend Transport; Fri, 10 Feb 2023 15:28:19 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; pr=C Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM7EUR03FT031.mail.protection.outlook.com (100.127.140.84) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6086.21 via Frontend Transport; Fri, 10 Feb 2023 15:28:19 +0000 Received: ("Tessian outbound b1d3ffe56e73:v132"); Fri, 10 Feb 2023 15:28:19 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 9e9f3d55ac4ff6ee X-CR-MTA-TID: 64aa7808 Received: from 2ceec0e22ec6.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 642A102C-5DD9-49F0-AD70-832EBC20CCB0.1; Fri, 10 Feb 2023 15:28:12 +0000 Received: from EUR03-AM7-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 2ceec0e22ec6.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Fri, 10 Feb 2023 15:28:12 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UpKNdkeWeKvAFjs00w3F+QON6wh+rHe7QEno2HlhLKj05CoVzZ6rq5LId+VOwXhKcTYokF96zIaEeMaVrQYzrrJe8cLGemDQTcP+igE2fbpqdOkvBBjlzoP6vQXSU3KTBHBzhsBeXG3gMdjlS39rUt81U9DztAUsC8Ze5wn8Lg7s8Qq+3HIbMnCg8DpqXwJH7ebU+fkMYaF3le0sRsE3h5PHPxrtnqTpf/7jtQ7bZWxnW/9SGfHjQWCoHKlZBTSmcrqiz6Mrb43NTHr0BXdD1LOyUEcFk5coNhFp4yQf9wYAX9zmYl568hRv3wLJMNtVFpDZuyscQqo+kqYhTbmFLQ== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=bnkE9intPwuVaqYphZGSn2IlA22FEHw+22KhqlcV5WI=; b=nv4otgo5GpLK0uxLZN9oYjsWcEu5w5QH1s3XyddrGdoyR9D5P1ApyUhvJToWgNoNiZ60PdvryNxDyjPk6QJXxs4HtdE5yILdoJHADMm3Qk9+Mz7tY6Z/EOl9PCzo2HXyTTxSpkdH5JnHKVo4UVzFzpWRJ/NqIiVp4hpGGb5MMzBeaFBmE7jrg6tLJh+9NC/XWiqcrKeHq0Ubx7ZXF1agPRxOzRqx6BlhAINxS1+O+yOfZFUaaYzreflw45CQhwmSITnt6NohwrXd/9utu6GiLcs0OPb6ocL+2D2oSmDbJiAM3bg2GaF+t0M5gpAGSf4OWexobb8lW5T0ISn7c10bxQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=bnkE9intPwuVaqYphZGSn2IlA22FEHw+22KhqlcV5WI=; b=XSpLRp0yBTtvrFq4P1H/Wria7kUZywBmew6l+ScS12rXheTywEhQ+/20+Tke2vzSk9v1q1dvDjuZ90wK151JmfOT9OGulAjy8hCu0AnYvn+AKzCT4M6In0DF4Ww8Z4GOufUfwaM5vgTqQVpNdAi57IweN+1nofYIlsXXS7yU7aM= Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; Received: from VI1PR08MB3919.eurprd08.prod.outlook.com (2603:10a6:803:c4::31) by DB8PR08MB5418.eurprd08.prod.outlook.com (2603:10a6:10:116::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6086.21; Fri, 10 Feb 2023 15:28:08 +0000 Received: from VI1PR08MB3919.eurprd08.prod.outlook.com ([fe80::bced:32a3:b77e:90a6]) by VI1PR08MB3919.eurprd08.prod.outlook.com ([fe80::bced:32a3:b77e:90a6%7]) with mapi id 15.20.6086.019; Fri, 10 Feb 2023 15:28:07 +0000 Message-ID: <44ed1da3-0b5a-c793-23c4-ab944de303a5@arm.com> Date: Fri, 10 Feb 2023 15:28:04 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 Subject: Re: [PATCH v3 4/8] gdbserver/linux-aarch64: When thread stops, update its target description Content-Language: en-US To: Tom Tromey , Luis Machado via Gdb-patches Cc: Thiago Jung Bauermann , Simon Marchi , Pedro Alves , Andrew Burgess References: <20230130044518.3322695-1-thiago.bauermann@linaro.org> <20230130044518.3322695-5-thiago.bauermann@linaro.org> <87pmattzjw.fsf@redhat.com> <7970ac03-1123-d5f6-7b17-808832d43be6@simark.ca> <9a85e2fe-078a-e2ee-7e49-53fe0ceef492@arm.com> <87y1pgaib6.fsf@linaro.org> <3f4e3603-59e3-a896-72e4-d692646c4e44@palves.net> <87v8kd9odi.fsf@linaro.org> <87cz6i2o6x.fsf@linaro.org> <9864aa2b-f3cc-94ae-0785-5565cc990006@arm.com> <87sffdy32p.fsf@tromey.com> From: Luis Machado In-Reply-To: <87sffdy32p.fsf@tromey.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO4P123CA0436.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:1a9::9) To VI1PR08MB3919.eurprd08.prod.outlook.com (2603:10a6:803:c4::31) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: VI1PR08MB3919:EE_|DB8PR08MB5418:EE_|AM7EUR03FT031:EE_|DBBPR08MB6010:EE_ X-MS-Office365-Filtering-Correlation-Id: 44ab156e-7ccd-4715-e50a-08db0b7b7025 x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: BGsannIhtrQ+yYHlSLted0tZ8opN+QSKUVf/abmnt9toW/XZoYJHBoLYZjWGyrN+Brj0RU75Vmv+oVNZhVjVSn6GbicLH2ONHiUKzgeDHBCUy3qthLhIYiOZVCc89MJ2WClSI+HZiKcnE+TlLtbUzwrm0WXw0dNBAzohVrRZUzXkiYphixHYfdq3FL8wCMcGNrxHrzU8HPAZEePdcx8t+DHBLsWE+1bY3KVN2ZXM04unoJRk0DL8jWMTbtVoKRs98X6/YwvVy8RpkMyvjeHbsS3SeUwnpEZZJKEwuynrcOSOLfPTZyY7LkrIUzqQzwTzQkJ1E9zdWs1MT3wqPuyjL2+lxoMp7r6QTHJB2ow3W1nidhCb4fOXIKYbcGyyiRRH0nPNIAXXjdaDNz61zMJDkeAxzgNFmD+bwQlq6izVJ0Te+qG09VskXY4VJqw9o+817JWiX55zyXSRbJa5XCUEieTxCfeFXe1mVdlij4Ch5h6kH1s9a0jsqQhwEtL4q5dqCAZ0pj1fxExyr/B/J00+WiNVfY4OCmFCabqUBPPilZMp6s1H2BwL7ZPlPl8L1VKQkRMX9Tn6Dv4TYid3edAZLaw2bEPdp2sGXb/bDjl22ynbPjRXGIXcJ26PGQDcrBfi5e3wAz4W5SwWuC2BlEmdCZYIwlDl178ytXNJkwndjfS1dvv/gJqoQJHP1mHeG7LV4ot6v3mg9DARKPt8MZh5v+1Op0ro2Mj6nSKD7xnW6dY= X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR08MB3919.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(4636009)(396003)(39860400002)(136003)(376002)(346002)(366004)(451199018)(2906002)(44832011)(38100700002)(86362001)(31686004)(6486002)(26005)(53546011)(6512007)(2616005)(186003)(31696002)(36756003)(66476007)(54906003)(316002)(83380400001)(110136005)(8676002)(41300700001)(6506007)(478600001)(66556008)(66946007)(6666004)(4326008)(8936002)(5660300002)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR08MB5418 Original-Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM7EUR03FT031.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: d19451ae-bf1b-49af-7c09-08db0b7b689b X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: TG6/ujwi7hnEsQcMUxY3KieszjVsDtWRntK/xC9LsUSgiAQcn/wgxwgsA7uU+DTAEzn8Dk6WYf0C9yvf+j+nvxYg2Lyg59YYOU3mlCSdHELyCUDlSCkrRf1Sf8xc8uaoqx0GDzFWXq2OgnepRHfwKUJ+ErYoaFcFW1xDN4hMs8376TRSqiKLTbbbeA0wgcsLFd6eK8jIyM1RCUELX6SOf2mB43It4mnEK0kvLPaOneaPgF4GBXVpGy/V9lZ+Hwntr3gxCHBr/LkRMvqUIFD7n5d8Fv9u6gxBC5CWhdsluedOID5c1mp9b8kzeTAFBk0M136fIKoo8e7OQk+3s0AuVYcifixvxFnCKXBFO5kD3scoaLTvuRUHq5TAFZw0N/dpNgD8ORPsJsNGd7146YDrqGxSoiZSNuU6E9SwbKIGwEi9HWSkmC7jKpcZUiCAVi01hQ0qvqhHRz9ZBoDzyFnyYvyJAW0SskP1Kc9Y8W/mQ11p5Y/2w/ZMvLFmWDHCpD+qkxkxTglDF5aVWTt/kIuWJywjY/k2sxjx9pP4dBtN1wN13WvNut+SwTSdn4SKdOxmCTanhusE6fXJ0Zyxr3fSHdvCJDR/V/5qDt+g/KEDSDfi9Uro2iBe1toJtxwP4LJSHYHAe99pOTMV8kMwhbweas3ybqcNH0CXY6l6EKuYwAi9hXz4sd7Ao25j8zsqRdXV3dLoh/G8llhvO67iE2cNn3L6LqowkvQWj+BjqN6ydWw= X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230025)(4636009)(376002)(136003)(346002)(396003)(39860400002)(451199018)(36840700001)(40470700004)(46966006)(82310400005)(36756003)(478600001)(6486002)(40480700001)(2906002)(36860700001)(26005)(53546011)(186003)(336012)(6506007)(6512007)(2616005)(83380400001)(4326008)(6666004)(40460700003)(47076005)(41300700001)(8676002)(70206006)(44832011)(107886003)(70586007)(31696002)(86362001)(5660300002)(8936002)(82740400003)(316002)(356005)(110136005)(54906003)(81166007)(31686004)(43740500002);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Feb 2023 15:28:19.2846 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 44ab156e-7ccd-4715-e50a-08db0b7b7025 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: AM7EUR03FT031.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR08MB6010 X-Spam-Status: No, score=-6.6 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,FORGED_SPF_HELO,KAM_DMARC_NONE,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE,TXREP,UNPARSEABLE_RELAY autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 2/10/23 15:04, Tom Tromey wrote: > Luis> But it is also a larger effort that has to revamp some things in > Luis> gdb's type system to allow for sizeless types, and that also has > Luis> implications in other areas of gdb. > > I doubt I understand the problem here, but we do have dynamic types and > dynamic type resolution now. This lets you express a type's size, > offsets of members, and even fields (via variant parts) by referring to > other members of the object. In summary, we need to define a vector register with size equal to the value of a particular register (vg). With every distinct value of that register, you'll have a distinct size in the register buffer, core files, remote packet etc. We do have dynamic types, but I don't particularly remember having a type that has a size defined by some other entity outside of the type system, like a register (or dwarf register). > > Luis> I'd be happy with an intermediate solution like what Thiago put > Luis> together. It would solve a long-standing issue for SVE and > Luis> gdbserver and it seems simpler at this point, plus Thiago already > Luis> put the effort to write the code. > > I haven't followed this discussion, but with the remote protocol, > whatever we do now will be baked in forever. So, it's worth spending > extra time up front to get a really solid approach. (I'm not saying > this isn't, just pointing out that there's a long-term cost.) Sure, but we can always add feature checks for that and fallback to known RSP if a particular feature isn't supported. The approach Thiago took was, at one point, deemed the appropriate way to get dynamic vector lengths working in gdbserver. So some amount of thought was put into it already. I think there are two separate issues here. Per-thread target descriptions/gdbarch and the problem with dynamic vector lengths. Realistically, having per-thread target descriptions/gdbarch seems like a more relevant feature at this point. It would allow threads to have different architectures, and I think that is a good addition going forwards. Cell BE made use of this, but the port has been removed now. It might also be useful for heterogeneous debugging, where you have cores of different architectures. A separate issue is the one with the SVE dynamic vector length. We did have a chance to make gdb cope with sizeless types when SVE was initially put together. But at the time it was deemed best to do (potentially) smaller adjustments to make it work for the native case. As a result, the code we have now handles these changes via per-thread target descriptions. I suppose AMX has the same issue, but I'm not sure how it was implemented. I remember reading about using a fixed-size buffer, but I haven't followed that discussion closely. So if we have other ports that could benefit from such a change to better handle types defined based on external entities (registers, variables etc), I guess it would make sense to explore that possibility. Otherwise, if we're only trying to solve the particular case of SVE, coming up with a completely new design might be a bit too much. Just my $0.02. > > Tom