From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id asXIE88QfWm5nh4AWB0awg (envelope-from ) for ; Fri, 30 Jan 2026 15:13:03 -0500 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=vB5TCcJ2; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 3F87B1E08D; Fri, 30 Jan 2026 15:13:03 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_INVALID,DKIM_SIGNED,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 4D2511E08D for ; Fri, 30 Jan 2026 15:13:02 -0500 (EST) Received: from vm01.sourceware.org (localhost [127.0.0.1]) by sourceware.org (Postfix) with ESMTP id 86C994BA2E2D for ; Fri, 30 Jan 2026 20:13:01 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 86C994BA2E2D 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=vB5TCcJ2 Received: from omta040.useast.a.cloudfilter.net (omta040.useast.a.cloudfilter.net [44.202.169.39]) by sourceware.org (Postfix) with ESMTPS id 27A284BA23EB for ; Fri, 30 Jan 2026 20:12:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 27A284BA23EB 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 27A284BA23EB Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=44.202.169.39 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1769803939; cv=none; b=A9zlQfzaEcede3o31dUD5d8bcM/qWfNF1RQf9zobgwLEDnVUtX0yR5g7S/xjjyIYvP+qF1hWSbh3PH2Yy/gEqkaKV0fi4t66BTGHRWcrCHGC9+hMmHJgJtrxcMJ7k4kvUkf7mN2QFX4/y/uooAk/AQNRHGwTAC5py/fXWyVCPkI= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1769803939; c=relaxed/simple; bh=Jfs2Cy77cHx+qec9i9b+nrtAytTVeKloK0zG7cgtMDA=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=FGSZXaDYZ7YRIhBB5pzTFgAHlNdQb31jKtfiD28Dfz9MdN4BnWJc9hGp+Ho8SULTwmMgTKtEuoT1CYbfYl7OcXVkqAM3IaKhRWgfbhXXqs8q+ja2Pk21CP1MGkhP+FzmOd/Vp3N+Ld4PpugP8jkbBmT7vFTFhYmY1rXtjEtPoIc= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from eig-obgw-6004b.ext.cloudfilter.net ([10.0.30.210]) by cmsmtp with ESMTPS id lnuBvq2UUCxrGluqivVyvB; Fri, 30 Jan 2026 20:12:13 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id luqhvNJhQK8vzluqivncJ9; Fri, 30 Jan 2026 20:12:12 +0000 X-Authority-Analysis: v=2.4 cv=cJDgskeN c=1 sm=1 tr=0 ts=697d109c a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=vUbySO9Y5rIA:10 a=ItBw4LHWJt0A:10 a=FP58Ms26AAAA:8 a=CCpqsmhAAAAA:8 a=fkFK9m-UAAAA:8 a=ksID5NiBgj_XjmpVKggA:9 a=ul9cdbp4aOFLsgKbc677:22 a=EFN4D7ja4MerFt0UNLhF:22 a=DCx65vhANUyCzuf5D8fC:22 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Type:MIME-Version:Message-ID:Date:References:In-Reply-To :Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=TZq68dOaGG50J/gL7YwoJqXvveqlyuj1wt0CKYFUpNI=; b=vB5TCcJ2lZAOco6e3SAo0r1IB4 0BxW8ZiYPBxa7PAp4/nuDqZIrQ3NzcYMLzBzo2S34lJklrCdJXvXXP+Hhto9SYR2Y7ka0i7lPOf75 6xb0UGjc7ypmp/qgwLAbhIEFN; Received: from 97-122-114-32.hlrn.qwest.net ([97.122.114.32]:48170 helo=bapiya) by box5379.bluehost.com with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1vluqh-00000003Ewg-2v8x; Fri, 30 Jan 2026 13:12:11 -0700 From: Tom Tromey To: Basile Starynkevitch Cc: gdb@sourceware.org, team@refpersys.org Subject: Re: GDB variants accepting plugins (to the debugger) ? In-Reply-To: <06d90d0ef774cf4ffd69a675a9092afee18a3446.camel@starynkevitch.net> (Basile Starynkevitch's message of "Fri, 30 Jan 2026 14:13:51 +0100") References: <06d90d0ef774cf4ffd69a675a9092afee18a3446.camel@starynkevitch.net> X-Attribution: Tom Date: Fri, 30 Jan 2026 13:12:10 -0700 Message-ID: <87ikci97xh.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain 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.114.32 X-Source-L: No X-Exim-ID: 1vluqh-00000003Ewg-2v8x X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 97-122-114-32.hlrn.qwest.net (bapiya) [97.122.114.32]:48170 X-Source-Auth: tom+tromey.com X-Email-Count: 2 X-Org: HG=bhshared;ORG=bluehost; X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfHPcRx/6uMsbzn66P0agtqukaZ4lpM4b8SVorOtyHGksiLUjPdkucr76sxhdeKONqIBf+H2tZ4mnMekr8X18NUqTOMfr0Xj8VfD7dWa38BGRC7IjzwAC 6my0lAv9YZQTspiTUVayTZGFlzLcaoJJ+Jaa2Cb7i2sPcZ2rj9W8ewRkMw+Xt1ZJUFUfucRqf6Ax9g== 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: , Errors-To: gdb-bounces~public-inbox=simark.ca@sourceware.org Sender: "Gdb" >>>>> "Basile" == Basile Starynkevitch writes: Basile> But coding manually a Python or Guile function for every Basile> important C++ classes of a software is very time consuming People often bring up the idea of using helper functions from the inferior for pretty-printing. And maybe it can be done, kind of. But normally I push back against this idea for a few reasons. Internally this means making an inferior call in gdb. But, gdb will use pretty-printers in all situations, including when unwinding the stack. This might work but its somewhat problematic to modify the stack while unwinding it. A related thing is that infcalls are sometimes very surprising. For instance unless you mess with scheduler-locking, they cause other threads to run. So, e.g., you could easily hit a breakpoint when printing a variable. Finally, this approach doesn't work at all for core files. A somewhat better idea is to have the compiler spit out some IR (wasm is often suggested) for these pretty-printers (and accessor functions and whatever else) and then have gdb run this. This would be great but nobody has ever done the work... I did once consider doing this with a gcc plugin and having it generate Python but time is kind of short. Basile> I regret that GDB 17.1 has not evolved into something similar to Basile> the old and unmaintained UPS open source debugger Basile> https://ups.sourceforge.net/ which sadly is not working on Basile> Linux/AMD-64 computers running a recent kernel 6.17 and and Basile> using recent libc and libstdc++ I don't have much to suggest other than you can already do a lot with Python in gdb. For instance I wrote a gdb GUI that runs in-process. Most of the gdb Python code you'll find in the wild will be pretty-printers; gdb has some of these for itself. libstdc++ has some xmethods and sometimes you'll stumble across a frame filter; and there's at least one unwinder out there. There's some links here https://sourceware.org/gdb/wiki/ExtensionsInPython Tom