From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id KnnSCYAKjGVv0ysAWB0awg (envelope-from ) for ; Wed, 27 Dec 2023 06:29:04 -0500 Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=PaK0tdm7; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 17E261E0C3; Wed, 27 Dec 2023 06:29:04 -0500 (EST) Received: from server2.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 ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id EE03C1E091 for ; Wed, 27 Dec 2023 06:29:01 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 0D57B3858C2C for ; Wed, 27 Dec 2023 11:29:01 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0D57B3858C2C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1703676541; bh=eMN8AJgR8eSH8lltVoIhL5LgQLS2tVafpbxkAmjRbVg=; h=Date:Subject:To:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=PaK0tdm7TQkQfPATHlIiXeLeaPRxUAqFvQOVuhMASjlTnoi42lUojrzMB/xaAd+6O 5eTcd0sGay3dRiF7eRhcMmOaNpHefFkLekbOiqxFNvI0qAaPWcF2XSuy53q9EmBdfB x9boDTvXkLxuKKeTiLDzW2duiX/QieGI6ltj4lrs= Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-vi1eur04on2053.outbound.protection.outlook.com [40.107.8.53]) by sourceware.org (Postfix) with ESMTPS id 1E0D63858D32 for ; Wed, 27 Dec 2023 11:28:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1E0D63858D32 ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 1E0D63858D32 ARC-Seal: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1703676501; cv=pass; b=oG55yPvHfien7PUzZCH8YLYcINiH5AMSj0kPg/MrEIs+0UYVWgj/Dt454WipCWAWF7d2W837qaEOL+38hdQim9rMlB+ePhQDEwo1ouw4G5AWSSPCQeLO+vsZ4/2WqXWCnLO5h5Qr6kKDVTpVArMEqfmXxjhNOdYT4cKCQoH9f3w= ARC-Message-Signature: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1703676501; c=relaxed/simple; bh=9tMzesR8M6BML6moZZT/WeEyN8EcOIMifhGESxLWD5k=; h=DKIM-Signature:DKIM-Signature:Message-ID:Date:Subject:To:From: MIME-Version; b=BESJTFnfOOdGCVj/UdC2/rS36o2fDCJoyEqxNiH3ZS+/1vBEgqhLO7/JnKvOGtDeflsQGM9xx98FEWLuxxO5r3qoXTbpP0bixf6KQIk3rEfEap8s1p1zGUM45cFWpfXXnT/vVDAnDjfwktuJ1JsTEV148o3yIeSXCUobDB2/7hs= ARC-Authentication-Results: i=3; server2.sourceware.org ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=AGi+DfnGdFPpMeq9xyJfn9w5h8lAV46OLb7tY+vI+t4N0o8UnR/7QclCt1tbtCRClNtabNHoy4388y5zB4O7aNAeoUVXPZA32M8rQY8OTxl0hDZMr2p0uzFuJiF78lkkJ+yqgOGDFB+DJCiPNjPBb/ULaUw2njzLhLTU+dk6P3me59ifR4P7xyKaDV+vha+RUVQl3wYzLJ8mFDysgUySEpfYDOA0C8gKss/OROL/eCHPS6LjDJtqLLxF7t42i1CUUMJ0IKEaDd7j3TIs0lANjIKpM05u9qiDBmxqRYflljX70iVP2S05wl9IdRdIU5S8Y/ZbPPkNnKImzxo6oFkP9A== 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=eMN8AJgR8eSH8lltVoIhL5LgQLS2tVafpbxkAmjRbVg=; b=NHbAH1IyJnX3/sg9Iwo9dECBm+8RSUDH++d87wxEcv+szSexD1Bl/EBk1Q3raReKBjUfBFNAhYE2YaS6vvJN1m8yQyRTs5isiQGUZ0kBYAhwdp5JSkvILDxJ1SA4x0O4KJ/ZoJXgj6B5JjXg1sHDDBG160tWc2qK+MOgaOrRm2z2j32TQEsOm2+LN2R8QoVGMfL5s7NIyXmi165RivHmuyG1amUWmwGzT7NvmtKSLlBuFyvXB0tZIY+Y4cW39VqBMiF4DkkPRFHrpkNkDx3Pd7ti8vDGByIYcIdKSVXgDFeb1VQKXUq+n/LLq5YWKzUmn9Uufdh116XbwE+r3z2W/w== 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]) Received: from DU2PR04CA0018.eurprd04.prod.outlook.com (2603:10a6:10:3b::23) by DU0PR08MB8254.eurprd08.prod.outlook.com (2603:10a6:10:412::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7113.27; Wed, 27 Dec 2023 11:28:15 +0000 Received: from DB1PEPF0003922F.eurprd03.prod.outlook.com (2603:10a6:10:3b:cafe::47) by DU2PR04CA0018.outlook.office365.com (2603:10a6:10:3b::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7113.27 via Frontend Transport; Wed, 27 Dec 2023 11:28:15 +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 DB1PEPF0003922F.mail.protection.outlook.com (10.167.8.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7135.14 via Frontend Transport; Wed, 27 Dec 2023 11:28:14 +0000 Received: ("Tessian outbound 385ad2f98d71:v228"); Wed, 27 Dec 2023 11:28:14 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 57f04b3e441a32ef X-CR-MTA-TID: 64aa7808 Received: from ae6b12f041ea.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 0C3CAC0D-6644-47D2-923A-383D1466FF69.1; Wed, 27 Dec 2023 11:28:08 +0000 Received: from EUR03-AM7-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id ae6b12f041ea.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 27 Dec 2023 11:28:08 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LHta+9BBwakUjMAj/qhUfhbAAwJKTZcg927oY9uqj9qLNnsapDtUiUWHc9eCqSIY7UI425/J4U7Jhn86nONF62XhfjUjrqUzx/KSRD6mYm2G7r/zEuK0Nh+GXVlvzaLrAHP92esQd6nxQ8q01m0AONc+PzrMJGyc72hpoNsxfMz3vvRgGKtIMR886xq3ZSQb5pCIydunkjJbYXjghLA74iLzM301BYioNlyU4VVyDAk3tfHvx9HFfGjJFOlamXw/mJFqAKEjSq2Ti8KU0XpohiL4L1CCVa+oDiuyx8nApJgHtLyir9cbXGlHj13bKrx9/pZF7PSey95qd/x72FwRBg== 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=eMN8AJgR8eSH8lltVoIhL5LgQLS2tVafpbxkAmjRbVg=; b=JzcfCs5Tw880FcyVaBb/EjYSa9zXchtgmofF8GApowasAMVwtCadgvuyBhUf4MxydbyXYQOTqjaaoYuQ7zCj8vi1pVCZ2XXsC82x9RMIx7jE4WwULCuMe/E0HVj2ha87BwaWHgEVbJvTBMKSn6Jctsbx0YrbFOpTjg+nnld+eAbqpKSvm+OZEEqgIkOSm9Ug77jay34g45xeTm/U27G6p+3z5kLqYxPSNUTdQkJ6xTuaB178TXVatFhVBl56s+/taqH+RKXiPu2+iQapj4nMJSFd3b63sxnuzBkek2shcqoDtMFjS1EA+5sj6oNkL7hpVf4xbi/18FeVUaXSaBhKLA== 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 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 GVXPR08MB10785.eurprd08.prod.outlook.com (2603:10a6:150:156::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7113.27; Wed, 27 Dec 2023 11:28:07 +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.7113.027; Wed, 27 Dec 2023 11:28:06 +0000 Message-ID: Date: Wed, 27 Dec 2023 11:28:05 +0000 User-Agent: Mozilla Thunderbird Subject: Re: Questions on XML register descriptions Content-Language: en-US To: "H. Peter Anvin" , gdb@sourceware.org References: In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: LO4P123CA0692.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:37b::15) To VI1PR08MB3919.eurprd08.prod.outlook.com (2603:10a6:803:c4::31) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: VI1PR08MB3919:EE_|GVXPR08MB10785:EE_|DB1PEPF0003922F:EE_|DU0PR08MB8254:EE_ X-MS-Office365-Filtering-Correlation-Id: d1002c4e-72f9-48de-149d-08dc06ceeaa9 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: CWov/Z+NNujN5mr/XbPbWasKZUY3CbjHKdf9SO+XrTsuiZERYcPUEIxt1sHHxrvlKhZtinPw1r88ee8iiu/kFmCKrCdZ0/bcuYTGdlplRWgq9DBhrSYvDE3ke+lKmR2z+B1yDoBZAGsBfDmi/W6jfe1pAnHJDlv5VdP/+pA8aLNIxzlIj9nuvvgzUQw5K3Sr6o0ebt4FuHvQl2bctlUV3O/JXG+EPkdTmE7dA2K2K41+eq0jdbEo/h8Izy9LGwA8QqBrhHgE5FxGOWsjZdh7V0VObcJnK0zcLWD7BpsyutRW33XfiHHgbOyEL21Lc/kthrPu9bZ+/JvZKNUn4Ml/hj/iDgBlLzWIq1S69CLYINsYAgzsPWRdvf9wT9iDzLIl3KAQv/71Ihg9qLCVTWduaPvJGXHzOy42pUyjcnBSoA5OxTRDJBU5R8Gt50iSKkla254YBKp9pihDopSqJ2VGxTvBhQBtJUwniePoqHHB8vOyRGaKNoT/9omcnveuPP0QEa2R8VBj+Ha57KtQ/x4r4AqF1XD3tzXdjFsHbVFRHYGmxPo7V5t7VnVaWrZrxhFVpQJsiXHiItRD54SDwzvKUBfZptZ68762nCz2KthQy0ew9gSE2w/qrzNWDlniA9LLrIUoJLozkTFU701iLOTwDw== 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)(376002)(136003)(39860400002)(366004)(396003)(346002)(230922051799003)(64100799003)(451199024)(1800799012)(186009)(316002)(66899024)(8936002)(8676002)(6486002)(36756003)(478600001)(86362001)(31696002)(6506007)(2616005)(6512007)(26005)(53546011)(38100700002)(83380400001)(41300700001)(66946007)(66556008)(66476007)(5660300002)(44832011)(2906002)(31686004)(43740500002)(45980500001); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: GVXPR08MB10785 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: DB1PEPF0003922F.eurprd03.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 5ee62a0e-ed82-43e3-01ce-08dc06cee51b X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: dQjNjxyUqHjUj2wNmPLA2eJzaG/ETF0BH/IldVvOvrjmNDsJmGFpsma8xrjANe5JnOwCg1nHoCxpee6GCe+IXPMfd4vF+zWMA0C9mUIQoOmVih8BHjDzf+dnx2afmT0UMgfjfqP6d+tLqibMo5RmlIu6pvDhSaaybbyvtTTEZsrPEbiKuUS8Ejx1yIUyYWe964cci5kH30b5+zJhQZ6d8LdI59JY0Ulod53XNXakz0t4ZEOvUTRzVUxS47MaZXA0a6amtfWIWAxUPq+r0RjVa7q1pQQovC8KPRX7oBOZZZYIedD7hq0U04bHL/hvfSAZdOK6L8ImZmQkm/ygEr9X7YJQ6KdGMinl1J2ZqugKZ5S5dJoeo5Actv8nloYcUSahpPp8xJUg+08lXzqeWlIm8C66Gf4PwbMkf4NvbZgTlh1bXpANugDwPwt1aW5pYrOV0w61onDmE25W+FGcuXlOjKv0VHoTqtbGjOSqkQUIX12uXX73lAapVN2kianOp7ig6Idp5wQFQPDnKXgB7LNYbNQI0cNR/8//D/M04kkhM/tNqfMGTP7qJn8wuWNCFEN8Euwp/2V/Ul/PIAwMRQYDIsx4Ea8hzKiD74dPtLe8PXM+xqsIorskD4PTjwDnUAiZykkB91Hur+QpmIEg/Z8t1x2ilSGNZDobGGymyEC4deikZpAnD5qLXCyoqYKP1Q1T13C1nRdywSXYPcg4RzcoptyvLc5zUsp84fHIGBQssUypu6cjTS49N/TKe5hRkkPrGh98OsI67VZV9iNxGF5U/Q== 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)(376002)(39860400002)(136003)(396003)(230922051799003)(82310400011)(451199024)(1800799012)(64100799003)(186009)(36840700001)(46966006)(40470700004)(40460700003)(6506007)(336012)(26005)(2616005)(53546011)(6512007)(36860700001)(83380400001)(47076005)(5660300002)(44832011)(8676002)(478600001)(41300700001)(6486002)(2906002)(8936002)(316002)(70586007)(70206006)(86362001)(31696002)(36756003)(356005)(81166007)(82740400003)(31686004)(66899024)(40480700001)(43740500002); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Dec 2023 11:28:14.9746 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d1002c4e-72f9-48de-149d-08dc06ceeaa9 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: DB1PEPF0003922F.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR08MB8254 X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, BODY_8BITS, DKIM_SIGNED, DKIM_VALID, FORGED_SPF_HELO, 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=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Luis Machado via Gdb Reply-To: Luis Machado Errors-To: gdb-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb" Hi, On 12/26/23 22:42, H. Peter Anvin via Gdb wrote: > Hi, > > I have been looking at the XML register descriptions, and I have a couple of questions, as I'm trying to add gdb remote support to an emulator, which involves additional system-level registers as well as memory spaces. > > 1. Some registers can't be written to, and some registers may affect other registers. What, if anything, is the best way to handle that? There isn't a single right way. You could teach gdb about those registers explicitly (not ideal) or you could make the remote just ignore or error out when gdb tries to modify such a register. As for side-effects (changing a register has an effect on a different register), this might be best implemented via p/P packets. With those gdb can write out one specific register and then it re-reads the rest of the registers. In such a case, you get the opportunity to apply the side-effects to other registers in time for sending the updated register buffer block. This is a bit odd with the g/G packets, as it gets confusing having to write all registers at once, and you might not know what values have changed or not. > > 2. How do the G/g commands interact with the XML target descriptions? Do they apply specifically to group="general", or are there other rules? My recollection of it is that G/g will request all of the reported XML register with non-zero sizes. If p/P is also supported, gdb will attempt to fetch things using g and write things using P. I vaguely recall something about gdb not requesting some register in g, but I'm not sure if that's still a thing. > > 3. Is there any concept at all of different address spaces in gdb? Alternatively, is there any way to tell gdb that it should communicate addresses wider than the pointer type of the base architecture (which would allow a Python helper script to define a convenience API.> Yes, but the architecture-specific / os-specific layers need to be taught about it. Ideally the compiler would also establish a way of communicating this information to debuggers via the generated DWARF info. See DW_AT_address_class in the DWARF standard. Are we talking about short pointers here? Say, a 16-bit pointer in a 32-bit address space? > 4. There doesn't seem to be a way to trigger a Python function when a connection is *established*, which is as far as I understand the point at which the XML register description is downloaded from the remote, and definitely the first point at which register values can be examined. Am I missing something obvious? > The Python API is still growing. If this is needed, I'd make the case to the gdb community. Patches are always welcome. > 5. I presume the byte codes use for the Z commands are the same as the agent bytecode in Appendix F, even though the latter specifically seems to be referring to tracepoints? Yes, the byte codes used for evaluating breakpoint conditions is the same as the ones used for tracepoints. The documentation could make that a bit more explict. > > Many thanks, > >     -hpa