From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 7quZF4uy22p00xAAWB0awg (envelope-from ) for ; Fri, 23 Oct 2026 15:16:27 -0400 Authentication-Results: simark.ca; dkim=fail reason="signature verification failed" (768-bit key; unprotected) header.d=tromey.com header.i=@tromey.com header.a=rsa-sha256 header.s=default header.b=bukUimk6; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 3401B1E06B; Fri, 23 Oct 2026 15:16:27 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_INVALID,DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_BL_SPAMCOP_NET, RCVD_IN_DNSWL_MED,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED, RCVD_IN_VALIDITY_RPBL_BLOCKED,RCVD_IN_VALIDITY_SAFE_BLOCKED autolearn=no 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 7945B1E007 for ; Fri, 23 Oct 2026 15:16:25 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 3561F4BA23C9 for ; Fri, 23 Oct 2026 19:16:24 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3561F4BA23C9 Authentication-Results: sourceware.org; dkim=fail reason="signature verification failed" (768-bit key, unprotected) header.d=tromey.com header.i=@tromey.com header.a=rsa-sha256 header.s=default header.b=bukUimk6 Received: from omta040.useast.a.cloudfilter.net (omta040.useast.a.cloudfilter.net [44.202.169.39]) by sourceware.org (Postfix) with ESMTPS id 845A64BA2E06 for ; Fri, 23 Oct 2026 19:15:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 845A64BA2E06 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=tromey.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tromey.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 845A64BA2E06 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=44.202.169.39 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1792782951; cv=none; b=XZLiy1+WEIWi0IFbniqmO0vmcu+tpJtfyZ74mDIwHlZtSUEsg17njmxLPxtNtbJ4QZINueZrWxcErMbwt+xvI6hxcdidPchdRrnhV0Ti30KTFmUSSGsxSSJm5Ktp6xwkWR2De8NRtlDXd3xHpP2LeIYkOkNUbDrczXqBIhIhLAE= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1792782951; c=relaxed/simple; bh=1BGXfODAKQIBVQqTyvrVT4w2Wj3LyegIXw9KDVPDTgI=; h=DKIM-Signature:From:Subject:Date:Message-Id:MIME-Version:To; b=R8Gct0e9kJVcak+aAQHNyWlnM7lx26CLlhgiJNIXTUNE6gXio8PSqIpuby9nG8aNwItPPdVjt8Flxd2vzduHF/ez1Vnw00kg1uE02UZ9AsUBJ29sxw8mpanqy8y/qAj8jTbv8cVca0/53bUew4iToPc69xqde4XSvpUADOpGcbo= ARC-Authentication-Results: i=1; sourceware.org; dkim=policy (768-bit key, unprotected) header.d=tromey.com header.i=@tromey.com header.a=rsa-sha256 header.s=default header.b=bukUimk6 reason="signing key too small" DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 845A64BA2E06 Received: from eig-obgw-6005b.ext.cloudfilter.net ([10.0.30.162]) by cmsmtp with ESMTPS id KHgZxiur7MylkKKk3xiaru; Fri, 23 Oct 2026 19:15:51 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id KKk1xImXgnyjpKKk1xMaBO; Fri, 23 Oct 2026 19:15:50 +0000 X-Authority-Analysis: v=2.4 cv=GJsIEvNK c=1 sm=1 tr=0 ts=6adbb266 a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=IkcTkHD0fZMA:10 a=660iZSQnnn4A:10 a=ItBw4LHWJt0A:10 a=zstS-IiYAAAA:8 a=t2KFtr4Asw_XgV8nCOQA:9 a=QEXdDO2ut3YA:10 a=4G6NA9xxw8l3yy4pmD5M:22 a=DCx65vhANUyCzuf5D8fC:22 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Cc:To:Content-Transfer-Encoding:Content-Type:MIME-Version: Message-Id:Date:Subject:From:Sender:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Unsubscribe-Post:List-Subscribe:List-Post:List-Owner:List-Archive; bh=dSyS669YnTNRTusEhr7eIE9ryP2dB5hbACQVtoQDqgA=; b=bukUimk67vXpFUvVvg74jWbKN6 jhsKyIhxNgurDO6uwCD09TjaPF+wosMQNzU1JxHMOgshp0ZHdZ2AN+/uWJ4EnZPnNBOj6xViMw4D2 hWpbkup4UWFDGBwEwN+98oZmT; Received: from 97-122-110-129.hlrn.qwest.net ([97.122.110.129]:59452 helo=[192.168.0.17]) by box5379.bluehost.com with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.100.1) (envelope-from ) id 1xKKk1-00000000DHL-1aRM; Fri, 23 Oct 2026 13:15:49 -0600 From: Tom Tromey Subject: [PATCH 0/6] Remove some Python safety FIXME comments Date: Fri, 23 Oct 2026 13:15:45 -0600 Message-Id: <20261023-python-safety-fixmes-v1-0-055b9e1d237b@tromey.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-B4-Tracking: v=1; b=H4sIAGGy22oC/x3MywrCMBCF4Vcps3YwjVLFVxEXuUyaWTQpM0Esp e9udPlxOP8OSsKk8Bh2EHqzci0d42mAkF2ZCTl2gzV2Go294Lq1XAuqS9Q2TPxZSDGmEK/3OJq bn6BfV6G+/LPPV7d3SujFlZB/sSo8czkvThsJHMcXGmrvMYYAAAA= X-Change-ID: 20261023-python-safety-fixmes-dfcd48d107b6 To: gdb-patches@sourceware.org Cc: Tom Tromey X-Mailer: b4 0.14.3 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box5379.bluehost.com X-AntiAbuse: Original Domain - sourceware.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tromey.com X-BWhitelist: no X-Source-IP: 97.122.110.129 X-Source-L: No X-Exim-ID: 1xKKk1-00000000DHL-1aRM X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 97-122-110-129.hlrn.qwest.net ([192.168.0.17]) [97.122.110.129]:59452 X-Source-Auth: tom+tromey.com X-Email-Count: 1 X-Org: HG=bhshared;ORG=bluehost; X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfF6cLp0ny65u08glEqDkOOMzgdOPopxDIljMMo9n6yKXC0SuPv2r8g7Ufc/T05wd28LHOa8p7/N12MeBg94x3kEuUR7zOpl5V5l0Kb0ncoxEUYqOmZ2K aGsbxg0OfuqWuCIJO+1r7tT4FBT2CkbbnEQSnaA/ExK9jPvQcKspAbVy6wes4VTTDo5wE/x8yQTY7oyglOzEfvnPNPXb6AgZro4= 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 I realized somewhat belatedly that instead of adding FIXME comments for Python safety issues, I could write wrapper functions that enforce the safety approach; and then the goal would shift to eventually merging the wrappers with the function they wrap. This series does this. Tested on x86-64 Fedora 40. Signed-off-by: Tom Tromey --- Tom Tromey (6): Add safe_target_to_connection_object Add safety wrappers for from_{longest,ulongest} Add gdbpy_safe_invalid_object_repr Some symbol-related Python safety fixes Safe wrappers for some string conversions Some frame-related Python safety fixes gdb/python/py-arch.c | 18 ++--------- gdb/python/py-connection.c | 22 ++++++++------ gdb/python/py-frame.c | 71 +++++++++++++++----------------------------- gdb/python/py-inferior.c | 2 +- gdb/python/py-ref.h | 7 +++++ gdb/python/py-safety.h | 21 +++++++++++++ gdb/python/py-symbol.c | 64 +++++++++++---------------------------- gdb/python/py-tui.c | 7 +---- gdb/python/py-utils.c | 20 +++++++++++++ gdb/python/py-wrappers.h | 30 +++++++++++++++++++ gdb/python/python-internal.h | 21 +++++++++---- 11 files changed, 152 insertions(+), 131 deletions(-) --- base-commit: 31249660c695a9169ca97590a2c325585740c101 change-id: 20261023-python-safety-fixmes-dfcd48d107b6 Best regards, -- Tom Tromey