From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2062.outbound.protection.outlook.com [40.107.20.62]) by sourceware.org (Postfix) with ESMTPS id 04EF0385800A for ; Thu, 7 Sep 2023 17:47:22 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 04EF0385800A 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=DZMFQeoEGs/8JrGoDcHZNTVrzoUwjVenJwBAtT60avA=; b=jGGN8ZMOVBlubraEFOPLwf7ri4j/psHs5ouGZJSKbN85mEuA8Fr5Jv74jD5idlK3aIL39hv2RQqklX+BEyObNqqLLgiLdpc7vG6zTTCYayh3y0YXJXhiMowpHtfnXTqAGgPMMekl5Ei+eG+g/g+hDH47+OaYzskciriImK5XvVs= Received: from AM6P192CA0031.EURP192.PROD.OUTLOOK.COM (2603:10a6:209:83::44) by AS2PR08MB10208.eurprd08.prod.outlook.com (2603:10a6:20b:648::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6745.34; Thu, 7 Sep 2023 17:47:19 +0000 Received: from AM7EUR03FT012.eop-EUR03.prod.protection.outlook.com (2603:10a6:209:83:cafe::f5) by AM6P192CA0031.outlook.office365.com (2603:10a6:209:83::44) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6745.34 via Frontend Transport; Thu, 7 Sep 2023 17:47: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 AM7EUR03FT012.mail.protection.outlook.com (100.127.141.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6768.30 via Frontend Transport; Thu, 7 Sep 2023 17:47:19 +0000 Received: ("Tessian outbound 5c548696a0e7:v175"); Thu, 07 Sep 2023 17:47:19 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 2862ad4860c8d7d2 X-CR-MTA-TID: 64aa7808 Received: from a4d789593690.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id E260A32D-950C-4B02-B775-ED2631E73480.1; Thu, 07 Sep 2023 17:47:13 +0000 Received: from EUR05-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id a4d789593690.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 07 Sep 2023 17:47:13 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=S3adhG487kjOfXAnBB7EArTmlakzLK0i0Hz7l3FHGV3ToUENIbpMYyLPuokoXlBjGGJPMpVjNu1tw/D37X6EpsUfuu15+inV/kCn7XcO74pY06PhGWvYOTB1bcyxWmGJNqZ4P8eEo7aLFOpessRpppB9RlSH7McsT6FpPqhPHnKf3yDrE5xIhYEImIz2pRV41bMiARpNh3mlCstr1eGRP7/aqOVokt1R/hnvGcCL8tSFmjsutcTHann0U/2M2MCBNm/vnyeYtC05flJp+IF4YmRjy7LKyA25D2YWcAzW4++wEUIFZaLRBHv7IboV0KNGHAUIU3mpHmf/MKeXgJnRUw== 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=DZMFQeoEGs/8JrGoDcHZNTVrzoUwjVenJwBAtT60avA=; b=IR+92zB2/L8qRGndbLgQl1yNamriTsKkuRPLOOJc4PjDSOOLpA57htcZSv5HCr/F0J/sl59vX76pJWQ5IyiwbJ5hD7cDoiRAW58pz9J0wGXEuoiHiFNOnwOiUsXuYBV01FMKkZuf2vVk8WFVIh7md1aom18lxOeU+8siyNb8phTd1a/25APmm4o5ujLksO5b6MvAh5wrXu8bAqzEnkPhFL0RpwZulVzBL33uuF46YlgQfptsO+uuMkYAgN+K+C+KxVdK4fcHZCg/HGQrLJRR7sDtfWLr8Iag2W1qv2F0u1XptyU/22M2zcVIKZhvfQ1QyiK11XJO+lFfyyjHrdviag== 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=DZMFQeoEGs/8JrGoDcHZNTVrzoUwjVenJwBAtT60avA=; b=jGGN8ZMOVBlubraEFOPLwf7ri4j/psHs5ouGZJSKbN85mEuA8Fr5Jv74jD5idlK3aIL39hv2RQqklX+BEyObNqqLLgiLdpc7vG6zTTCYayh3y0YXJXhiMowpHtfnXTqAGgPMMekl5Ei+eG+g/g+hDH47+OaYzskciriImK5XvVs= 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 AS8PR08MB6040.eurprd08.prod.outlook.com (2603:10a6:20b:296::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6745.34; Thu, 7 Sep 2023 17:47:11 +0000 Received: from VI1PR08MB3919.eurprd08.prod.outlook.com ([fe80::7743:60fe:4859:2df2]) by VI1PR08MB3919.eurprd08.prod.outlook.com ([fe80::7743:60fe:4859:2df2%6]) with mapi id 15.20.6745.034; Thu, 7 Sep 2023 17:47:10 +0000 Message-ID: Date: Thu, 7 Sep 2023 18:47:09 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [PATCH] gdb/tdesc: Don't assign custom-group tdesc registers to 'general' Content-Language: en-US To: Ciaran Woodward , gdb-patches@sourceware.org References: <20230907170752.28639-1-ciaranwoodward@xmos.com> From: Luis Machado In-Reply-To: <20230907170752.28639-1-ciaranwoodward@xmos.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO4P123CA0032.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:151::19) To VI1PR08MB3919.eurprd08.prod.outlook.com (2603:10a6:803:c4::31) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: VI1PR08MB3919:EE_|AS8PR08MB6040:EE_|AM7EUR03FT012:EE_|AS2PR08MB10208:EE_ X-MS-Office365-Filtering-Correlation-Id: 9d6fe1d1-b3f5-4ac1-4e72-08dbafca7bb4 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: 8yr25iW2gHMKPZ7vJ+i0A0HvSlZv1rY0hDQoiSO04jWxDfXriNyOwqZVts5xgHGS8ROa6J+GQnnvoWvxZI9JrebmUQScCwdIIhBLGYFa0ynteT6Gz/YEOLH4F4GDWpOBWHyWmrKWerpQVi0LjWfB8scrTCoYOvu9Rl82324nZRX8rKpxR/VZsGi2DDJNudd4EXC3uCSslKDN71aEPHorRrQjD9lfIVhhVidmcJbxhh7GP6tt8ezxrj386AYCXa43tXkULBnn+sNAWJ03E9d3q2CJEZEiqXMkaQ+Xl8T31jMFhkjLQM74p5P7kt/eGDOAEAkV1o9IXUkxzzplvTqQKY1Cyd3qa2fvsbHKfrr7Xlj/cbbrgk8BOHBTTfVko5NoP6zeUqwtpgANsrOmQeilBdjtnTjb+9wzS3JkU7V9rkb/idgEPndxncBNpHaTm4Kpe2bLTAcwNens5l8igufvZeFdUGG4fzL02KH2Eo92n7Zrwv3qKscPocfVsx8sqxqt5XtfKwTRbNydVwL4Amv42Z4s2JW5biBj1VYiMbnQmlt/cIMZKgHztoax3IsHCatMMXSCuDEOW/gGuMVPxR/o4yb+pp0M78lqhuA33oSji+PxFSAYJrposBIL5LzAaz8YEUwo8czE1xhhS9o/GXGFYQ== 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)(366004)(396003)(136003)(346002)(39860400002)(376002)(451199024)(186009)(1800799009)(31686004)(66946007)(53546011)(6512007)(6486002)(66476007)(6506007)(31696002)(36756003)(38100700002)(86362001)(2616005)(2906002)(26005)(966005)(478600001)(83380400001)(8936002)(5660300002)(41300700001)(44832011)(8676002)(316002)(66556008)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB6040 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: AM7EUR03FT012.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 39a231c1-4399-4375-d305-08dbafca764e X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: q8mEJuANuAsNflnY14pbFW4j4e+25ouxapOZTccpeDqOYSGDGcrzDbkYWROQEXDk8h+8C1BssC1drfnxPbkHJh2k3RFam3hy/cbvTsrbEFEw4vNm+pnoPDUxeluhBhyg4TXyALnMJaYrJ0Ss343Xvuis0ui8aK+yKwvSF/An8r7SexpYTI+mWqGrbvnZs7vTiifT3UGJaCi2G1GpW2/XXU+/fy5Yci8Ut0zDojWl41Oql/GGfes+EjTQ5C8Q/JL27/B9SWUU3V1FzEUlmMAqyLrbk1+B1Rtip+PjbHk36+/+1CCYC4UZCWTRsPBZAvgeaQmnh40IqgsUl31hfyVw20HLKx8xJHzOI7YduRlSYTkl+rNe7dyJ/4HgKGXVSLoCMnvxVvVvjOvn5mCRZMtsVuKRk9n80B/MocvmTvsBkVYY6BJp9vtkdHqtmzXWLaF3H5yJE7pgxARosjQsdvG1BSsQqgGsy38U9RbY8aIE8PvGF6Uc7wY4yC3MFKSEWs5QP3Y7w2xRp+qA8DkjvbI6yoBdvwab2FVz9qGgya9YnzvqVz5O9NhNVFSxtrgziwqcVMPwXOD6Bh7wLv8xcUO+07VKx1aGyaWjQUsx+qNMJWwqfyRywlRBRMby3MIfVKibEe0sH5EB9C3LwdpvokPZwZ34GRQLm/i8xezCOvjci9aB68meAGvsOI8Uz07Ta+P0xFa3P3YvMXNcMaM4ERp1h/kX79g6PtMF3O8LMm4/h6GxWx7ZepXvfLk0TPoQbKhf 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)(396003)(346002)(376002)(39860400002)(136003)(82310400011)(451199024)(1800799009)(186009)(46966006)(36840700001)(40470700004)(356005)(53546011)(6486002)(6506007)(6512007)(478600001)(83380400001)(966005)(2616005)(336012)(26005)(2906002)(316002)(44832011)(8936002)(8676002)(70206006)(41300700001)(5660300002)(70586007)(40460700003)(82740400003)(31696002)(40480700001)(36860700001)(36756003)(47076005)(86362001)(81166007)(31686004)(43740500002);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Sep 2023 17:47:19.6100 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9d6fe1d1-b3f5-4ac1-4e72-08dbafca7bb4 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: AM7EUR03FT012.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS2PR08MB10208 X-Spam-Status: No, score=-12.5 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,FORGED_SPF_HELO,GIT_PATCH_0,KAM_DMARC_NONE,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE,TXREP,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: Hi, On 9/7/23 18:07, Ciaran Woodward wrote: > The 'Target Description' mechanism in GDB enables the target to > supply the full set of registers available on the system to gdb > in an XML format. > > This format enables setting the 'group' of each register, such > that they can be queried using the 'info registers ' > mechanism. > > However prior to this change, even if a register was explicitly > assigned to a group, it would still show up in the > 'info registers general' report. This is unexpected, and also > disagrees with the comment above the tdesc_register_in_reggroup_p > function, which says that '-1' should be returned if the register > group is not-known, not the register group is known, but differs. > > There was a previous change that did address this issue in > aa66aac47b4dd38f9524ddb5546c08cc09930d37 > but it also caused registers with *no* group in the target > description to be removed from 'general', so it was reverted in > 440cf44eb0f70830b8d8ac35289f84129c7a35c1 > as that behaviour was used by some targets. > > The change in this commit enhances the usefulness of the tdesc > 'group' attribute for adding system configuration registers, > of which there may be hundreds - very inconvenient to request > and print on every 'info registers' call. > --- > > Email archive link to discussion of previously referenced patch: > https://inbox.sourceware.org/gdb-patches/20200120155315.30333-1-shahab.vahedi@gmail.com/T/#m0ce2983153b2f482b66461ed6b97c4b287b09a89 > > gdb/target-descriptions.c | 7 +++---- > 1 file changed, 3 insertions(+), 4 deletions(-) > > diff --git a/gdb/target-descriptions.c b/gdb/target-descriptions.c > index cdedf88c793..c1bb03c3adf 100644 > --- a/gdb/target-descriptions.c > +++ b/gdb/target-descriptions.c > @@ -954,14 +954,13 @@ tdesc_register_in_reggroup_p (struct gdbarch *gdbarch, int regno, > { > struct tdesc_reg *reg = tdesc_find_register (gdbarch, regno); > > - if (reg != NULL && !reg->group.empty () > - && (reg->group == reggroup->name ())) > - return 1; > - > if (reg != NULL > && (reggroup == save_reggroup || reggroup == restore_reggroup)) > return reg->save_restore; > > + if (reg != NULL && !reg->group.empty ()) > + return (reg->group == reggroup->name ()); > + > return -1; > } > Yeah, this is a hard one. Unfortunately the outcome then was that we have a number of debugging stubs out in the open that advertise xml's with less-than-correct group information. I think even gdb, to this day, is guilty of that. Though the patch doesn't regress things as much as before, it still makes the 32-bit Arm gdb drop the fpscr register from the general display (info registers). Depending on what others think, and the benefit of not having a bunch of system registers show up every time, we could cope with this particular regression.