[0/4] Define gdb.Value(val, type) constructor

Message ID 20190218075816.6f67f3d9@f29-4.lan
Headers show
Series
  • Define gdb.Value(val, type) constructor
Related show

Message

Kevin Buettner Feb. 18, 2019, 2:58 p.m.
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().

Comments

Simon Marchi Feb. 19, 2019, 2:47 a.m. | #1
On 2019-02-18 09:58, Kevin Buettner wrote:
> 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().


Apart from the two small nits I sent, this LGTM.

Simon