[4/4] Document two argument form of gdb.Value constructor

Message ID 20190218080907.06fd65af@f29-4.lan
State New
Headers show
Series
  • Define gdb.Value(val, type) constructor
Related show

Commit Message

Kevin Buettner Feb. 18, 2019, 3:09 p.m.
gdb/doc/ChangeLog:
    
            * python.texi (Values From Inferior): Document second form
            of Value.__init__.
---
 gdb/doc/python.texi | 7 +++++++
 1 file changed, 7 insertions(+)

Comments

Eli Zaretskii Feb. 18, 2019, 4:13 p.m. | #1
> Date: Mon, 18 Feb 2019 08:09:07 -0700

> From: Kevin Buettner <kevinb@redhat.com>

> 

> +@defun Value.__init__ (@var{val}, @r{[}, type @r{]})

> +This second form of the @code{gdb.Value} constructor returns a gdb

> +value of type @{type} where the value contents are taken from the


"gdb value" should be "@code{gdb.value}", right?

> +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}.


I think elsewhere we capitalize Python.

OK with those two fixed.

Thanks.

P.S. Does this warrant a NEWS entry?
Kevin Buettner Feb. 18, 2019, 5:25 p.m. | #2
On Mon, 18 Feb 2019 18:13:31 +0200
Eli Zaretskii <eliz@gnu.org> 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
Eli Zaretskii Feb. 18, 2019, 5:45 p.m. | #3
> Date: Mon, 18 Feb 2019 10:25:07 -0700

> From: Kevin Buettner <kevinb@redhat.com>

> Cc: Eli Zaretskii <eliz@gnu.org>

> 

> On Mon, 18 Feb 2019 18:13:31 +0200

> Eli Zaretskii <eliz@gnu.org> 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__.


Thanks, this is fine.

Patch

diff --git a/gdb/doc/python.texi b/gdb/doc/python.texi
index 2860361c33..f6df32e76d 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 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