Files
Kevin Buettner fe07eca59d Define gdb.Value(bufobj, type) constructor
Provided a buffer BUFOBJ and a type TYPE, construct a gdb.Value object
with type TYPE, where the value's contents are taken from BUFOBJ.

E.g...

(gdb) python import struct
(gdb) python unsigned_int_type=gdb.lookup_type('unsigned int')
(gdb) python b=struct.pack('=I',0xdeadbeef)
(gdb) python v=gdb.Value(b, unsigned_int_type) ; print("%#x" % v)
0xdeadbeef

This two argument form of the gdb.Value constructor may also be used
to obtain gdb values from selected portions of buffers read with
Inferior.read_memory().  The test case (which is in a separate patch)
demonstrates this use case.

gdb/ChangeLog:

	* python/py-value.c (convert_buffer_and_type_to_value): New
	function.
	(valpy_new): Parse arguments via gdb_PyArg_ParseTupleAndKeywords.
	Add support for handling an optional second argument.  Call
	convert_buffer_and_type_to_value as appropriate.
2019-02-26 10:23:23 -07:00
..
2019-01-22 20:35:21 -07:00
2019-02-07 03:27:23 -07:00
2019-02-07 03:27:23 -07:00
2019-01-03 14:49:18 -07:00
2019-02-07 03:27:23 -07:00
2019-02-07 03:27:23 -07:00
2019-02-07 03:27:23 -07:00
2019-01-25 15:28:16 -07:00
2019-02-07 03:27:23 -07:00