diff options
author | Tom Tromey <tromey@adacore.com> | 2023-03-16 10:57:32 -0600 |
---|---|---|
committer | Tom Tromey <tromey@adacore.com> | 2023-05-23 10:09:28 -0600 |
commit | c97d123d6701fbf462e96db001cea07ed32e4efa (patch) | |
tree | 7442dc14459bc1e8874998d219dda702371f380e /gdb/python/python-internal.h | |
parent | e7a2797eb00dbbceb6796f1baa120055d174a229 (diff) | |
download | gdb-c97d123d6701fbf462e96db001cea07ed32e4efa.zip gdb-c97d123d6701fbf462e96db001cea07ed32e4efa.tar.gz gdb-c97d123d6701fbf462e96db001cea07ed32e4efa.tar.bz2 |
Implement gdb.execute_mi
This adds a new Python function, gdb.execute_mi, that can be used to
invoke an MI command but get the output as a Python object, rather
than a string. This is done by implementing a new ui_out subclass
that builds a Python object.
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=11688
Reviewed-By: Eli Zaretskii <eliz@gnu.org>
Diffstat (limited to 'gdb/python/python-internal.h')
-rw-r--r-- | gdb/python/python-internal.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/gdb/python/python-internal.h b/gdb/python/python-internal.h index 1142e0e..9321737 100644 --- a/gdb/python/python-internal.h +++ b/gdb/python/python-internal.h @@ -483,6 +483,9 @@ struct symtab_and_line *sal_object_to_symtab_and_line (PyObject *obj); frame_info_ptr frame_object_to_frame_info (PyObject *frame_obj); struct gdbarch *arch_object_to_gdbarch (PyObject *obj); +extern PyObject *gdbpy_execute_mi_command (PyObject *self, PyObject *args, + PyObject *kw); + /* Convert Python object OBJ to a program_space pointer. OBJ must be a gdb.Progspace reference. Return nullptr if the gdb.Progspace is not valid (see gdb.Progspace.is_valid), otherwise return the program_space |