From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id /u8oIPt982kbgwYAWB0awg (envelope-from ) for ; Thu, 30 Apr 2026 12:06:19 -0400 Authentication-Results: simark.ca; dkim=pass (2048-bit key; unprotected) header.d=gnu.org header.i=@gnu.org header.a=rsa-sha256 header.s=fencepost-gnu-org header.b=OjmP6qDK; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 698761E0BA; Thu, 30 Apr 2026 12:06:19 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H2,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 D14D01E067 for ; Thu, 30 Apr 2026 12:06:14 -0400 (EDT) Received: from vm01.sourceware.org (localhost [127.0.0.1]) by sourceware.org (Postfix) with ESMTP id 88925436F7DF for ; Thu, 30 Apr 2026 16:06:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 88925436F7DF Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=gnu.org header.i=@gnu.org header.a=rsa-sha256 header.s=fencepost-gnu-org header.b=OjmP6qDK Received: from eggs.gnu.org (eggs.gnu.org [IPv6:2001:470:142:3::10]) by sourceware.org (Postfix) with ESMTPS id 30171436A05D for ; Thu, 30 Apr 2026 16:05:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 30171436A05D Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gnu.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gnu.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 30171436A05D Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2001:470:142:3::10 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1777565150; cv=none; b=JJuAlwTRPN2+Jqvj12o+fYSeOC6aIpxQHyrliC1PQJXTluPjQx5PWkG2nGl7YnJ/wX2foBZdoUa0ccOI1Ypvh6k1x+f9npo4cYcq0FfmY4lo48KqI98IACDwZceXupvSm3ZKhb/N8dC7FSwO21PR2SFrKaLASV38Fx3WaJEYYgI= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1777565150; c=relaxed/simple; bh=9TEGGlk4SlLLd/7LeGaXOusk0ZLbnW0HzR4g8Oo22wA=; h=DKIM-Signature:Date:Message-Id:From:To:Subject; b=D4cosuIRSsjB7WT7I8J1TFZYOVed6uOa7npAFk6z9utM85lVsPkUw+yXF55OccNjJTC1yF0p98Mc8gRcRIW4H35WsSjD3McMmD78l71vD97U/txD54v+RtJ6tOXp54WieT8AU/UW3Doc8aa4VD/xZ0wJ45MpqGqGExycSo3WlAY= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 30171436A05D Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wITtd-00088f-LL; Thu, 30 Apr 2026 12:05:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=EMvjxNdYyrW2CbBWGz55xs2M3X+FwL4PUcGr7cBiBWE=; b=OjmP6qDKlZ5Z 3Esqisvs5vNKVvJrZxk3Of1kq5j/oRWv6RLbfCuyQfaS23HLBQ1A8DUVO3XzZMO5aUMMun1L3Zkru Yg6V5ZtgpaSGsWWJGWTnBHwT+3DECXOev6CMqgR05YNraeN1dCUjDuFLeX47TCWaTEbI1KK3DCs/v 6CBfZxMS3PMiOf9LAjSeSg/i1Y2hrS+mBsnvkegMMZjPTBbr8V4Y6kcWbpkFf6AYJKB9nQ3uU7aZz k38OuH72YGFIVSIm+ue/l1qk8x0Z/wmrSvTv/dphFX7VFJV9JgBNkyw/ARPOE1lmLuiFnf0tNRvU1 Sc4ezSw0sX6sMhpi03nkEw==; Date: Thu, 30 Apr 2026 19:05:46 +0300 Message-Id: <86ik98302t.fsf@gnu.org> From: Eli Zaretskii To: Craig Blackmore Cc: gdb-patches@sourceware.org, aburgess@redhat.com In-Reply-To: <20260430153155.979053-1-craig.blackmore@embecosm.com> (message from Craig Blackmore on Thu, 30 Apr 2026 16:31:55 +0100) Subject: Re: [PATCH v3] gdb: Add python support for demangling register unwind values References: <87wmamotqb.fsf@redhat.com> <20260430153155.979053-1-craig.blackmore@embecosm.com> 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 > From: Craig Blackmore > Cc: aburgess@redhat.com, > eliz@gnu.org, > Craig Blackmore > Date: Thu, 30 Apr 2026 16:31:55 +0100 > > gdb/NEWS | 20 +++ > gdb/doc/python.texi | 95 ++++++++++ > gdb/extension-priv.h | 8 + > gdb/extension.c | 35 ++++ > gdb/extension.h | 6 + > gdb/frame.c | 9 + > gdb/guile/guile.c | 2 + > gdb/python/lib/gdb/__init__.py | 21 +++ > gdb/python/lib/gdb/unwinder.py | 89 ++++++++- > gdb/python/py-registers.c | 2 +- > gdb/python/py-unwind.c | 169 ++++++++++++++++++ > gdb/python/py-value.c | 21 +++ > gdb/python/python-internal.h | 3 + > gdb/python/python.c | 4 +- > .../gdb.python/py-unwind-transformer-error.py | 33 ++++ > .../gdb.python/py-unwind-transformer.c | 80 +++++++++ > .../gdb.python/py-unwind-transformer.exp | 115 ++++++++++++ > .../gdb.python/py-unwind-transformer.py | 48 +++++ > gdb/testsuite/gdb.python/py-value.exp | 8 + > 19 files changed, 765 insertions(+), 3 deletions(-) > create mode 100644 gdb/testsuite/gdb.python/py-unwind-transformer-error.py > create mode 100644 gdb/testsuite/gdb.python/py-unwind-transformer.c > create mode 100644 gdb/testsuite/gdb.python/py-unwind-transformer.exp > create mode 100644 gdb/testsuite/gdb.python/py-unwind-transformer.py Thanks. > diff --git a/gdb/NEWS b/gdb/NEWS > index e233906153a..c1dc008280e 100644 > --- a/gdb/NEWS > +++ b/gdb/NEWS > @@ -457,6 +457,26 @@ info threads [-gid] [-stopped] [-running] [ID]... > unavailability like gdb.Value.is_optimized_out checks for > optimized out values. > > + ** New constants gdb.NOT_LVAL, gdb.LVAL_REGISTER and gdb.LVAL_MEMORY > + to represent the lval_type of a value. > + > + ** New read-only attribute gdb.Value.lval_type which indicates the > + lval_type of the value. Currently supports not_lval, lval_register > + and lval_memory. Any other type is mapped to not_lval. Additional > + types may be supported in future. > + > + ** Added gdb.unwinder.UnwindRegisterValueTransformer. This is the > + base class for transformers which provide methods for transforming > + unwind register values. Currently one such method, demangle, is > + supported, which is called after obtaining a register value from an > + unwinder and allows that value to be demangled before being used by > + GDB. > + > + ** New function gdb.unwinder.register_unwind_register_value_transformer > + that can register an instance of a sub-class of > + gdb.unwinder.UnwindRegisterValueTransformer as a transformer for > + unwind register values. > + > * Guile API This part is okay. > +@defvar Value.lval_type > +The lval_type of this @code{gdb.Value}. The value of this attribute can What is "lval_type"? If it's a known term in Python programming, please give it the @code markup. Alternatively, replace with just "type", a common word. > +Additional lval_types may be added in future. Same here. > +Currently, only one transformer can be registered at any one time and it > +is registered globally. Attempting to register more than one > +transformer or to a different locus will raise an exception. > +Registering more than one transformer or to different loci may be > +supported in future. I'd remove the last sentence, it isn't useful in the manual. Reviewed-By: Eli Zaretskii