public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH v2 0/4] Define gdb.Value(val, type) constructor
@ 2019-02-19 21:34 Kevin Buettner
  2019-02-19 21:39 ` [PATCH v2 1/4] Define unique_ptr specialization for Py_buffer Kevin Buettner
                   ` (4 more replies)
  0 siblings, 5 replies; 10+ messages in thread
From: Kevin Buettner @ 2019-02-19 21:34 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey, Simon Marchi, Eli Zaretskii

This four part patch series defines a two argument constructor for
gdb.Value.

gdb.Value currently has a one argument constructor.  It takes a python
value, figures out some potentially suitable gdb type and then
constructs a gdb value of that type.

The two argument version that I'm introducing is useful for
constructing a gdb value of a specified type from a buffer of bytes. 
It takes the form gdb.Value (val, type).  VAL is a python buffer object,
i.e. an object from which bytes may be read using python's buffer
protocol.  TYPE is a gdb type perhaps obtained by calling
gdb.lookup_type().

Changes between the original series and this v2 series are as follows:

Patch #1: No changes.

Patch #2:

  Fix wording of comment noted by Simon.
  
  Change PyExc_RuntimeError to PyExc_TypeError for "type argument must
  be a gdb.Type" error.  I found this while adding the additional test
  that Simon suggested.

Patch #3:

  Add test which invokes gdb.Value where second argument is not
  a gdb.Type.  (Suggested by Simon.)

Patch #4:

  Add NEWS entry.  (Requested by Eli.)

  Made other python.texi changes requested by Eli.  

  Added missing "@end defun".

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2019-02-26 17:35 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-19 21:34 [PATCH v2 0/4] Define gdb.Value(val, type) constructor Kevin Buettner
2019-02-19 21:39 ` [PATCH v2 1/4] Define unique_ptr specialization for Py_buffer Kevin Buettner
2019-02-19 21:42 ` [PATCH v2 2/4] Define gdb.Value(bufobj, type) constructor Kevin Buettner
2019-02-20  3:43   ` Simon Marchi
2019-02-20 18:03     ` Tom Tromey
2019-02-26 17:34     ` Kevin Buettner
2019-02-19 21:43 ` [PATCH v2 3/4] Add tests for " Kevin Buettner
2019-02-19 21:46 ` [PATCH v2 4/4] Document two argument form of gdb.Value constructor Kevin Buettner
2019-02-20  3:35   ` Eli Zaretskii
2019-02-26 17:35 ` [PATCH v2 0/4] Define gdb.Value(val, type) constructor Kevin Buettner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).