From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id SUWcA6GF12muzg4AWB0awg (envelope-from ) for ; Thu, 09 Apr 2026 06:55:29 -0400 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=ZKZVLcyy; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=ZKZVLcyy; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 0782F1E0BC; Thu, 09 Apr 2026 06:55:29 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED, RCVD_IN_VALIDITY_RPBL_BLOCKED,RCVD_IN_VALIDITY_SAFE_BLOCKED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [38.145.34.32]) (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 CDD391E08C for ; Thu, 09 Apr 2026 06:55:27 -0400 (EDT) Received: from vm01.sourceware.org (localhost [127.0.0.1]) by sourceware.org (Postfix) with ESMTP id 43B434BA2E20 for ; Thu, 9 Apr 2026 10:55:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 43B434BA2E20 Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=ZKZVLcyy; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=ZKZVLcyy Received: from OSPPR02CU001.outbound.protection.outlook.com (mail-norwayeastazon11013070.outbound.protection.outlook.com [40.107.159.70]) by sourceware.org (Postfix) with ESMTPS id F305E4BA23CC for ; Thu, 9 Apr 2026 10:54:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org F305E4BA23CC 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 F305E4BA23CC Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=40.107.159.70 ARC-Seal: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1775732049; cv=pass; b=hJvGxaDiQFoVWT3Wm3ixnigXlKPZnbVHyG5rG0EBfkJz6/4aeeIFsQRCjOnMZNfmOcWQyAFNbBMDW9nlgk4Zhzg+to/w56VhwmulRoDB/WinKDaSh/XZbw8ahDkpU1cjH12szpL7JjbhDzmxeRWcMWEPbApplqf9wDlXCZHVUk4= ARC-Message-Signature: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1775732049; c=relaxed/simple; bh=52VJuS6m0HWl6lMtrsLdkPBuvAehMY4FJaAuKIWwcfg=; h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-ID: MIME-Version; b=phA14Icv4gzpRvjYN1K9JQ24w/REV+7bIHWe0jOJ70vYOhoysJpJXZHLL0eKF4qrZbS02+v2wjSQv+XydiGP0kukt9xeocm5O6PdjUlh/LgmEFCn2NUkc/U4pw5G9Nbx7tbeabJcP0qgKPWYpjnG/rYCgpZJdoxg9y90GriSYOY= ARC-Authentication-Results: i=3; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F305E4BA23CC ARC-Seal: i=2; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=pass; b=vWByi6PR2aZcxrPX7RsMlE60ULkBxly4KjrFgg+m82JrVBIAIJLmCLCNj1Fi0MoFQv5UY6tYOyr8z5l2BYetXHg2fqYb4Jvwh71bM/Z+Of5VqChbRBU/l7lAv8F5rxQEInf+TmeeDJN4yC/HIixsokKhkedYczx1W/QPIX/x5ugZtmGNbpBbktn/ZhLfFV8MuV04QoxqpG8QXCEwKQAaPpXKxwsGPqlanjBnoWcb8OuE/Ch3krYz/MgxQAzTwL8ub4UlAhrIZ/q+qRTdMjzaTV2UNfJm7tyaDBtxgQ/P/rL4cHVezw/HU0qFGVYey5+oRcVRfa/NpOh8hIVFgGERow== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=tEPBZOpxL8uggHV5LdVLPCpoAW6usPurgRzZPXw8z8w=; b=WrbM7vEUVGmS81ubcKJFDLEKHhVm++jH6TfYAz4AYBk3FKGNyL73agjQMMzknviYfGHgkZ92PQjmzALQKkIPpGkQKg8cbkA4DrKzsjtvNTsql2vvZJVDyDCdaQgLP3Swsd8EcHwA5N4g7983x9EbWxWmv6wiw3/TuRqRMx55djQdDH4C8BhoHTwh7pUiLqMfsua4wsLrGWNRfzwKDXBNydjRjeE3tNdknrW8pHnrAGomVSzGIcIpMlNTVcDuySK9pCHgNFZVC5cQjGRt9vJQSojKXeXeYv/2WYwb13QyLa8XGxKJxHdDsfHKOt1B088dyjYmng+yD+rIrnTc8EtkMg== ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 4.158.2.129) 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=arm.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dmarc=[1,1,header.from=arm.com]) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arm.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=tEPBZOpxL8uggHV5LdVLPCpoAW6usPurgRzZPXw8z8w=; b=ZKZVLcyy26+utvyDCCzZm60YvMYlOD5kRq8lUUi7zYlgaksz2PGx7pIwBcM5qJSma02Nqj/VzPMcDWmt0QYsh6GUzAJSSd+T7TyubbcP0gNh2TcdhLF+4/Vwr0YGBhEQUMrfM2Gt7uqbohD7Co2TJ66avEswPBbkG1umsgHuP3Y= Received: from DB8PR04CA0026.eurprd04.prod.outlook.com (2603:10a6:10:110::36) by AS1PR08MB7610.eurprd08.prod.outlook.com (2603:10a6:20b:475::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9769.17; Thu, 9 Apr 2026 10:53:53 +0000 Received: from DB1PEPF000509E3.eurprd03.prod.outlook.com (2603:10a6:10:110:cafe::35) by DB8PR04CA0026.outlook.office365.com (2603:10a6:10:110::36) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9769.37 via Frontend Transport; Thu, 9 Apr 2026 10:53:52 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 4.158.2.129) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=arm.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 4.158.2.129 as permitted sender) receiver=protection.outlook.com; client-ip=4.158.2.129; helo=outbound-uk1.az.dlp.m.darktrace.com; pr=C Received: from outbound-uk1.az.dlp.m.darktrace.com (4.158.2.129) by DB1PEPF000509E3.mail.protection.outlook.com (10.167.242.53) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9745.21 via Frontend Transport; Thu, 9 Apr 2026 10:53:52 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=uZvEoTLISicIxyNuYISmoM/hvba6hwO1kS4+oYSev/DDy9f1QkrmCcHJUueKB29gDFrjp2QweG5JiXhicJ5lznRkIcHvhQAUkabuAe2Z2TFdT9f+/kPY5xYhyjaRq97auCZ6UkaeZzLjPZmKPL/yVzMEPTK/cvPYaDn2RsgCk0v28cEwpJJmsnDDVxJo/7ZJ8U9oPKRdRLur8ZjOpJ4z4/IFHP/ZHH1UX7jt+oX9ajuLAFB/Bg0d7piR2DunD3ypoUCJ0YTalhO2CGezjEXmX87liRX82+Y3lsz2s3qE0LmO2v0k+5bTTiGo9++xGog85suIYlwjwTf1Xb+uiwIWmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=tEPBZOpxL8uggHV5LdVLPCpoAW6usPurgRzZPXw8z8w=; b=qRujPjDk6AWo0aOeP44LZeJp08BUq9aUOuMs8W260enj3f3vDVVWj7ht39mC9NEB1Yc9rK0OkpsY8rVkAugxYVzHO6gcOPHBuHvYeXRFxRS8xIq2iBplm4wfw2WUbIRnkKXeCoxU0HicDdzm93FnbqSOqZbCeVuMlpxZWUGslDRl5AzSbrq0+LycvpvNOSoj3/N/Q777NIWbUAJjX3ishPsRsp4ZCNYsdDkf81YDRURuCVZG1MwvQbzNlcXW9B98GOAkFolt2eJf2d+Bgo5o8j6uuE3M1vZTFz2JZsCJdYiqf68DWs61KGv4vi9goLFlz+7xrUrr4V1psK0qawZRcg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 172.205.89.229) smtp.rcpttodomain=sourceware.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arm.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=tEPBZOpxL8uggHV5LdVLPCpoAW6usPurgRzZPXw8z8w=; b=ZKZVLcyy26+utvyDCCzZm60YvMYlOD5kRq8lUUi7zYlgaksz2PGx7pIwBcM5qJSma02Nqj/VzPMcDWmt0QYsh6GUzAJSSd+T7TyubbcP0gNh2TcdhLF+4/Vwr0YGBhEQUMrfM2Gt7uqbohD7Co2TJ66avEswPBbkG1umsgHuP3Y= Received: from DU7P190CA0010.EURP190.PROD.OUTLOOK.COM (2603:10a6:10:550::29) by GV2PR08MB8727.eurprd08.prod.outlook.com (2603:10a6:150:b6::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9769.18; Thu, 9 Apr 2026 10:52:42 +0000 Received: from DB1PEPF000509FA.eurprd03.prod.outlook.com (2603:10a6:10:550:cafe::b9) by DU7P190CA0010.outlook.office365.com (2603:10a6:10:550::29) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9769.40 via Frontend Transport; Thu, 9 Apr 2026 10:52:42 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 172.205.89.229) smtp.mailfrom=arm.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 172.205.89.229 as permitted sender) receiver=protection.outlook.com; client-ip=172.205.89.229; helo=nebula.arm.com; pr=C Received: from nebula.arm.com (172.205.89.229) by DB1PEPF000509FA.mail.protection.outlook.com (10.167.242.36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9769.17 via Frontend Transport; Thu, 9 Apr 2026 10:52:42 +0000 Received: from AZ-NEU-EX04.Arm.com (10.240.25.138) by AZ-NEU-EX03.Arm.com (10.240.25.137) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.29; Thu, 9 Apr 2026 10:52:39 +0000 Received: from PF4S4363.arm.com (10.1.34.63) by mail.arm.com (10.240.25.138) with Microsoft SMTP Server id 15.2.2562.29 via Frontend Transport; Thu, 9 Apr 2026 10:52:39 +0000 From: Matthieu Longo To: , Tom Tromey CC: Matthieu Longo Subject: [PATCH v1 4/4] gdb/python: work around missing symbols not yet part of Python limited API Date: Thu, 9 Apr 2026 11:51:55 +0100 Message-ID: <20260409105155.1416274-5-matthieu.longo@arm.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260409105155.1416274-1-matthieu.longo@arm.com> References: <20260409105155.1416274-1-matthieu.longo@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: DB1PEPF000509FA:EE_|GV2PR08MB8727:EE_|DB1PEPF000509E3:EE_|AS1PR08MB7610:EE_ X-MS-Office365-Filtering-Correlation-Id: 496d35cd-e557-4b38-1166-08de962649cc x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; ARA:13230040|376014|36860700016|1800799024|82310400026|13003099007|56012099003|22082099003|18002099003; X-Microsoft-Antispam-Message-Info-Original: prluxwd7R6TV8EQnFDmjryrM4ns5KtbU6uNk1e0PKlF3cUHTE2Mi8it06l4JZ58Jxlor5WxITIVjdJJIfkFLffisLteXccQiFhYdME7E20IXFe+XZ4Y6pfcqKDa4Sbd80X0oFUrSAOBsW6HV2Ug9z9YtOptNxTXxG13EUzP5RIBH2O08bGAJ3qTfPYXsntAUSrh/kFdE9jlnH2qtr3mNtYxeG/Lc3EFlypGM5WKsM/A2llzXma97ge79gBneGsSrge95J+VOjZgbBQmaxE5xW/9n3/VnuTxrH24hB5ENdgjfmjIy/fQYYxjgqbQq0zuDy2eK8VkCwl4jl/19MYsuUm2GhIy3PyI952mq6iDIrzmqsEBClfPXH6TuWRvTeB5U/1L9afyLbjFNOoinyKxos6cit6UwOM9iNbTYhOnvqL2bxcleI0omZkTncQxR5YPEtSUQAmSYbfkfCcVfWi4aOUCsTuWtYarPkIbxxgezBff0EnLMowmNXr9HT+iCI4D1T9Q3J6ivq62gJtEBXJco72wHdrvE69mi4UW+iTL4IPtJFuwC6syZ2Kz4iEUs7+KbBKeBvA6jx4DI+UBNpgKehrJxSddGxPOmfkmxQdQ7QIouArcTglzoocPs7jrC6p0KJqYg/SepCj/QhJYY5R2MVjrSiYqHrg4omTYwbSz9VuUo9VoHQB0Rp6m4tXspW1+xhHh/A6h3CaXF+TtYluiOkjXLUk3gJYWmAo6PCelOSff017ONTQ4tc/xuvlLrgUDWkZ4gyw3tf+Dxkx4NeG4Yk1wjkSpjfdstNbJ+2pSxi9o= X-Forefront-Antispam-Report-Untrusted: CIP:172.205.89.229; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:nebula.arm.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230040)(376014)(36860700016)(1800799024)(82310400026)(13003099007)(56012099003)(22082099003)(18002099003); DIR:OUT; SFP:1101; X-Exchange-RoutingPolicyChecked: vqDoTn3KmcoWfIGuRrWYpqKYR1V4mcbpGDw8P/yIl/VEbRubtjJp2qe90tszex84L1Yf/03tgJhjQUPpUv4SQ+NeC1OH+niV7gZrcXG/doTnZwKxNFa68Sm+8xhl0R8YBMIIJcHsuSoxoYf0hNySGhOzALcaE+xdRVqMU+AA8SDlYe2FOLsdwALNSOSgT7etrSQrGmCbG87YcLoziB/rpg6FCyjFxsFAhrK/hMHHTCPh2HZuci4v/8JfYCWqKHtb7O4WCGSOwiiBqZ1qB6xoRSlXRkbhE+2Ys/Yd2o08fqUPLOQss0cjIoCppFzSZgEJxdDoks17PJRiXGhnfUXnAw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV2PR08MB8727 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB1PEPF000509E3.eurprd03.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 7cb9376c-f3c3-44cd-2f93-08de96262040 X-Microsoft-Antispam: BCL:0; ARA:13230040|36860700016|35042699022|14060799003|1800799024|82310400026|376014|13003099007|18002099003|56012099003|22082099003; X-Microsoft-Antispam-Message-Info: ucNF1ppKqXI3YX5viMZ03teAaH7PGm9pWSTgabrkqwpS/+gsfx0zb5oCq7kwxgTFvHiojFdzGof+uzg2yBebl2O5PMKjx5KDdyYd/mbcpA2ZjyxrzN7NMZMy6L428/8u0hz6RW5R9FFupTqnojw/4wIhp7Yz29Al3Cm/XAKZ1RfWSzViLNG1iy+72gHKZ9s3iec2Lh1aEdlnYTec50gwPv6O6eppyX16jZKbY1B+qu2onNN7RMt/Pd5FXckDErtZozv++wTHRR8zFED9HwSD474UreimOvA20/bxHpvOYVAjdC6bYrhnfs+hjDMU9aUgMZa4XM4cLFWZYeAKBUkHcIKOuSBe5p2uY3Xzgp7lQaBiSg8Nk7eYB0fbiqtIfiWdq7kagDPsDH0pgpvSOQFANFrmmp17vkF2tt+lgYdKrveBP95sqjOIR4bzU+wfXSyMoJPMCao3kfsZiBvyHaCG2i5ZQf9qwKhaIN9ivhs3qV8utZjhdoJLuZwBUFqpAdRXjLINo91ilW9y+mquPKWAzt3wl5Vllwp3Flr2lqun+SHeTDA10BtAWKxlM0IVowZfeep1mcrn89MaxDLruioL9rococn0hJfLlAww4XYELpKPelEemOkUW451BWwyR01iWNQq8gLXIYKkvGeO5SbQCHfDAph4oDPcKiPCfcAGtvM8aVQaM6zZQhsEiqmk0Z7UZUSRJgCAhIqUE+BLj/S31Jwh6r3PrExViSojtsbyFYhRIBEiK5yQsjWG5lAN+z5+H9JiK0oRa8aGUcStn68fR2T1AE9MAp/174VFeJ9Fnbo= X-Forefront-Antispam-Report: CIP:4.158.2.129; CTRY:GB; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:outbound-uk1.az.dlp.m.darktrace.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230040)(36860700016)(35042699022)(14060799003)(1800799024)(82310400026)(376014)(13003099007)(18002099003)(56012099003)(22082099003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: KLhFRTDHF/WYX1omfMRhpMiGDnE9xDBJYVe0FZ1z6DVP5/w+cDSHT/se29K1skqgkaxJtNC5+Xm9pvd9mvmXPP16i66aytm2oM5GAdZulxE8GdYzqdd99tkD53Sv6zFVZTvArc60gutdzrsMksQh5BynxBN6Oc98VxUz+fHweYaMGY/I8R83Fy4Ecv5dNFCrtxNkA9H6Z8savTCLBsBBCy7iecbXipJbiikMkwNegG5KfkDZ8Lepox2jOdEMtfmIdM9cIOZ5yeW0QhBzQlhtW1fHgyOdf0zONSFR+C0H/gtrukH4vJdlp6S75eGSgDb98zXiGwjwv3ro3AZsSc7+OJ32902b1i6Gz457FfqR14UfjqaFAaamvdV2guTvVARxccxeko0Ufw3mQAs5B0H672aKDrKJGNh5xJRhXptEHvCEVaYUQGXjCS4q2JZy8eHu X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Apr 2026 10:53:52.3748 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 496d35cd-e557-4b38-1166-08de962649cc X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[4.158.2.129]; Helo=[outbound-uk1.az.dlp.m.darktrace.com] X-MS-Exchange-CrossTenant-AuthSource: DB1PEPF000509E3.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS1PR08MB7610 X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org Most Python API usages in GDB can be migrated to the limited API, except the following: - PEP-741's configuration structures and functions, which use opaque types. They were originally intended to be part of the Python limited API, but some Python core maintainers opposed their inclusion at the time. - PyOS_ReadlineFunctionPointer, a global variable storing a function used to override PyOS_StdioReadline(). The signature has remained unchanged for a long time. - PyRun_InteractiveLoop, used to read and execute Python statements when embedding an interactive interpreter. Its signature has also remained stable for a long time. Since no limited API alternatives exist for these, and given their long history of ABI stability, one approach is to expose them in a GDB header and rely on their continued stability. While this is not without risk, it seems acceptable given the arguments above. This would remove the remaining obstacles preventing GDB from being agnostic to the Python version available at runtime. That said, issues should be opened on CPython issue tracker to request that these functions be included in the limited API in future versions. Last but not least, GDB does not need to officially support the Python limited API. The '--enable-py-limited-api' option can remain experimental, with appropriate forewarnings about its limitations and guarantees. This patch adds a new header, python-limited-api-missing.h, which exposes symbols not yet part of the Python limited API. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=23830 --- gdb/python/python-internal.h | 3 ++ gdb/python/python-limited-api-missing.h | 62 +++++++++++++++++++++++++ 2 files changed, 65 insertions(+) create mode 100644 gdb/python/python-limited-api-missing.h diff --git a/gdb/python/python-internal.h b/gdb/python/python-internal.h index ca70ca57fd2..e85bc51f2fc 100644 --- a/gdb/python/python-internal.h +++ b/gdb/python/python-internal.h @@ -57,6 +57,9 @@ double quotes. On case-insensitive filesystems, this prevents us from including our python/python.h header file. */ #include +#ifdef Py_LIMITED_API +#include "python-limited-api-missing.h" +#endif #include #include "py-ref.h" #include "py-obj-type.h" diff --git a/gdb/python/python-limited-api-missing.h b/gdb/python/python-limited-api-missing.h new file mode 100644 index 00000000000..07882ca1cf2 --- /dev/null +++ b/gdb/python/python-limited-api-missing.h @@ -0,0 +1,62 @@ +/* Gdb/Python header exposing missing symbols in the Python limited API. + Note: this is a workaround solution until those existing symbols below, + or new symbols are exposed in the limited API. + + Copyright (C) 2026 Free Software Foundation, Inc. + + This file is part of GDB. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#ifndef GDB_PYTHON_LIMITED_API_MISSING_H +#define GDB_PYTHON_LIMITED_API_MISSING_H + +#ifdef Py_LIMITED_API +extern "C" +{ + +/* Symbols belonging to the configuration API introduced in PEP-741, and + required in gdb_PyInitializer. */ + +typedef struct PyInitConfig PyInitConfig; + +PyAPI_FUNC(PyInitConfig*) PyInitConfig_Create (void); +PyAPI_FUNC(void) PyInitConfig_Free (PyInitConfig *config); + +PyAPI_FUNC(int) PyInitConfig_SetInt (PyInitConfig *config, + const char *name, + int64_t value); +PyAPI_FUNC(int) PyInitConfig_SetStr (PyInitConfig *config, + const char *name, + const char *value); + +PyAPI_FUNC(int) PyInitConfig_GetError (PyInitConfig* config, + const char **err_msg); +PyAPI_FUNC(int) PyInitConfig_GetExitCode (PyInitConfig* config, + int *exitcode); + +PyAPI_FUNC(int) Py_InitializeFromInitConfig (PyInitConfig *config); + +/* Handler for GDB's readline support. */ + +PyAPI_DATA(char) *(*PyOS_ReadlineFunctionPointer)(FILE *, FILE *, const char *); + +/* Utils from Python's high level layer API. */ + +PyAPI_FUNC(int) PyRun_InteractiveLoop (FILE *f, const char *p); + +} +#endif /* Py_LIMITED_API */ + +#endif /* GDB_PYTHON_LIMITED_API_MISSING_H */ -- 2.53.0