aboutsummaryrefslogtreecommitdiff
path: root/gdb/python/python-internal.h
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/python/python-internal.h')
-rw-r--r--gdb/python/python-internal.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/gdb/python/python-internal.h b/gdb/python/python-internal.h
index da2e791..5ff9989 100644
--- a/gdb/python/python-internal.h
+++ b/gdb/python/python-internal.h
@@ -540,6 +540,8 @@ int gdbpy_initialize_connection ()
int gdbpy_initialize_micommands (void)
CPYCHECKER_NEGATIVE_RESULT_SETS_EXCEPTION;
void gdbpy_finalize_micommands ();
+int gdbpy_initialize_disasm ()
+ CPYCHECKER_NEGATIVE_RESULT_SETS_EXCEPTION;
/* A wrapper for PyErr_Fetch that handles reference counting for the
caller. */
@@ -587,6 +589,13 @@ public:
return PyErr_GivenExceptionMatches (m_error_type.get (), type);
}
+ /* Return a new reference to the exception value object. */
+
+ gdbpy_ref<> value ()
+ {
+ return m_error_value;
+ }
+
private:
gdbpy_ref<> m_error_type, m_error_value, m_error_traceback;
@@ -840,4 +849,18 @@ extern bool gdbpy_is_progspace (PyObject *obj);
extern gdb::unique_xmalloc_ptr<char> gdbpy_fix_doc_string_indentation
(gdb::unique_xmalloc_ptr<char> doc);
+/* Implement the 'print_insn' hook for Python. Disassemble an instruction
+ whose address is ADDRESS for architecture GDBARCH. The bytes of the
+ instruction should be read with INFO->read_memory_func as the
+ instruction being disassembled might actually be in a buffer.
+
+ Used INFO->fprintf_func to print the results of the disassembly, and
+ return the length of the instruction in octets.
+
+ If no instruction can be disassembled then return an empty value. */
+
+extern gdb::optional<int> gdbpy_print_insn (struct gdbarch *gdbarch,
+ CORE_ADDR address,
+ disassemble_info *info);
+
#endif /* PYTHON_PYTHON_INTERNAL_H */