From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from eggs.gnu.org (eggs.gnu.org [IPv6:2001:470:142:3::10]) by sourceware.org (Postfix) with ESMTPS id D91473858C52 for ; Wed, 18 Oct 2023 15:40:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D91473858C52 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 D91473858C52 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=1697643623; cv=none; b=CMYnBlE6ZPnd3dvBTr247wDvwbMxxCsy1vJZrdOgkMOjVSoxgFOw4wTZzi1UHfMitom8mJ5s0T2fRklfuFL7zdI+pzeKAHg2I36tFSD+O6Cp6+arXMyHOvRjochbfzC9VG2WCMoe3wcytAG+OAcoOFKx3tgkl0zZXRJmnDP8E/I= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1697643623; c=relaxed/simple; bh=5iim9itWW2olT4i9UM+20VBVv13xnhyXATb+jHNru44=; h=DKIM-Signature:Date:Message-Id:From:To:Subject; b=UykP2GDtQxWp5h98ySnnQ61EqEFp8YpmvWm9tKb3ndjrZ7BK7ynZ9w9NDxPy3f//TU+qTtX+jeIFtqbuQS4i3uQvtOE7mn7t0JAzGK0kTqFYpmuuoRV46fyXR1IGzmGI5rb0lyVV0bwI5fNvoxKoaKqyUgiZ7VYRyUdA7eO20/w= ARC-Authentication-Results: i=1; server2.sourceware.org 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 1qt8ej-0004SY-8H; Wed, 18 Oct 2023 11:40:21 -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=YQUtvUHxoYrjc6FFR/jouNapEbKbSR0RHf/NLjX1m7A=; b=g9v16/YtQgts 4PKVu3cMcJ1VWbh0h17mS4r9KJaHj0patI1MhuMZcg8XgCo2awACXb1J4YpR7GY6IOGjeTfPMesML SB0XJDcJW1pLHxR2wvqzxiWXGrmLNV0sDLyQlmMnCa4OCA1GRIw1hWcU5qHV/vweEVIk5AresXro3 3o4HKMXbnAN3J7gYnZ8jywiPILVHaP1O/0PKP+QgPsBa9VhN5X17LGuofolu2Ieo1CtgqfkOQQMZL MDdT8VxqwqJPtDQaLxIqTvEv3tH/T9VhUKgQKo7/P6G5fS1Dm7HbnL8Hu6O5V6WoWIQ29byA/JQou 1/erlnHl0R4ukgVf+rKXNg==; Date: Wed, 18 Oct 2023 18:40:11 +0300 Message-Id: <834jiondlw.fsf@gnu.org> From: Eli Zaretskii To: Andrew Burgess Cc: gdb-patches@sourceware.org In-Reply-To: <9cefc82f3c5d6619bca1f04a783e48ea5639a841.1697641024.git.aburgess@redhat.com> (message from Andrew Burgess on Wed, 18 Oct 2023 15:57:15 +0100) Subject: Re: [PATCH] gdb/python: Add new gdb.Value.bytes attribute References: <9cefc82f3c5d6619bca1f04a783e48ea5639a841.1697641024.git.aburgess@redhat.com> X-Spam-Status: No, score=-5.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,SPF_HELO_PASS,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: > From: Andrew Burgess > Cc: Andrew Burgess > Date: Wed, 18 Oct 2023 15:57:15 +0100 > > gdb/NEWS | 3 ++ > gdb/doc/python.texi | 7 ++++ > gdb/python/py-value.c | 35 +++++++++++++++++ > gdb/testsuite/gdb.python/py-value.exp | 56 ++++++++++++++++++++++++++- > 4 files changed, 100 insertions(+), 1 deletion(-) > > diff --git a/gdb/NEWS b/gdb/NEWS > index 08d779010f0..d89df5dbb45 100644 > --- a/gdb/NEWS > +++ b/gdb/NEWS > @@ -11,6 +11,9 @@ > ** New function gdb.notify_mi(NAME, DATA), that emits custom > GDB/MI async notification. > > + ** New attribute gdb.Value.bytes that contains a bytes object > + holding the contents of this value. > + > *** Changes in GDB 14 > > * GDB now supports the AArch64 Scalable Matrix Extension 2 (SME2), which > diff --git a/gdb/doc/python.texi b/gdb/doc/python.texi > index 546b4d4b962..a2db6c1b863 100644 > --- a/gdb/doc/python.texi > +++ b/gdb/doc/python.texi > @@ -916,6 +916,13 @@ > method is invoked. > @end defvar > > +@defvar Value.bytes > +The value of this read-only attribute is a @code{bytes} object > +containing the bytes that make up this Value's value. If the complete ^^^^^ I think "Value" should be in @code. > +contents of this value are not available then accessing this attribute > +will raise an exception. > +@end defvar > + The documentation parts are okay, but I wonder: is it enough to say "the bytes that make up this Value"? Shouldn't we say something about endianness, for example? Or what are "the bytes" of a string with non-ASCII characters in it?