binutils-gdb/gdb/python
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
..
lib/gdb
py-all-events.def
py-arch.c
py-auto-load.c
py-block.c
py-bpevent.c
py-breakpoint.c
py-cmd.c
py-continueevent.c Do not include py-ref.h in most files 2019-01-22 20:35:21 -07:00
py-event-types.def
py-event.c
py-event.h
py-events.h
py-evtregistry.c
py-evts.c Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
py-exitedevent.c Change inferior_to_inferior_object to return a gdbpy_ref 2019-01-02 16:28:33 -07:00
py-finishbreakpoint.c Do not include py-ref.h in most files 2019-01-22 20:35:21 -07:00
py-frame.c Do not include py-ref.h in most files 2019-01-22 20:35:21 -07:00
py-framefilter.c Do not include py-ref.h in most files 2019-01-22 20:35:21 -07:00
py-function.c
py-gdb-readline.c
py-inferior.c
py-infevents.c
py-infthread.c
py-instruction.c Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
py-instruction.h
py-lazy-string.c Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
py-linetable.c
py-newobjfileevent.c
py-objfile.c
py-param.c Do not include py-ref.h in most files 2019-01-22 20:35:21 -07:00
py-prettyprint.c
py-progspace.c
py-record-btrace.c Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
py-record-btrace.h
py-record-full.c Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
py-record-full.h
py-record.c
py-record.h Normalize include guards in gdb 2019-02-07 03:27:23 -07:00
py-ref.h
py-signalevent.c
py-stopevent.c
py-stopevent.h
py-symbol.c
py-symtab.c
py-threadevent.c
py-type.c
py-unwind.c Do not include py-ref.h in most files 2019-01-22 20:35:21 -07:00
py-utils.c
py-value.c Define gdb.Value(bufobj, type) constructor 2019-02-26 10:23:23 -07:00
py-varobj.c Do not include py-ref.h in most files 2019-01-22 20:35:21 -07:00
py-xmethods.c Do not include py-ref.h in most files 2019-01-22 20:35:21 -07:00
python-config.py
python-internal.h
python.c
python.h