extern PyTypeObject breakpoint_location_object_type;
-struct gdbpy_breakpoint_location_object
+struct gdbpy_breakpoint_location_object : public PyObject
{
- PyObject_HEAD
-
/* An owning reference to the gdb breakpoint location object. */
bp_location *bp_loc;
/* A gdb command. For the time being only ordinary commands (not
set/show commands) are allowed. */
-struct cmdpy_object
+struct cmdpy_object : public PyObject
{
- PyObject_HEAD
-
/* The corresponding gdb command object, or NULL if the command is
no longer installed. */
struct cmd_list_element *command;
};
/* A color. */
-struct colorpy_object
+struct colorpy_object : public PyObject
{
- PyObject_HEAD
-
/* Underlying value. */
ui_file_style::color color;
};
/* The Python object that represents a connection. */
-struct connection_object
+struct connection_object : public PyObject
{
- PyObject_HEAD
-
/* The process target that represents this connection. When a
connection_object is created this field will always point at a valid
target. Later, if GDB stops using this target (the target is popped
/* A gdb.CorefileMapped object. */
-struct corefile_mapped_file_object
+struct corefile_mapped_file_object : public PyObject
{
- PyObject_HEAD
-
/* The name of a file that was mapped when the core file was created.
This is a 'str' object. */
PyObject *filename;
/* A gdb.CorefileMappedFileRegion object. */
-struct corefile_mapped_file_region_object
+struct corefile_mapped_file_region_object : public PyObject
{
- PyObject_HEAD
-
/* The start and end addresses for this mapping, these are addresses
within the inferior's address space. */
CORE_ADDR start;
/* Implement gdb.disassembler.DisassembleInfo type. An object of this type
represents a single disassembler request from GDB. */
-struct disasm_info_object
+struct disasm_info_object : public PyObject
{
- PyObject_HEAD
-
/* The architecture in which we are disassembling. */
struct gdbarch *gdbarch;
the disassembled instruction (in bytes), and the string representing the
disassembled instruction. */
-struct disasm_result_object
+struct disasm_result_object : public PyObject
{
- PyObject_HEAD
-
/* The length of the disassembled instruction in bytes. */
int length;
/* Stores a list of objects to be notified when the event for which this
registry tracks occurs. */
-struct eventregistry_object
+struct eventregistry_object : public PyObject
{
- PyObject_HEAD
-
PyObject *callbacks;
};
#include "symfile.h"
#include "objfiles.h"
-struct frame_object {
- PyObject_HEAD
+struct frame_object : public PyObject
+{
struct frame_id frame_id;
struct gdbarch *gdbarch;
#include "python-internal.h"
-struct membuf_object {
- PyObject_HEAD
-
+struct membuf_object : public PyObject
+{
/* Pointer to the raw data, and array of gdb_bytes. */
void *buffer;
/* Representation of a Python gdb.MICommand object. */
-struct micmdpy_object
+struct micmdpy_object : public PyObject
{
- PyObject_HEAD
-
/* The object representing this command in the MI command table. This
pointer can be nullptr if the command is not currently installed into
the MI command table (see gdb.MICommand.installed property). */
template<typename T>
struct gdbpy_ref_policy
{
+ static_assert(std::is_base_of<PyObject, T>::value,
+ "T must be a subclass of PyObject");
+
static void incref (T *ptr)
{
- Py_INCREF (ptr);
+ Py_INCREF (static_cast<PyObject *> (ptr));
}
static void decref (T *ptr)
{
- Py_DECREF (ptr);
+ Py_DECREF (static_cast<PyObject *> (ptr));
}
};
extern PyTypeObject register_descriptor_iterator_object_type;
/* A register descriptor. */
-struct register_descriptor_object {
- PyObject_HEAD
-
+struct register_descriptor_object : public PyObject
+{
/* The register this is a descriptor for. */
int regnum;
extern PyTypeObject reggroup_iterator_object_type;
/* A register group object. */
-struct reggroup_object {
- PyObject_HEAD
-
+struct reggroup_object : public PyObject
+{
/* The register group being described. */
const struct reggroup *reggroup;
};
/* A PyObject representing a TUI window. */
-struct gdbpy_tui_window
+struct gdbpy_tui_window: public PyObject
{
- PyObject_HEAD
-
/* The TUI window, or nullptr if the window has been deleted. */
tui_py_window *window;
extern bool gdbpy_breakpoint_init_breakpoint_type ();
-struct gdbpy_breakpoint_object
+struct gdbpy_breakpoint_object : public PyObject
{
- PyObject_HEAD
-
/* The breakpoint number according to gdb. */
int number;