[PATCH 2/4] Define gdb.Value(bufobj, type) constructor
Simon Marchi
simon.marchi@polymtl.ca
Tue Feb 19 02:41:00 GMT 2019
On 2019-02-18 10:06, Kevin Buettner wrote:
> +/* Convert a python object OBJ with type TYPE to a gdb value. The
> + python object in question must conform to the python buffer
> + protocol. On success, return the converted value, otherwise
> + nullptr. */
> +
> +static struct value *
> +convert_buffer_and_type_to_value (PyObject *obj, struct type *type)
> +{
> + Py_buffer_up buffer_up;
> + Py_buffer py_buf;
> +
> + if (PyObject_CheckBuffer (obj)
> + && PyObject_GetBuffer (obj, &py_buf, PyBUF_SIMPLE) == 0)
> + {
> + /* Got a buffer, py_buf, out of obj. Cause it to released
> + when it goes out of scope. */
Seems to be missing a "be" in "Cause it to be released".
Simon
More information about the Gdb-patches
mailing list