From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id aXRzI4bkfGnAKR4AWB0awg (envelope-from ) for ; Fri, 30 Jan 2026 12:04:06 -0500 Authentication-Results: simark.ca; dkim=pass (2048-bit key; unprotected) header.d=starynkevitch.net header.i=@starynkevitch.net header.a=rsa-sha256 header.s=gm1 header.b=OSplU8Yu; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 8D98E1E08D; Fri, 30 Jan 2026 12:04:06 -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.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 AD1231E08D for ; Fri, 30 Jan 2026 12:04:05 -0500 (EST) Received: from vm01.sourceware.org (localhost [127.0.0.1]) by sourceware.org (Postfix) with ESMTP id 475AD4BB588B for ; Fri, 30 Jan 2026 17:04:05 +0000 (GMT) Received: from relay6-d.mail.gandi.net (relay6-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::226]) by sourceware.org (Postfix) with ESMTPS id CC8594BA2E2B for ; Fri, 30 Jan 2026 17:03:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org CC8594BA2E2B Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=starynkevitch.net Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=starynkevitch.net ARC-Filter: OpenARC Filter v1.0.0 sourceware.org CC8594BA2E2B Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2001:4b98:dc4:8::226 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1769792613; cv=none; b=iSWy/+VS+Y6qMdLhrWj7rH9znrQDniFWSV3eJmf5gCL8J+SM76RALHJ2nCA7Vgr8foAEM8rPf+iwUM6si724KWMntzMN6GS+FTbtyak6TT/Isb5zoALcVeX0ZfofrlatWoVlJtWoHniZt3+L/zr+mFXZYwPsr8Vm3GuDzU4uQt8= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1769792613; c=relaxed/simple; bh=yD7nYDdxSQpX0ZQ0EIkA1EDubs8iW0iwqBQgUHrjJy4=; h=DKIM-Signature:Message-ID:Subject:From:To:Date:MIME-Version; b=lziv1owHAwR9OR7+6DbqxNQd4IsefuS1yA7QelmEvG6Oa4kXTFJi0oUJnwl5A18x8jCjs1OXCYO5Qv/7SHQTMgaV3QJd1RWCSqbDX8pYqubs6cP+/ssEbgqa7vAJGJAt5pOUbsm4SaJeZ+8h+BnN8o0OC9gVbl4XLew7jyJsBAY= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CC8594BA2E2B Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=starynkevitch.net header.i=@starynkevitch.net header.a=rsa-sha256 header.s=gm1 header.b=OSplU8Yu Received: by mail.gandi.net (Postfix) with ESMTPSA id 38B6244372; Fri, 30 Jan 2026 17:03:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=starynkevitch.net; s=gm1; t=1769792607; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Mm9serwomkORb0FO4XJFtTx7HydaQkK3dtEY8+HixJI=; b=OSplU8Yuf9WQFQmGBv5R/o+YO3T8NqKOCDANehy6pIjYmT/j5dMw5I0Qg7Rbf44xaVzYCO sRDYAPaqdhmGydA7ZcLB5V3TkjdUEX4LhsG03332jeIgKcEzsSNj0QJ1sgBX4Z7xzmcnGc oAHRElKlCN5cyxL+LDMiJLZRT1SxET9F/Xbt55Rp+RXlnwaQww8IWWM6ILCB7rRWA+u7L4 qtvmKzOx6XFcKzTQKOsbykpLe2+GGffg75t4IRg6HXWBcLL9JdN2AaEvyoq2kQ9BpPy9CJ HFcLbiOApz4OXaG6iWLNXQel0yaR4hFzcL3pNXq5R1XfRklajL5J4QTpchXRnw== Message-ID: Subject: Re: GDB variants accepting plugins (to the debugger) ? From: Basile Starynkevitch To: Simon Marchi , Eli Zaretskii Cc: gdb@sourceware.org, team@refpersys.org Date: Fri, 30 Jan 2026 18:03:26 +0100 In-Reply-To: References: <06d90d0ef774cf4ffd69a675a9092afee18a3446.camel@starynkevitch.net> <86ikcj8bth.fsf@gnu.org> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.56.2-8 MIME-Version: 1.0 X-GND-Sasl: basile@starynkevitch.net X-GND-State: clean X-GND-Score: -100 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgdduieelheelucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuifetpfffkfdpucggtfgfnhhsuhgsshgtrhhisggvnecuuegrihhlohhuthemuceftddunecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefkuffhvfevffgjfhgtgfgfggesthhqredttderjeenucfhrhhomhepuegrshhilhgvucfuthgrrhihnhhkvghvihhttghhuceosggrshhilhgvsehsthgrrhihnhhkvghvihhttghhrdhnvghtqeenucggtffrrghtthgvrhhnpeevgedtjeeuvdetvddvjeejleehhfehtdeluddvkeetvdekgfevjeeghfdtvdetgeenucffohhmrghinhepghhnuhdrohhrghdpshhouhhrtggvfigrrhgvrdhorhhgpdhsthgrrhihnhhkvghvihhttghhrdhnvghtpdhgihhthhhusgdrtghomhdpohhrtghiugdrohhrghenucfkphepvdgrtddumegvtdgrmedvfhefmeehgegrtdemvdgukeemiedufhhfmehfvgefjeemrgegvdeinecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepvdgrtddumegvtdgrmedvfhefmeehgegrtdemvdgukeemiedufhhfmehfvgefjeemrgegvdeipdhhvghloheprhhimhhskhhirdhlvghsohhurhhspdhmrghilhhfrhhomhepsggrshhilhgvsehsthgrrhihnhhkvghvihhttghhrdhnvghtpdhqihgupeefkeeuiedvgeegfeejvddpmhhouggvpehsmhhtphhouhhtpdhnsggprhgtphhtt hhopeehpdhrtghpthhtohepshhimhgrrhhksehsihhmrghrkhdrtggrpdhrtghpthhtohepvghlihiisehgnhhurdhorhhgpdhrtghpthhtohepghgusgesshhouhhrtggvfigrrhgvrdhorhhgpdhrtghpthhtohepthgvrghmsehrvghfphgvrhhshihsrdhorhhgpdhrtghpthhtohepsggrshhilhgvshhtrghrhihnkhgvvhhithgthhesghhmrghilhdrtghomh 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" On Fri, 2026-01-30 at 10:35 -0500, Simon Marchi via Gdb wrote: >=20 >=20 > On 2026-01-30 08:33, Eli Zaretskii via Gdb wrote: > > > From: Basile Starynkevitch > > > Cc: team@refpersys.org > > > Date: Fri, 30 Jan 2026 14:13:51 +0100 > > >=20 > > > I am using GDB-17.1 on Linux/Debian/x86-64 to debug a C++ coded, GPL = licensed, inference engine > > >=20 > > >=20 > > > Is there any GDB variant accepting plugins to the debugger process > > > (these could be definitely useful to display C++ data in a nice way, = std::vector or std::map instances come to mind immediately). > > >=20 > > > I do know that GDB accept eg Guile or Python scripts. > > > But coding manually a Python or Guile function for every important C+= + classes of a software is very time consuming > >=20 > > Did you read the node "Auto-loading extensions" in the GDB manual? > > GDB installs such an auto-loaded extension for standard C++ classes, > > which actually uses printers.py provided by GCC/libstdc++ > > distribution.=C2=A0 But you can use the same mechanism to provide > > extensions for your classes, if needed. >=20 > Here's the file Eli is referring to, for libstdc++: >=20 > https://gcc.gnu.org/git/?p=3Dgcc.git;a=3Dblob;f=3Dlibstdc%2B%2B-v3/python= /libstdcxx/v6/printers.py;hb=3DHEAD >=20 > And here is the API it uses: >=20 > https://sourceware.org/gdb/current/onlinedocs/gdb.html/Pretty-Printing.ht= ml >=20 > Simon I am (perhaps incorrectly) understanding that I could inside the ELF execut= able embed some ELF section containing Python code for GDB. https://sourceware.org/gdb/current/onlinedocs/gdb.html/dotdebug_005fgdb_005= fscripts-section.html mention something. I don't understand if the script file name should be an = absolute path, or a relative one? If the Python script is a relative path, is it relative the working directo= ry of GDB or of the debugged process? Does anyone has some concrete toy -preferably opensource- example (for an o= pen source C++ program, on Linux, and how to link that program=C2=A0 to add the ELF sections containing Python code for the GDB debugger)? Thanks --=20 Basile STARYNKEVITCH basile AT starynkevitch DOT net 8 rue de la Fa=C3=AFencerie http://starynkevitch.net/= Basile/ =20 92340 Bourg-la-Reine https://github.com/bstarynk France https://github.com/RefPerSys/RefPerSy= s https://orcid.org/0000-0003-0908-5250