From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 0CXvGkqQx2oYHBYAWB0awg (envelope-from ) for ; Thu, 08 Oct 2026 08:44:58 -0400 Authentication-Results: simark.ca; dkim=pass (2048-bit key; unprotected) header.d=embecosm.com header.i=@embecosm.com header.a=rsa-sha256 header.s=google header.b=I3VX74Cy; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 547B11E04E; Thu, 08 Oct 2026 08:44:58 -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=unavailable 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 92E301E04E for ; Thu, 08 Oct 2026 08:44:57 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 437BA4BA2E22 for ; Thu, 8 Oct 2026 12:44:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 437BA4BA2E22 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=embecosm.com header.i=@embecosm.com header.a=rsa-sha256 header.s=google header.b=I3VX74Cy Received: from mail-ej1-x62b.google.com (mail-ej1-x62b.google.com [IPv6:2a00:1450:4864:20::62b]) by sourceware.org (Postfix) with ESMTPS id 298CA4BA23E9 for ; Thu, 8 Oct 2026 12:39:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 298CA4BA23E9 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=embecosm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=embecosm.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 298CA4BA23E9 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::62b ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1791463195; cv=none; b=MRDLmBOOj7aLQnRFwoiJ9kw5pnuZTOF5Wce4GaQx0uSVi810raEFg7nodNmWrsQpCny+1Fy71VKMtI+W8OWIlLYLpC8rRwPirdx11YsEbQawBikqrLEjojUVemYVPLv8Ee5sb+fidU3DEocVTe/tPB30cSkWkWiDxfpL6n3lkfg= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1791463195; c=relaxed/simple; bh=43yC7AvrDry593ykpVA0/gJUiEaGUs8AjdOsxvGH2JQ=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:From:To; b=GMgQi/lbErhJ++aDADMnmYyLI/JygHfRuxv7M6bvSSR/PVlF44ZwWvFviLU4rNePjkX0DLv/1aTpgSJLjte+bH1Luj35t5BY0eJcVcCQPm51On0oFu7wxmI1ZfVL+K4lN6nvf/8NYgRa3gM5i9pjySSlmACKCIX7kL/ez8KJsUM= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=embecosm.com header.i=@embecosm.com header.a=rsa-sha256 header.s=google header.b=I3VX74Cy DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 298CA4BA23E9 Received: by mail-ej1-x62b.google.com with SMTP id a640c23a62f3a-c31745ad205so111000966b.0 for ; Thu, 08 Oct 2026 05:39:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; t=1791463194; x=1792067994; darn=sourceware.org; h=content-transfer-encoding:content-type:in-reply-to:autocrypt :content-language:references:cc:to:from:subject:user-agent :mime-version:date:message-id:from:to:cc:subject:date:message-id :reply-to:content-type; bh=43yC7AvrDry593ykpVA0/gJUiEaGUs8AjdOsxvGH2JQ=; b=I3VX74CygIrCJWvtfV/YjuVf9UuY2t2Cvlvdzv7a651dU12btgyIS4603SV9qrWikn Q3OrsM7xyZMFq5WSMM1xVP+WtoO09yT5IYBmhe+w3MeIxd6VceMg+aMS6TrIQfyGne4x WXzmbrFZeGbJpMbZbPX3XU5r+dZhv8NMtWQ2t71LUbKElJQspdJKTC1TJJIFL7c5IhzE O5rpY0r0xD+y/m18x0r53CrRWULu946zHwbjpME38gDCnP5HpHO2CX/DwAqsIzhDQWmW YBh9uOaBbKWfXR4HKdct9/uPK/aGO3j8j+vGexTjSpUJ/H8zcQzJt6f8gzrqU0bNnWEx PwCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1791463194; x=1792067994; h=content-transfer-encoding:content-type:in-reply-to:autocrypt :content-language:references:cc:to:from:subject:user-agent :mime-version:date:message-id:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to:content-type; bh=43yC7AvrDry593ykpVA0/gJUiEaGUs8AjdOsxvGH2JQ=; b=UJrkuEIFFeREC4nG6JBzUEpoJfvhtgLB9cQqVhqBcS2peZGIh9PCe+9kAEtRLk9Acd t2phfaP03u5p1UoAscxAS5jdyQvUlI9zBgNqMyDEiT1WwAWa2M49TYgcrrsYy5X8WwRx WdZtBjrkEccS0OJS4fuCVM01I0Ya6tifYhMQotUA8iGlE21bln/tyGQ9erBTjaVdkxpp YJQwuEMDW+NB1P9cqaTpfBGGERAUEWnR+GtxkoBQwgdYj+7E5VGkDzaCUfxgP/7FGtkz Pww2+KKi7j/Faa6g72PRNfmp6wYNbHnMt/1yxkiBQzaplRc5xBUgc2GpnfREs7FgRGxB cbLA== X-Forwarded-Encrypted: i=1; AKwUvBxdc8K5jdEi+TTF+/Ss9ipkYjpRtcve+YXJMwRcJAbO7PY78YTczGcSlAFaykJvx20NS815qLkAJwd1Yg==@sourceware.org X-Gm-Message-State: AFuF++kdlsAlzVlsVx/dm7x8Mw2cPOPK2hLn2YRB7YpV8kJqxYcPDPvi jfqG4XsTO3xSuZee0VnXu++9cmf/XQF0z0jLuVhC7CNLPx+kYe1MUeP45u9cdOdCiqU= X-Gm-Gg: AYBFou0WML40jLqRmDgnmSWrQtir1z9Jz+I+OatgTs4b4uoMeNJj10dVqwt2JBgJAZP RLI7Jrnpn/YP4tJQNV4Go6W5D3muYAQCVAaKqMW74KGAIEjQFrneUKobWAEcgWvm2zKcpqGUHBf 7uEYknuVY3C1niKKuLiE8eQW1zB9rv9eE6JAyHht/tO8liLqfhEs1J6IFYlPg+cSLitMGWoMBe0 ysOVmAofRpv3OdHCPx2NUzPNcIjLXG9NDhSUUqP9p0a7Xz54i4UlYGBtKn/fW1WCGoYfuSmQfgq HbJXnly/sXnWpkwJ8OntBGfHJILvIjJRgVK31nosTD/mTznCq/ymYVAkv7P/gLEAiMaiVw2X8CO LPTph/AnsJZfTPI7hTNcsSsv+sndjHybm/wG2AOV279STeNlUYxT5qCPGlzT2rKtymrZ8xKdQAn HSHiStKENaGFOAlkV4afSuyGDq7sogdCJ5hUC2E/UEFHMzQ0VmlJgjbc2WLYP3TxWBRL8z96RzI +lvuwClWfz0 X-Received: by 2002:a17:907:3d0a:b0:c2e:3124:e9c6 with SMTP id a640c23a62f3a-c3191b5b5d9mr225037366b.15.1791463193971; Thu, 08 Oct 2026 05:39:53 -0700 (PDT) Received: from [192.168.0.192] ([212.69.42.53]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-c317c17a773sm219581166b.20.2026.10.08.05.39.53 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 08 Oct 2026 05:39:53 -0700 (PDT) Message-ID: Date: Thu, 8 Oct 2026 13:39:52 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v5 1/1] gdb: Add python support for transforming register unwind values From: Craig Blackmore To: Simon Marchi , gdb-patches@sourceware.org Cc: aburgess@redhat.com References: <20260520131607.32885-1-craig.blackmore@embecosm.com> <20260608120437.566738-1-craig.blackmore@embecosm.com> <20260608120437.566738-2-craig.blackmore@embecosm.com> <94197116-e5d5-4c96-9acc-76b72cf544c4@simark.ca> Content-Language: en-US Autocrypt: addr=craig.blackmore@embecosm.com; keydata= xsBNBFdIF8oBCACwrsvc6YVfzJRT+ZoBfL9jEb8ITwNahDxCGSG6sIWrJ9UFeTwE8fnNhMpz RyFRm0OXruS5k/8YHJHrxKxFY9cgZ3CWNftXEjRqURUWGtN/ESiw0J7nVfhSGQTo3LBzpXZ1 0JHk4ZHKDJKYa+fhybCHOs19BfP3HydHoTlc5QTKMfom0X/xo7WDdwUYeZsjD9u8IzHk7gNw 05Abk1vqni+J7Fghjp4RI8W3IsjpKOfV3f02OyO/MTSraXNyejO4JRl0A8b3q1Lq+G6Z7o5n LVief5JpkRyzWQSawTIBKmRZa9EzAKZXd6IJdY/sZt7pTir5EP7MHq4a+AtKfKuDkrDDABEB AAHNLkNyYWlnIEJsYWNrbW9yZSA8Y3JhaWcuYmxhY2ttb3JlQGVtYmVjb3NtLmNvbT7CwHgE EwECACIFAldIF8oCGwMGCwkIBwMCBhUIAgkKCwQWAgMBAh4BAheAAAoJEGEeRQLLl5WtydMH /1nYd9jmOBaF8w5gGgjF5eOO5b/cdUegmO///VYj/5R7iF/zbB6KgF0Obo5h2gG9AIfsZG+T ybuTx7oU1DZYEIndw+YP9c9Yi5de5UzEHwbJiV57W0n+MP0Widgw7p6XJmUQ1XbHxdcWp7nY EJa8ASKLuuIhO8JFUXbQ8BcUiWbsA/JxgCzeid8iixGrzPWj6iFzoK2mX4GqP+24pXSDUamM TXmSQd2taYEsyUdJNiEkUC51ncRcMuThjdtfn6Ok+7lHjh3Zz8q0keJz5pnIp4EXdkAgKSjq U42PMrd3v1HoIFINTtr5F23OdkxoQzysu4GMO4pkw5pwz95Uckr08ojOwE0EV0gXygEIAKv/ luYHmCG/qefgzdbnegwMdG5753NJ+zGxFltFX6aaOPZ8go9Omf6zwjybUKv6Qx6AlDanwCl3 ewVQs+h9iW8uaQBRgeDmwAGMG/doBiFqs7X0jBf23exMiJezXlKb2ZlKzMAbzJ87408AzRaV sZdwEpXHVi2mRPoXtMrqL5iQEyG5hdx2ySj5164DIgVOs/ypFiaiFaDPkIcAQTzJrxsbt6pf iI9kT93DO9nRKVV0pPWztV8P5gKM8HY2rS0wQcfrqAU6T89Aa0VFw92J+w5d2spF8MUNPsvR NLm9ooCF3YME9STYHXrNH1U9fJUWpIC+b49UoWSWRD9nwl2h2i8AEQEAAcLAXwQYAQIACQUC V0gXygIbDAAKCRBhHkUCy5eVreLbB/sHPs1xu78uNV8O4UPTX7D5zBBS3nsrbDr+8stmXRap xbvo6kqKzIMAXuO3bYB/NyJ/tFzuFr9Tjd/2g56D2186bp01/kgxJ9CEl/m2T3lG3DlxIoLg pCExzTLTb8zH/7/6mdeJ17cdnrK+2QAKYctReVPAC67cq5KmUyU3bv5e1JzhV4ezz/i/O+Jv el112ZEsa54ya9KZOUHbgAR6hLnRWIa+8yQTtXqYRc3LxLRfS80Wn0Err1YvqFYzJsQMC8ND xAeEuqQ1gfk1b0jmv7tYljNqsHqzGVbuWz6hyzyLv5GjcdSDKpbw/797gRKQSY8Gty5ynfUH O4kKyuZPrE8P In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit 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 On 21/08/2026 11:39, Craig Blackmore wrote: > > On 12/08/2026 15:43, Simon Marchi wrote: >> On 6/8/26 8:04 AM, Craig Blackmore wrote: >>> This patch addresses the scenario where a register value is saved in >>> some mangled form on the target and gdb does not have sufficient >>> information to demangle it. >>> >>> After getting a register value from an unwinder, gdb will call out to >>> extension languages to allow the value to be transformed. This avoids >>> having to write a new unwinder and allows the standard unwinders to be >>> used. >>> >>> This patch adds the python class >>> `gdb.unwinder.UnwindRegisterValueTransformer` which is the base class >>> for transformers which provide a `read` method for transforming unwind >>> register values that have been read.  There is no similar support for >>> transforming values being written back to the target as this was not >>> something I needed to be able to do.  Such support can be added to the >>> python API in future by supporting a `write` method. Currently writing >>> back to a transformed register will produce an "Attempt to assign to an >>> unmodifiable value" error. >>> >>> Only one transformer can be registered globally at any one time. >>> Attempting to register more than one transformer or to any other locus >>> produces an error.  The function for registering transformers takes a >>> locus to allow other loci to be supported in future. Registered >>> transformers are stored in a list so that registering multiple >>> transformers may be supported in future. >>> >>> `gdbpy_get_register_descriptor` is now externally visible as it is used >>> to create a gdb.RegisterDescriptor object to pass to the `read` method. >>> >>> This patch adds read-only attribute `gdb.Value.lval_type` which >>> transformer methods can use to decide to skip modifying values that did >>> not come directly from the target and may not need transforming, for >>> example, values taken directly from DWARF. >> I remember that when discussing DWARF locations on the stack things with >> Pedro (upcoming DWARF 6 features), and how GDB would implement them, the >> conclusion was that the lval_type enum was really conflating two things >> that should be orthogonal.  If I remember correctly, I think that it >> should be two axis: >> >>   - the location part: where are the bits located (register, memory, >>     nowhere) >>   - the lval-ness: is this a value that can be assigned >> >> The details are blurry because it's been a while, and unfortunately >> Pedro is OOO at the moment.  I'd like to have a chat with him about this >> once he's back, before we expose this concept to Python.  It might just >> be a matter of choosing a future-proof name for the new property.  From >> what I understand, what you care about in the >> UnwindRegisterValueTransformer implementation is the "location" aspect >> of it, so perhaps the property name could convey just that, and not the >> "lval" aspect. > Did the possible changes to lval_type get discussed? Thanks, Craig > Hi Simon, > > Yes, it is only the location aspect that this implementation cares about. > > Thanks, > > Craig > >> Simon