From patchwork Mon Feb 18 17:25:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Buettner X-Patchwork-Id: 31503 Received: (qmail 26000 invoked by alias); 18 Feb 2019 17:25:18 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 25846 invoked by uid 89); 18 Feb 2019 17:25:16 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.4 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_STOCKGEN, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 18 Feb 2019 17:25:14 +0000 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B72EE59465; Mon, 18 Feb 2019 17:25:07 +0000 (UTC) Received: from f29-4.lan (ovpn-117-11.phx2.redhat.com [10.3.117.11]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 87BBB10027CE; Mon, 18 Feb 2019 17:25:07 +0000 (UTC) Date: Mon, 18 Feb 2019 10:25:07 -0700 From: Kevin Buettner To: gdb-patches@sourceware.org Cc: Eli Zaretskii Subject: Re: [PATCH 4/4] Document two argument form of gdb.Value constructor Message-ID: <20190218102507.5196a83f@f29-4.lan> In-Reply-To: <83tvh1jcr8.fsf@gnu.org> References: <20190218075816.6f67f3d9@f29-4.lan> <20190218080907.06fd65af@f29-4.lan> <83tvh1jcr8.fsf@gnu.org> MIME-Version: 1.0 X-IsSubscribed: yes On Mon, 18 Feb 2019 18:13:31 +0200 Eli Zaretskii wrote: > P.S. Does this warrant a NEWS entry? I didn't think so at first, but after reviewing NEWS, I see that similar sorts of things are mentioned there. Below is an updated patch incorporating both the NEWS entry and the other changes that you asked for. gdb/ChangeLog: * NEWS: Mention two argument form of gdb.Value constructor. gdb/doc/ChangeLog: * python.texi (Values From Inferior): Document second form of Value.__init__. --- gdb/NEWS | 3 +++ gdb/doc/python.texi | 7 +++++++ 2 files changed, 10 insertions(+) diff --git a/gdb/NEWS b/gdb/NEWS index eaef6aa384..9ad7ff4885 100644 --- a/gdb/NEWS +++ b/gdb/NEWS @@ -202,6 +202,9 @@ FreeBSD/riscv riscv*-*-freebsd* gdb.SYMBOL_TYPES_DOMAIN are now deprecated. These were never correct and did not work properly. + ** The gdb.Value type has a new constructor, which is used to construct a + gdb.Value from a Python buffer object and a gdb.Type. + * Configure changes --enable-ubsan diff --git a/gdb/doc/python.texi b/gdb/doc/python.texi index 2860361c33..8758b626c9 100644 --- a/gdb/doc/python.texi +++ b/gdb/doc/python.texi @@ -735,6 +735,13 @@ its result is used. @end table @end defun +@defun Value.__init__ (@var{val}, @r{[}, type @r{]}) +This second form of the @code{gdb.Value} constructor returns a +@code{gdb.Value} of type @{type} where the value contents are taken +from the Python buffer object specified by @var{val}. The number of +bytes in the Python buffer object must be greater than or equal to the +size of @var{type}. + @defun Value.cast (type) Return a new instance of @code{gdb.Value} that is the result of casting this instance to the type described by @var{type}, which must