This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH v2 4/4] Document two argument form of gdb.Value constructor
- From: Kevin Buettner <kevinb at redhat dot com>
- To: gdb-patches at sourceware dot org
- Date: Tue, 19 Feb 2019 14:45:53 -0700
- Subject: [PATCH v2 4/4] Document two argument form of gdb.Value constructor
- References: <20190219143356.1576e67f@f29-4.lan>
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 | 8 ++++++++
2 files changed, 11 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..7f6f52c4df 100644
--- a/gdb/doc/python.texi
+++ b/gdb/doc/python.texi
@@ -735,6 +735,14 @@ 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 @var{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}.
+@end defun
+
@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