From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on2043.outbound.protection.outlook.com [40.107.13.43]) by sourceware.org (Postfix) with ESMTPS id 1CED03AA903C for ; Mon, 13 Nov 2023 15:08:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1CED03AA903C Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=arm.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 1CED03AA903C Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=40.107.13.43 ARC-Seal: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1699888116; cv=pass; b=sXucvq6U3Xqx1kOZFfjPofxs3+Rxxthr2xgYPrGJi/gwSx/iQSdnMkyRqGi099t504sRU61ycDorGglfd/B12CrI5orgrmg5WvYJn7b70FtjCNSl7proip7aWjUxAcG5Y5XPD7Vpt0uh8cnRphWJ3DDgnCPdJFmiNW9DuRyL300= ARC-Message-Signature: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1699888116; c=relaxed/simple; bh=Ru0r23NwixcLBC4hx584kLly+/bjbohknkVwVPsFO9Y=; h=DKIM-Signature:DKIM-Signature:Message-ID:Date:Subject:From:To: MIME-Version; b=H8CtJnIaqc0U4yNnccB+oFa7Kv6XL+8T/0RnO1eEN2HE/ljxw91wyetJsbWxQKmOBq7jBC7E7teomy3stvvUerSHBjQsj3sAuNxN9U9KChsmCMK6ciS430HqLf/7nQXxlDUiZ4QjI3W9IgvszFxe8MJzQBuTZXtFhuLuZOvdvcQ= ARC-Authentication-Results: i=3; server2.sourceware.org ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=bZyiW4exJkGGldtys3jo7ChXPXQTKYuEdxZqGtQaiuqUC7r/zjpS1KSsFoqTOnQXqkReDX5IiXnLDp8ChFNrWMe8VxlE+bj+6zQ6Wyxx+976lmpXR1UlbqmBwPvLgQ9IraHCSJI9ZG9s4IYpmrovFhvGr3znucOxbd5FmEDiSdwalMesjkCA10kCFKEFwTX1A5Q9z9lb/Zv0laZomyJU3j3fqsivNMMLCyxOLL7qqzkYlHu3FHkFZrTIWan3lZ6SkgimnU/00HIea9HY6P0r/Kg82GCWuVkAcmz2CHOahDWJcOL5UIs9y+CGvSRxP9Yr58VRqblNx/BAXN+6MSq2UQ== ARC-Message-Signature: i=2; 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=6/mt7bjS1KbqV+4vZFX1L3NLR3NgUTOOdGSLU+AZo+c=; b=GB0VZQ4W/s8Qn2G/2m+5P2cTttXk8uZbmOvwf/5EiE0LCb0AmE1a6JnlB7lhY4QSvgMWXFps9OtGUa0h2JiNyMIQfmObx/mI+0ZrMwHaiC158WchJZT6eM84d89CgnHwKiOa83664FeeneVWlclfNvElLv1ThCdfdEeM4/klVVPV53nCmmwMT7Jm/mst6dtStkn8QAo0VjxcIWS5dk7hjODFWY2yXELw+GfUsshaNMPLdijZ5dBv+2P55z8oIQcaEHtxTw9KJL+pXMTzwoCJSbtX58Q+qZmv0C7Ef/3Qpqe3Hlvcwqbd7ilthFmEGZefWYacuZcR+5v/nv9uMFQxNA== ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=sourceware.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=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=6/mt7bjS1KbqV+4vZFX1L3NLR3NgUTOOdGSLU+AZo+c=; b=Pe2dUvsW4VEPTK1exjo71Ik2LUO2+tMBBbOLpozWeqeiGuK0RMStlELvjbx6382uzDxUz5JYZh5+B/vwJI9R/y4IHI2f/Wrdpk4cw6SEUoVAYXNYXgGdKtzoOzayQixeeVyNJkBOx0UFtAGKdUP2fGf3WVvA3MNy2fYBw2HoXdc= Received: from AS4P190CA0020.EURP190.PROD.OUTLOOK.COM (2603:10a6:20b:5d0::8) by PA4PR08MB6272.eurprd08.prod.outlook.com (2603:10a6:102:ef::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6977.28; Mon, 13 Nov 2023 15:08:29 +0000 Received: from AM4PEPF00027A5F.eurprd04.prod.outlook.com (2603:10a6:20b:5d0:cafe::92) by AS4P190CA0020.outlook.office365.com (2603:10a6:20b:5d0::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6977.31 via Frontend Transport; Mon, 13 Nov 2023 15:08:29 +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 AM4PEPF00027A5F.mail.protection.outlook.com (10.167.16.74) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7002.13 via Frontend Transport; Mon, 13 Nov 2023 15:08:29 +0000 Received: ("Tessian outbound e243565b0037:v228"); Mon, 13 Nov 2023 15:08:29 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 16503e0b25862725 X-CR-MTA-TID: 64aa7808 Received: from f138894044c8.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 6FEC11AD-F519-4F52-BB4D-58B26DD810A2.1; Mon, 13 Nov 2023 15:08:22 +0000 Received: from EUR05-AM6-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id f138894044c8.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Mon, 13 Nov 2023 15:08:22 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OrDjbMnTq95uWQVFycEZb7+y3w5yu3/AZKjsqk+XUxz3WFFFjZ5b59KCLDh4Ecz+TNJB43pIEuRgJCw74j4qdS5qu0TV0pgEfFqC9nUfF/YCuQHzs32Mt7ioaF+hMqrkdj7V+Xb6LiWkrGbkTpcYysfh7jwrw8p16cp8UJ/ON726zhO+F5DUt4sMBUQAZZd6HueHGGX3Ultoh5HR1XYO5flPanLp6avuhxdUg52CpqvYqlMcWTAvdt1hjFMtzmD7dSzv7paVpPbF4tSAcQ9Buo0CJPyrtej4UddQJ0wvKNnf7KcslStu/o20FhPnTVZOSpy60jw7eYhXQ8kxefM3CA== 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=6/mt7bjS1KbqV+4vZFX1L3NLR3NgUTOOdGSLU+AZo+c=; b=fu8iDPD0IGwnWYfaEjnATqu5M3YRWyXAMitr4Nf2BfCL8Z9Qiq3acRKgP6uWRVhSZ+B4pQJSxuyquOdXosskRduR19fosTZfhZCRz/Sro7HBL3dpqKziInBCWZd6ZX84mZ4e48ARg7RQNbAuKSxXqruVmVEiSJJjI7UXlnqKE9EgDiCGSFdLpkOlwYiorWBKKrIQ1Jndbx7eCdniD5cU4HO9AyA+tj6M0jXVQUfHXzSKv8eReLsBS9YnGWLdKR34gYE8hVcWkRyKZpjLsdIxZg6t1lg2GhBOZkgTxRgySijNPxd7UY3I1q3vgayqO9LSMUpMWKmPpeRSiRO6BuynwQ== 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=6/mt7bjS1KbqV+4vZFX1L3NLR3NgUTOOdGSLU+AZo+c=; b=Pe2dUvsW4VEPTK1exjo71Ik2LUO2+tMBBbOLpozWeqeiGuK0RMStlELvjbx6382uzDxUz5JYZh5+B/vwJI9R/y4IHI2f/Wrdpk4cw6SEUoVAYXNYXgGdKtzoOzayQixeeVyNJkBOx0UFtAGKdUP2fGf3WVvA3MNy2fYBw2HoXdc= 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 DB9PR08MB6714.eurprd08.prod.outlook.com (2603:10a6:10:2a4::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6977.29; Mon, 13 Nov 2023 15:08:19 +0000 Received: from VI1PR08MB3919.eurprd08.prod.outlook.com ([fe80::e05e:c012:f1f9:eb51]) by VI1PR08MB3919.eurprd08.prod.outlook.com ([fe80::e05e:c012:f1f9:eb51%4]) with mapi id 15.20.6977.029; Mon, 13 Nov 2023 15:08:19 +0000 Message-ID: <1f4bd422-f7e1-4d94-abb5-a53a85040b28@arm.com> Date: Mon, 13 Nov 2023 15:08:18 +0000 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 00/24] Fix reading and writing pseudo registers in non-current frames Content-Language: en-US From: Luis Machado To: Simon Marchi , gdb-patches@sourceware.org References: <20231108051222.1275306-1-simon.marchi@polymtl.ca> <9a693dcc-9213-4300-a4ee-25820bfada78@arm.com> <25f0e95c-32bb-41d1-acd0-69273ab7c88b@polymtl.ca> <4bc57dc1-67ee-45b7-9de5-3cdc85b6518e@polymtl.ca> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO2P265CA0432.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:a0::36) To VI1PR08MB3919.eurprd08.prod.outlook.com (2603:10a6:803:c4::31) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: VI1PR08MB3919:EE_|DB9PR08MB6714:EE_|AM4PEPF00027A5F:EE_|PA4PR08MB6272:EE_ X-MS-Office365-Filtering-Correlation-Id: f08ae9f4-0445-440e-7596-08dbe45a6505 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: 03kUgPiNqbDVoadDv80jaM6x003a9CsZrOG+35MMQ7zikqo9Et3LbcxxD7a86j85Xo5cGMEOu8zKZfDWOksPIazf2r97fvFeufZtLcoLlG1/CxdIcYziixel6cwa+sI7voJbHSJ4rNGtlvrD5dImhwoDFr0QlC9fYmPwXr8F3wFw3m0ChGrEFZAnj6kVlj9pd5RpywV46E2vgB3+/+tWPLheuRehST9sHnad5Scg50Pz7Zt2hC17jAWE3Kq4GbEJyKqJaDBc0265I+JXJ1S1T+sReJZ6DI1/JfY160e2ch870NxO8RuLdPWQSyy2MHrf7VNv6Bvb3+bt+ZhheBxUnZUohfNMapQC1Kfe6J65Nr9tDpPa+SkSALRa+teothx0oAbC3Q8PyV9ZYjQ4mqR2XGhgSnFVqOQrtCEj7RYek5fBY746JkbaHutoiWQnJwcqHkrT9kLzLtYP+Nz0v95m6vQaS1YoyVNz/kB6IBMoBDSvSrb8NpA7BKRC1wgVDZEcnmxoqWNAPi8c2MdUuMQSWrB4mIN3RkJFoXVNDd5l6hiiRftLO/u/5g7Rg2HXPgEmvBCywEbSLEgTXLKl1hCJdss77gEMJ6r7JX1UL7ep14tT160erRUBPFWo0w4OKJITWGjkp7pgNjCVi9i06b3i1Hs1p5tnQN6Rn32V3Xpbq1lgvls3Ct+Ct91XbDGKU3hb 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:(13230031)(396003)(346002)(366004)(376002)(136003)(39860400002)(230273577357003)(230173577357003)(230922051799003)(64100799003)(1800799009)(451199024)(186009)(66946007)(66556008)(316002)(66476007)(478600001)(6486002)(86362001)(5660300002)(31696002)(41300700001)(36756003)(2906002)(8676002)(8936002)(44832011)(38100700002)(2616005)(84970400001)(83380400001)(26005)(31686004)(6512007)(53546011)(6506007)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR08MB6714 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: AM4PEPF00027A5F.eurprd04.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: a13b87bd-4abf-448a-d692-08dbe45a5ede X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: I5e2kEZSBVutlFaBHh6XTZ5V829FXuxTEJyZaUsk8gQPJNZCyeg6bQ2wJlvIJQxRKMnFmMi1EJeIu1sJPLxH2G2U8WbR//vASWCSLvKmZxgpdbIcm3BysJdRA9dZELrKuENfDvh3ywgof2RgXgcwZzJW9tcxxCB1mIg0d1ZWHYqLLQq8YZJQ4GwIdGrW/arRAxHjq5NLJQ/ZRLF7WrUYd2l+ko3eNd8wBawqF+zyekeie89jCusH9eiO1DvH77/miwkkX2P4fQDGA6SGmeYjvvBL/py6z6exSxJbTA+VyRXOP7TLpSfa6hOWhH4/bdyVMnmFJaQjGBePvLT46cxMbGMPjxIwWnJmUfsL4KifIC2cY1YEJk4YE82x2vgnQdWhjtXKLQVoC2Q3QpIXELkVsWaZwg8fghxNmFZuiI9KWdPTenaaX7f9mI6LstF5Pu+d3iRFhAWMWni0RNvKboZV3RcegKGDh209DL025cenz7ovF3cTnEW/tVWEw4DMZtdZ5ahnXZxRpaE1gKxsBdRsOCGLCPswmQ5yoQwzaw8yH4UXgHGqNdVsTqIlOSKTNCCEP3zgG3TDZpXL8ZuLq/Q5z+AcjLb9aP7JYeVkv6uJvD3agRsvPLcNi4IuvrxAr2ItY7w5qP8bcRJPziTSTJcIx2HT3Zjy+6UT+ds05zIHOahnORDFJuRvp51rXEVLmR0O34yCSsllP7b/yLe4zWqKe5VWdR0LIVHc2vnGtuxmXLdvmmUJfTDneVoyLlpfQJX1pQYTx4WHN+K3fyF8udFmgohBFxQRLoOUwa3jeKYcmXM= 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:(13230031)(4636009)(346002)(136003)(376002)(396003)(39860400002)(230922051799003)(230273577357003)(230173577357003)(64100799003)(451199024)(82310400011)(1800799009)(186009)(40470700004)(36840700001)(46966006)(47076005)(336012)(2906002)(40460700003)(83380400001)(40480700001)(81166007)(86362001)(31696002)(36756003)(82740400003)(36860700001)(84970400001)(8676002)(8936002)(6486002)(478600001)(44832011)(31686004)(53546011)(356005)(6506007)(41300700001)(70206006)(70586007)(316002)(5660300002)(2616005)(6512007)(26005)(43740500002);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Nov 2023 15:08:29.5478 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f08ae9f4-0445-440e-7596-08dbe45a6505 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: AM4PEPF00027A5F.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR08MB6272 X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,FORGED_SPF_HELO,GIT_PATCH_0,KAM_DMARC_NONE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY autolearn=ham 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 11/13/23 13:10, Luis Machado wrote: > Simon, > > On 11/9/23 19:04, Simon Marchi wrote: >> On 11/8/23 14:34, Simon Marchi wrote: >>> Ah, damn, probably because I switched to byte_vector, which doesn't do >>> the zero-initialization we want to do. Here's a new patch (that applies >>> on the series directly) that doesn't use byte_vector. >>> >>> diff --git a/gdb/aarch64-tdep.c b/gdb/aarch64-tdep.c >>> index 1815d78dec4..200e740e013 100644 >>> --- a/gdb/aarch64-tdep.c >>> +++ b/gdb/aarch64-tdep.c >>> @@ -3300,7 +3300,7 @@ aarch64_pseudo_write_1 (gdbarch *gdbarch, frame_info_ptr next_frame, >>> int regnum_offset, >>> gdb::array_view buf) >>> { >>> - unsigned v_regnum = AARCH64_V0_REGNUM + regnum_offset; >>> + unsigned raw_regnum = AARCH64_V0_REGNUM + regnum_offset; >>> gdb_static_assert (AARCH64_V0_REGNUM == AARCH64_SVE_Z0_REGNUM); >>> >>> /* Enough space for a full vector register. >>> @@ -3309,11 +3309,11 @@ aarch64_pseudo_write_1 (gdbarch *gdbarch, frame_info_ptr next_frame, >>> various 'scalar' pseudo registers to behavior like architectural >>> writes, register width bytes are written the remainder are set to >>> zero. */ >>> - constexpr int raw_reg_size = 16; >>> + int raw_reg_size = register_size (gdbarch, raw_regnum); >>> gdb_byte raw_buf[raw_reg_size] {}; >>> - gdb::array_view raw_view (raw_buf); >>> + gdb::array_view raw_view (raw_buf, raw_reg_size); >>> copy (buf, raw_view.slice (0, buf.size ())); >>> - put_frame_register (next_frame, v_regnum, raw_view); >>> + put_frame_register (next_frame, raw_regnum, raw_view); >>> } >>> >>> /* Given REGNUM, a SME pseudo-register number, store the bytes from DATA to the >>> >>> Simon >> >> I managed to run a Debian AArch64 image in qemu, with SVE support, so I >> was able to reproduce the failures you mentioned. In the end, here's a >> version of aarch64_pseudo_write_1 that works for me (written as to >> minimize the number of unnecessary changes, since that seems to >> introduce unexpected bugs...). >> >> static void >> aarch64_pseudo_write_1 (gdbarch *gdbarch, frame_info_ptr next_frame, >> int regnum_offset, >> gdb::array_view buf) >> { >> unsigned raw_regnum = AARCH64_V0_REGNUM + regnum_offset; >> >> /* Enough space for a full vector register. */ >> int raw_reg_size = register_size (gdbarch, raw_regnum); >> gdb_byte raw_buf[raw_reg_size]; >> gdb_static_assert (AARCH64_V0_REGNUM == AARCH64_SVE_Z0_REGNUM); >> >> /* Ensure the register buffer is zero, we want gdb writes of the >> various 'scalar' pseudo registers to behavior like architectural >> writes, register width bytes are written the remainder are set to >> zero. */ >> memset (raw_buf, 0, register_size (gdbarch, AARCH64_V0_REGNUM)); >> >> gdb::array_view raw_view (raw_buf, raw_reg_size); >> copy (buf, raw_view.slice (0, buf.size ())); >> put_frame_register (next_frame, raw_regnum, raw_view); >> } >> >> Simon > > Sorry for the late reply. I was out a couple days last week. > > The above seems to make gdb.arch/aarch64-fp.exp happy, but gdb.arch/aarch64-pseudo-unwind.exp is still slightly unhappy: > > FAIL: gdb.arch/aarch64-pseudo-unwind.exp: caller, after change: p/x $v8.q.u > FAIL: gdb.arch/aarch64-pseudo-unwind.exp: caller, after change: p/x $s8.u > FAIL: gdb.arch/aarch64-pseudo-unwind.exp: continue to breakpoint: continue to break_here_c > FAIL: gdb.arch/aarch64-pseudo-unwind.exp: p/x value > > This was tested on hardware (AWS's Graviton 3). Let me play with it a bit to understand what's up. I also see a > SIGSEGV in the test that shouldn't be there. I'm guessing some sort of raw register corruption, as it leads to > pc == 0x0. I think I understand what's going on here. In the callee, we have CFI stating we're saving the following registers: .cfi_offset 29, -16 // x29 (SP) .cfi_offset 30, -8 // x30 (LR) .cfi_offset 72, -32 // v8 -> 128-bit in size So we're reserving a slot of 16 bytes to save v8, which is fine. But later, when we go up a frame and try to put a v8 pseudo-register value to the frame there are two distinct scenarios. The first one is on a sytem that doesn't support SVE or that does support SVE but the vector length is 128-bit, which means z8 (the raw register) is the same size as v8 (the pseudo-register). This works fine, because we use the size of the raw register to put the pseudo-register value to the frame. Now, if we have SVE support and the vector length is bigger than 128-bit (in my case it is 256-bit), then using the size of the raw register (z8) will put 32 bytes into a slot of 16 bytes, corrupting (IIUC) both SP and LR, and leading to a segfault. Technically we would be fine with using the correct size of the slot when putting a pseudo-register to a frame, but I think there are further complications. Take, for instance, the following text from the aadwarf64 (https://github.com/ARM-software/abi-aa/blob/main/aadwarf64/aadwarf64.rst), note 5 from DWARF registers 64-95: "In a similar manner to the general register file the size of an FP/Advanced SIMD register is taken from some external context to the register number. If no context is available then only the least significant 64 bits of the register are referenced. In particular this means that the most significant part of a SIMD register is unrecoverable by frame unwinding." So this makes me think we might have situations where we don't know exactly what the size of the slot is. We may have saved all 128 bits of a v register, but it may also be the case we only saved 64 bits. How we distinguish what size to use for putting a v pseudo-register to a frame isn't completely clear to me at this point. I'm wondering if we should instead use x/w registers for testing this functionality for aarch64.