diff options
author | Tom Tromey <tromey@adacore.com> | 2020-12-04 13:09:43 -0700 |
---|---|---|
committer | Tom Tromey <tromey@adacore.com> | 2020-12-04 13:12:56 -0700 |
commit | f99b517750fd5ab392056fcc8868fc15641ec502 (patch) | |
tree | 6d3420e2f259d3aae138b9e27d0e49a7b43ab68b /gdb/python | |
parent | e633b1172a5cf5d099644474e03f9228dc870b25 (diff) | |
download | gdb-f99b517750fd5ab392056fcc8868fc15641ec502.zip gdb-f99b517750fd5ab392056fcc8868fc15641ec502.tar.gz gdb-f99b517750fd5ab392056fcc8868fc15641ec502.tar.bz2 |
Remove redundant typedefs
I was inspired by this patch of Simon's:
https://sourceware.org/pipermail/gdb-patches/2020-November/173522.html
... to remove other typedefs that are no longer necessary now that gdb
uses C++.
I didn't remove absolutely every one -- I didn't touch the tdep files.
However, I removed many of them. In some cases, I removed an existing
different struct tag.
2020-12-04 Tom Tromey <tromey@adacore.com>
* linespec.c (struct linespec_token): Rename; remove typedef.
* guile/scm-block.c (struct block_smob): Remove typedef.
(struct block_syms_progress_smob): Likewise.
* guile/scm-symbol.c (struct symbol_smob): Remove typedef.
* guile/scm-symtab.c (symtab_smob): Remove typedef.
(struct sal_smob): Remove typedef.
* guile/scm-param.c (struct param_smob): Remove typedef.
* guile/scm-progspace.c (struct pspace_smob): Rename.
* guile/scm-objfile.c (struct objfile_smob): Rename.
* guile/scm-iterator.c (struct iterator_smob): Rename.
* guile/scm-frame.c (struct frame_smob): Rename.
* guile/scm-arch.c (struct arch_smob): Rename.
* guile/scm-type.c (struct field_smob): Remove typedef.
(struct type_smob): Rename.
* guile/scm-cmd.c (struct command_smob): Remove typedef.
* guile/scm-ports.c (struct ioscm_memory_port): Remove typedef.
* guile/scm-value.c (struct value_smob): Remove typedef.
* guile/scm-lazy-string.c (lazy_string_smob): Remove typedef.
* guile/guile-internal.h (struct scheme_variable)
(struct scheme_function, struct scheme_integer_constant)
(struct gdb_smob, struct chained_gdb_smob)
(struct eqable_gdb_smob, arch_smob, frame_smob, iterator_smob)
(objfile_smob, pspace_smob, type_smob): Remove typedef.
* guile/scm-pretty-print.c (pretty_printer_smob): Remove typedef.
(struct pretty_printer_worker_smob): Remove typedef.
* guile/scm-exception.c (struct exception_smob): Remove typedef.
* python/py-block.c (struct block_object): Remove typedef.
(block_syms_iterator_object): Update.
(set_block): Update.
(block_syms_iterator_object): Remove typedef.
* python/py-inferior.c (struct membuf_object): Remove typedef.
* python/py-symtab.c (struct symtab_object): Remove typedef.
(set_symtab): Update.
(sal_object): Remove typedef.
(set_sal): Update.
* python/py-frame.c (frame_object): Remove typedef.
* python/py-record-btrace.c (struct btpy_list_object): Remove
typedef.
* python/py-arch.c (struct arch_object): Remove typedef.
* python/py-linetable.c (struct linetable_entry_object)
(linetable_object, struct ltpy_iterator_object): Remove typedef.
* python/py-events.h (eventregistry_object): Remove typedef.
(struct events_object): Remove typedef.
* python/python-internal.h (gdbpy_breakpoint_object): Remove
typedef.
(thread_object): Remove typedef.
* python/py-progspace.c (pspace_object): Remove typedef.
* python/py-value.c (struct value_object): Remove typedef.
* python/py-record.h (recpy_record_object): Remove typedef.
(struct recpy_element_object): Remove typedef.
* python/py-lazy-string.c (lazy_string_object): Remove typedef.
* python/py-objfile.c (objfile_object): Remove typedef.
* python/py-cmd.c (struct cmdpy_object): Remove typedef.
* python/py-type.c (type_object): Remove typedef.
(typy_iterator_object): Update.
(set_type): Update.
(field_object): Remove typedef.
(typy_iterator_object): Remove typedef.
* python/py-registers.c (register_descriptor_iterator_object):
Remove typedef.
(struct register_descriptor_object)
(struct reggroup_iterator_object, struct reggroup_object): Remove
typedef.
* python/py-record.c (recpy_gap_object): Remove typedef.
* python/py-symbol.c (symbol_object): Remove typedef.
(set_symbol): Update.
* python/py-event.h (event_object): Remove typedef.
* python/py-param.c (parmpy_object): Remove typedef.
* python/py-instruction.c (struct py_insn_obj): Remove typedef.
* python/py-unwind.c (struct pending_frame_object): Remove typedef.
(unwind_info_object, struct cached_frame_info): Likewise.
Diffstat (limited to 'gdb/python')
-rw-r--r-- | gdb/python/py-arch.c | 4 | ||||
-rw-r--r-- | gdb/python/py-block.c | 16 | ||||
-rw-r--r-- | gdb/python/py-cmd.c | 2 | ||||
-rw-r--r-- | gdb/python/py-event.h | 4 | ||||
-rw-r--r-- | gdb/python/py-events.h | 8 | ||||
-rw-r--r-- | gdb/python/py-frame.c | 4 | ||||
-rw-r--r-- | gdb/python/py-inferior.c | 4 | ||||
-rw-r--r-- | gdb/python/py-instruction.c | 4 | ||||
-rw-r--r-- | gdb/python/py-lazy-string.c | 4 | ||||
-rw-r--r-- | gdb/python/py-linetable.c | 12 | ||||
-rw-r--r-- | gdb/python/py-objfile.c | 4 | ||||
-rw-r--r-- | gdb/python/py-param.c | 2 | ||||
-rw-r--r-- | gdb/python/py-progspace.c | 4 | ||||
-rw-r--r-- | gdb/python/py-record-btrace.c | 4 | ||||
-rw-r--r-- | gdb/python/py-record.c | 4 | ||||
-rw-r--r-- | gdb/python/py-record.h | 8 | ||||
-rw-r--r-- | gdb/python/py-registers.c | 16 | ||||
-rw-r--r-- | gdb/python/py-symbol.c | 10 | ||||
-rw-r--r-- | gdb/python/py-symtab.c | 22 | ||||
-rw-r--r-- | gdb/python/py-type.c | 20 | ||||
-rw-r--r-- | gdb/python/py-unwind.c | 12 | ||||
-rw-r--r-- | gdb/python/py-value.c | 4 | ||||
-rw-r--r-- | gdb/python/python-internal.h | 8 |
23 files changed, 88 insertions, 92 deletions
diff --git a/gdb/python/py-arch.c b/gdb/python/py-arch.c index ec955e7..ac64335 100644 --- a/gdb/python/py-arch.c +++ b/gdb/python/py-arch.c @@ -23,10 +23,10 @@ #include "disasm.h" #include "python-internal.h" -typedef struct arch_object_type_object { +struct arch_object { PyObject_HEAD struct gdbarch *gdbarch; -} arch_object; +}; static struct gdbarch_data *arch_object_data = NULL; diff --git a/gdb/python/py-block.c b/gdb/python/py-block.c index 26d59e1..aadc1e7 100644 --- a/gdb/python/py-block.c +++ b/gdb/python/py-block.c @@ -24,7 +24,7 @@ #include "python-internal.h" #include "objfiles.h" -typedef struct blpy_block_object { +struct block_object { PyObject_HEAD /* The GDB block structure that represents a frame's code block. */ const struct block *block; @@ -34,11 +34,11 @@ typedef struct blpy_block_object { struct objfile *objfile; /* Keep track of all blocks with a doubly-linked list. Needed for block invalidation if the source object file has been freed. */ - struct blpy_block_object *prev; - struct blpy_block_object *next; -} block_object; + block_object *prev; + block_object *next; +}; -typedef struct { +struct block_syms_iterator_object { PyObject_HEAD /* The block. */ const struct block *block; @@ -49,8 +49,8 @@ typedef struct { /* Pointer back to the original source block object. Needed to check if the block is still valid, and has not been invalidated when an object file has been freed. */ - struct blpy_block_object *source; -} block_syms_iterator_object; + block_object *source; +}; /* Require a valid block. All access to block_object->block should be gated by this call. */ @@ -293,7 +293,7 @@ set_block (block_object *obj, const struct block *block, if (objfile) { obj->objfile = objfile; - obj->next = ((struct blpy_block_object *) + obj->next = ((block_object *) objfile_data (objfile, blpy_objfile_data_key)); if (obj->next) obj->next->prev = obj; diff --git a/gdb/python/py-cmd.c b/gdb/python/py-cmd.c index 760208f..b3e8daf 100644 --- a/gdb/python/py-cmd.c +++ b/gdb/python/py-cmd.c @@ -66,8 +66,6 @@ struct cmdpy_object struct cmd_list_element *sub_list; }; -typedef struct cmdpy_object cmdpy_object; - extern PyTypeObject cmdpy_object_type CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF ("cmdpy_object"); diff --git a/gdb/python/py-event.h b/gdb/python/py-event.h index 92a71f6..5832a56 100644 --- a/gdb/python/py-event.h +++ b/gdb/python/py-event.h @@ -32,12 +32,12 @@ #include "py-event-types.def" #undef GDB_PY_DEFINE_EVENT_TYPE -typedef struct +struct event_object { PyObject_HEAD PyObject *dict; -} event_object; +}; extern int emit_continue_event (ptid_t ptid); extern int emit_exited_event (const LONGEST *exit_code, struct inferior *inf); diff --git a/gdb/python/py-events.h b/gdb/python/py-events.h index 5141676..1cd0d9b 100644 --- a/gdb/python/py-events.h +++ b/gdb/python/py-events.h @@ -27,17 +27,17 @@ /* Stores a list of objects to be notified when the event for which this registry tracks occurs. */ -typedef struct +struct eventregistry_object { PyObject_HEAD PyObject *callbacks; -} eventregistry_object; +}; /* Struct holding references to event registries both in python and c. This is meant to be a singleton. */ -typedef struct +struct events_object { #define GDB_PY_DEFINE_EVENT(name) \ eventregistry_object *name; @@ -46,7 +46,7 @@ typedef struct PyObject *module; -} events_object; +}; /* Python events singleton. */ extern events_object gdb_py_events; diff --git a/gdb/python/py-frame.c b/gdb/python/py-frame.c index 6f0bb8e..6b2b29d 100644 --- a/gdb/python/py-frame.c +++ b/gdb/python/py-frame.c @@ -28,7 +28,7 @@ #include "symfile.h" #include "objfiles.h" -typedef struct { +struct frame_object { PyObject_HEAD struct frame_id frame_id; struct gdbarch *gdbarch; @@ -42,7 +42,7 @@ typedef struct { ID as the previous frame). Whenever get_prev_frame returns NULL, we record the frame_id of the next frame and set FRAME_ID_IS_NEXT to 1. */ int frame_id_is_next; -} frame_object; +}; /* Require a valid frame. This must be called inside a TRY_CATCH, or another context in which a gdb exception is allowed. */ diff --git a/gdb/python/py-inferior.c b/gdb/python/py-inferior.c index 102a427..89a8221 100644 --- a/gdb/python/py-inferior.c +++ b/gdb/python/py-inferior.c @@ -61,14 +61,14 @@ extern PyTypeObject inferior_object_type static const struct inferior_data *infpy_inf_data_key; -typedef struct { +struct membuf_object { PyObject_HEAD void *buffer; /* These are kept just for mbpy_str. */ CORE_ADDR addr; CORE_ADDR length; -} membuf_object; +}; extern PyTypeObject membuf_object_type CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF ("membuf_object"); diff --git a/gdb/python/py-instruction.c b/gdb/python/py-instruction.c index fda44da..374fb90 100644 --- a/gdb/python/py-instruction.c +++ b/gdb/python/py-instruction.c @@ -28,9 +28,9 @@ PyTypeObject py_insn_type = { /* Python instruction object. */ -typedef struct { +struct py_insn_obj { PyObject_HEAD -} py_insn_obj; +}; /* Getter function for gdb.Instruction attributes. */ diff --git a/gdb/python/py-lazy-string.c b/gdb/python/py-lazy-string.c index aaee94f..070923c 100644 --- a/gdb/python/py-lazy-string.c +++ b/gdb/python/py-lazy-string.c @@ -24,7 +24,7 @@ #include "valprint.h" #include "language.h" -typedef struct { +struct lazy_string_object { PyObject_HEAD /* Holds the address of the lazy string. */ @@ -51,7 +51,7 @@ typedef struct { This is recorded as a PyObject so that we take advantage of support for preserving the type should its owning objfile go away. */ PyObject *type; -} lazy_string_object; +}; extern PyTypeObject lazy_string_object_type CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF ("lazy_string_object"); diff --git a/gdb/python/py-linetable.c b/gdb/python/py-linetable.c index 49e98c0..e384d95 100644 --- a/gdb/python/py-linetable.c +++ b/gdb/python/py-linetable.c @@ -20,29 +20,29 @@ #include "defs.h" #include "python-internal.h" -typedef struct { +struct linetable_entry_object { PyObject_HEAD /* The line table source line. */ int line; /* The pc associated with the source line. */ CORE_ADDR pc; -} linetable_entry_object; +}; extern PyTypeObject linetable_entry_object_type CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF ("linetable_entry_object"); -typedef struct { +struct linetable_object { PyObject_HEAD /* The symtab python object. We store the Python object here as the underlying symtab can become invalid, and we have to run validity checks on it. */ PyObject *symtab; -} linetable_object; +}; extern PyTypeObject linetable_object_type CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF ("linetable_object"); -typedef struct { +struct ltpy_iterator_object { PyObject_HEAD /* The current entry in the line table for the iterator */ int current_index; @@ -50,7 +50,7 @@ typedef struct { check if the line table is still valid, and has not been invalidated when an object file has been freed. */ PyObject *source; -} ltpy_iterator_object; +}; extern PyTypeObject ltpy_iterator_object_type CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF ("ltpy_iterator_object"); diff --git a/gdb/python/py-objfile.c b/gdb/python/py-objfile.c index a006eb3..e88c77e 100644 --- a/gdb/python/py-objfile.c +++ b/gdb/python/py-objfile.c @@ -25,7 +25,7 @@ #include "build-id.h" #include "symtab.h" -typedef struct +struct objfile_object { PyObject_HEAD @@ -50,7 +50,7 @@ typedef struct /* The debug method matcher list. */ PyObject *xmethods; -} objfile_object; +}; extern PyTypeObject objfile_object_type CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF ("objfile_object"); diff --git a/gdb/python/py-param.c b/gdb/python/py-param.c index fb39187..df45e56 100644 --- a/gdb/python/py-param.c +++ b/gdb/python/py-param.c @@ -91,8 +91,6 @@ struct parmpy_object const char **enumeration; }; -typedef struct parmpy_object parmpy_object; - extern PyTypeObject parmpy_object_type CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF ("parmpy_object"); diff --git a/gdb/python/py-progspace.c b/gdb/python/py-progspace.c index 34baa87..ac8f6d5 100644 --- a/gdb/python/py-progspace.c +++ b/gdb/python/py-progspace.c @@ -27,7 +27,7 @@ #include "solib.h" #include "block.h" -typedef struct +struct pspace_object { PyObject_HEAD @@ -52,7 +52,7 @@ typedef struct /* The debug method list. */ PyObject *xmethods; -} pspace_object; +}; extern PyTypeObject pspace_object_type CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF ("pspace_object"); diff --git a/gdb/python/py-record-btrace.c b/gdb/python/py-record-btrace.c index 15cd15b..93c3f7c 100644 --- a/gdb/python/py-record-btrace.c +++ b/gdb/python/py-record-btrace.c @@ -40,7 +40,7 @@ /* Python object for btrace record lists. */ -typedef struct { +struct btpy_list_object { PyObject_HEAD /* The thread this list belongs to. */ @@ -57,7 +57,7 @@ typedef struct { /* Either &BTPY_CALL_TYPE or &RECPY_INSN_TYPE. */ PyTypeObject* element_type; -} btpy_list_object; +}; /* Python type for btrace lists. */ diff --git a/gdb/python/py-record.c b/gdb/python/py-record.c index 3863408..3ea7833 100644 --- a/gdb/python/py-record.c +++ b/gdb/python/py-record.c @@ -50,7 +50,7 @@ PyTypeObject recpy_gap_type = { }; /* Python RecordGap object. */ -typedef struct +struct recpy_gap_object { PyObject_HEAD @@ -62,7 +62,7 @@ typedef struct /* Element number. */ Py_ssize_t number; -} recpy_gap_object; +}; /* Implementation of record.method. */ diff --git a/gdb/python/py-record.h b/gdb/python/py-record.h index 5d361fe..b771f32 100644 --- a/gdb/python/py-record.h +++ b/gdb/python/py-record.h @@ -25,7 +25,7 @@ #include "record.h" /* Python Record object. */ -typedef struct +struct recpy_record_object { PyObject_HEAD @@ -34,12 +34,12 @@ typedef struct /* The current recording method. */ enum record_method method; -} recpy_record_object; +}; /* Python recorded element object. This is generic enough to represent recorded instructions as well as recorded function call segments, hence the generic name. */ -typedef struct +struct recpy_element_object { PyObject_HEAD @@ -51,7 +51,7 @@ typedef struct /* Element number. */ Py_ssize_t number; -} recpy_element_object; +}; /* Python RecordInstruction type. */ extern PyTypeObject recpy_insn_type; diff --git a/gdb/python/py-registers.c b/gdb/python/py-registers.c index d7b876b..7e9dc1d 100644 --- a/gdb/python/py-registers.c +++ b/gdb/python/py-registers.c @@ -30,7 +30,7 @@ static struct gdbarch_data *gdbpy_register_object_data = NULL; /* Structure for iterator over register descriptors. */ -typedef struct { +struct register_descriptor_iterator_object { PyObject_HEAD /* The register group that the user is iterating over. This will never @@ -42,13 +42,13 @@ typedef struct { /* Pointer back to the architecture we're finding registers for. */ struct gdbarch *gdbarch; -} register_descriptor_iterator_object; +}; extern PyTypeObject register_descriptor_iterator_object_type CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF ("register_descriptor_iterator_object"); /* A register descriptor. */ -typedef struct { +struct register_descriptor_object { PyObject_HEAD /* The register this is a descriptor for. */ @@ -56,13 +56,13 @@ typedef struct { /* The architecture this is a register for. */ struct gdbarch *gdbarch; -} register_descriptor_object; +}; extern PyTypeObject register_descriptor_object_type CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF ("register_descriptor_object"); /* Structure for iterator over register groups. */ -typedef struct { +struct reggroup_iterator_object { PyObject_HEAD /* The last register group returned. Initially this will be NULL. */ @@ -70,18 +70,18 @@ typedef struct { /* Pointer back to the architecture we're finding registers for. */ struct gdbarch *gdbarch; -} reggroup_iterator_object; +}; extern PyTypeObject reggroup_iterator_object_type CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF ("reggroup_iterator_object"); /* A register group object. */ -typedef struct { +struct reggroup_object { PyObject_HEAD /* The register group being described. */ struct reggroup *reggroup; -} reggroup_object; +}; extern PyTypeObject reggroup_object_type CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF ("reggroup_object"); diff --git a/gdb/python/py-symbol.c b/gdb/python/py-symbol.c index 0adcb0b..edcb51f 100644 --- a/gdb/python/py-symbol.c +++ b/gdb/python/py-symbol.c @@ -25,7 +25,7 @@ #include "objfiles.h" #include "symfile.h" -typedef struct sympy_symbol_object { +struct symbol_object { PyObject_HEAD /* The GDB symbol structure this object is wrapping. */ struct symbol *symbol; @@ -33,9 +33,9 @@ typedef struct sympy_symbol_object { doubly-linked list, rooted in the objfile. This lets us invalidate the underlying struct symbol when the objfile is deleted. */ - struct sympy_symbol_object *prev; - struct sympy_symbol_object *next; -} symbol_object; + symbol_object *prev; + symbol_object *next; +}; /* Require a valid symbol. All access to symbol_object->symbol should be gated by this call. */ @@ -307,7 +307,7 @@ set_symbol (symbol_object *obj, struct symbol *symbol) { struct objfile *objfile = symbol_objfile (symbol); - obj->next = ((struct sympy_symbol_object *) + obj->next = ((symbol_object *) objfile_data (objfile, sympy_objfile_data_key)); if (obj->next) obj->next->prev = obj; diff --git a/gdb/python/py-symtab.c b/gdb/python/py-symtab.c index 579662f..33cb67c 100644 --- a/gdb/python/py-symtab.c +++ b/gdb/python/py-symtab.c @@ -25,7 +25,7 @@ #include "objfiles.h" #include "block.h" -typedef struct stpy_symtab_object { +struct symtab_object { PyObject_HEAD /* The GDB Symbol table structure. */ struct symtab *symtab; @@ -33,9 +33,9 @@ typedef struct stpy_symtab_object { a doubly-linked list, rooted in the objfile. This allows invalidation of the underlying struct symtab when the objfile is deleted. */ - struct stpy_symtab_object *prev; - struct stpy_symtab_object *next; -} symtab_object; + symtab_object *prev; + symtab_object *next; +}; extern PyTypeObject symtab_object_type CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF ("symtab_object"); @@ -54,7 +54,7 @@ static const struct objfile_data *stpy_objfile_data_key; } \ } while (0) -typedef struct salpy_sal_object { +struct sal_object { PyObject_HEAD /* The GDB Symbol table structure. */ PyObject *symtab; @@ -64,9 +64,9 @@ typedef struct salpy_sal_object { track with a doubly-linked list, rooted in the objfile. This allows invalidation of the underlying struct symtab_and_line when the objfile is deleted. */ - struct salpy_sal_object *prev; - struct salpy_sal_object *next; -} sal_object; + sal_object *prev; + sal_object *next; +}; extern PyTypeObject sal_object_type CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF ("sal_object"); @@ -378,8 +378,8 @@ set_sal (sal_object *sal_obj, struct symtab_and_line sal) symtab *symtab = symtab_object_to_symtab (sal_obj->symtab); sal_obj->next - = ((struct salpy_sal_object *) objfile_data (SYMTAB_OBJFILE (symtab), - salpy_objfile_data_key)); + = ((sal_object *) objfile_data (SYMTAB_OBJFILE (symtab), + salpy_objfile_data_key)); if (sal_obj->next) sal_obj->next->prev = sal_obj; @@ -405,7 +405,7 @@ set_symtab (symtab_object *obj, struct symtab *symtab) if (symtab) { obj->next - = ((struct stpy_symtab_object *) + = ((symtab_object *) objfile_data (SYMTAB_OBJFILE (symtab), stpy_objfile_data_key)); if (obj->next) obj->next->prev = obj; diff --git a/gdb/python/py-type.c b/gdb/python/py-type.c index 55d8264..1c7cacb 100644 --- a/gdb/python/py-type.c +++ b/gdb/python/py-type.c @@ -28,7 +28,7 @@ #include "language.h" #include "typeprint.h" -typedef struct pyty_type_object +struct type_object { PyObject_HEAD struct type *type; @@ -36,35 +36,35 @@ typedef struct pyty_type_object /* If a Type object is associated with an objfile, it is kept on a doubly-linked list, rooted in the objfile. This lets us copy the underlying struct type when the objfile is deleted. */ - struct pyty_type_object *prev; - struct pyty_type_object *next; -} type_object; + struct type_object *prev; + struct type_object *next; +}; extern PyTypeObject type_object_type CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF ("type_object"); /* A Field object. */ -typedef struct pyty_field_object +struct field_object { PyObject_HEAD /* Dictionary holding our attributes. */ PyObject *dict; -} field_object; +}; extern PyTypeObject field_object_type CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF ("field_object"); /* A type iterator object. */ -typedef struct { +struct typy_iterator_object { PyObject_HEAD /* The current field index. */ int field; /* What to return. */ enum gdbpy_iter_kind kind; /* Pointer back to the original source type object. */ - struct pyty_type_object *source; -} typy_iterator_object; + type_object *source; +}; extern PyTypeObject type_iterator_object_type CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF ("typy_iterator_object"); @@ -1101,7 +1101,7 @@ set_type (type_object *obj, struct type *type) { struct objfile *objfile = TYPE_OBJFILE (type); - obj->next = ((struct pyty_type_object *) + obj->next = ((type_object *) objfile_data (objfile, typy_objfile_data_key)); if (obj->next) obj->next->prev = obj; diff --git a/gdb/python/py-unwind.c b/gdb/python/py-unwind.c index 4571ef6..c01e6b1 100644 --- a/gdb/python/py-unwind.c +++ b/gdb/python/py-unwind.c @@ -31,7 +31,7 @@ #define TRACE_PY_UNWIND(level, args...) if (pyuw_debug >= level) \ { fprintf_unfiltered (gdb_stdlog, args); } -typedef struct +struct pending_frame_object { PyObject_HEAD @@ -40,7 +40,7 @@ typedef struct /* Its architecture, passed by the sniffer caller. */ struct gdbarch *gdbarch; -} pending_frame_object; +}; /* Saved registers array item. */ @@ -59,7 +59,7 @@ struct saved_reg /* The data we keep for the PyUnwindInfo: pending_frame, saved registers and frame ID. */ -typedef struct +struct unwind_info_object { PyObject_HEAD @@ -71,12 +71,12 @@ typedef struct /* Saved registers array. */ std::vector<saved_reg> *saved_regs; -} unwind_info_object; +}; /* The data we keep for a frame we can unwind: frame ID and an array of (register_number, register_value) pairs. */ -typedef struct +struct cached_frame_info { /* Frame ID. */ struct frame_id frame_id; @@ -88,7 +88,7 @@ typedef struct int reg_count; cached_reg_t reg[]; -} cached_frame_info; +}; extern PyTypeObject pending_frame_object_type CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF ("pending_frame_object"); diff --git a/gdb/python/py-value.c b/gdb/python/py-value.c index 4e8d93e..c1ff8e8 100644 --- a/gdb/python/py-value.c +++ b/gdb/python/py-value.c @@ -53,7 +53,7 @@ #define builtin_type_pychar \ language_string_char_type (python_language, python_gdbarch) -typedef struct value_object { +struct value_object { PyObject_HEAD struct value_object *next; struct value_object *prev; @@ -61,7 +61,7 @@ typedef struct value_object { PyObject *address; PyObject *type; PyObject *dynamic_type; -} value_object; +}; /* List of all values which are currently exposed to Python. It is maintained so that when an objfile is discarded, preserve_values diff --git a/gdb/python/python-internal.h b/gdb/python/python-internal.h index cc113cb..3fdfede 100644 --- a/gdb/python/python-internal.h +++ b/gdb/python/python-internal.h @@ -318,7 +318,7 @@ extern PyTypeObject frame_object_type extern PyTypeObject thread_object_type CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF ("thread_object"); -typedef struct gdbpy_breakpoint_object +struct gdbpy_breakpoint_object { PyObject_HEAD @@ -331,7 +331,7 @@ typedef struct gdbpy_breakpoint_object /* 1 is this is a FinishBreakpoint object, 0 otherwise. */ int is_finish_bp; -} gdbpy_breakpoint_object; +}; /* Require that BREAKPOINT be a valid breakpoint ID; throw a Python exception if it is invalid. */ @@ -361,7 +361,7 @@ typedef struct gdbpy_breakpoint_object extern gdbpy_breakpoint_object *bppy_pending_object; -typedef struct +struct thread_object { PyObject_HEAD @@ -370,7 +370,7 @@ typedef struct /* The Inferior object to which this thread belongs. */ PyObject *inf_obj; -} thread_object; +}; struct inferior_object; |