aboutsummaryrefslogtreecommitdiff
path: root/gdb/python/py-instruction.h
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/python/py-instruction.h')
-rw-r--r--gdb/python/py-instruction.h13
1 files changed, 9 insertions, 4 deletions
diff --git a/gdb/python/py-instruction.h b/gdb/python/py-instruction.h
index 59f0893..1e60263 100644
--- a/gdb/python/py-instruction.h
+++ b/gdb/python/py-instruction.h
@@ -22,9 +22,14 @@
#include "python-internal.h"
-/* Python type object for the abstract gdb.Instruction class. This class
- contains getters for four elements: "pc" (int), "data" (buffer), "decode"
- (str) and "size" (int) that must be overridden by sub classes. */
-extern PyTypeObject py_insn_type;
+/* Return a pointer to the py_insn_type object (see py-instruction.c), but
+ ensure that PyType_Ready has been called for the type first. If the
+ PyType_Ready call is successful then subsequent calls to this function
+ will not call PyType_Ready, the type pointer will just be returned.
+
+ If the PyType_Ready call is not successful then nullptr is returned and
+ subsequent calls to this function will call PyType_Ready again. */
+
+extern PyTypeObject *py_insn_get_insn_type ();
#endif /* PYTHON_PY_INSTRUCTION_H */