diff options
Diffstat (limited to 'gdb/gdbarch.h')
-rw-r--r-- | gdb/gdbarch.h | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/gdb/gdbarch.h b/gdb/gdbarch.h index 36ea4de..ece765b 100644 --- a/gdb/gdbarch.h +++ b/gdb/gdbarch.h @@ -1781,18 +1781,20 @@ struct gdbarch_list struct gdbarch_info { - /* Use default: NULL (ZERO). */ - const struct bfd_arch_info *bfd_arch_info; + gdbarch_info () + /* Ensure the union is zero-initialized. Relies on the fact that there's + no member larger than TDESC_DATA. */ + : tdesc_data () + {} - /* Use default: BFD_ENDIAN_UNKNOWN (NB: is not ZERO). */ - enum bfd_endian byte_order; + const struct bfd_arch_info *bfd_arch_info = nullptr; - enum bfd_endian byte_order_for_code; + enum bfd_endian byte_order = BFD_ENDIAN_UNKNOWN; - /* Use default: NULL (ZERO). */ - bfd *abfd; + enum bfd_endian byte_order_for_code = BFD_ENDIAN_UNKNOWN; + + bfd *abfd = nullptr; - /* Use default: NULL (ZERO). */ union { /* Architecture-specific target description data. Numerous targets @@ -1805,11 +1807,9 @@ struct gdbarch_info int *id; }; - /* Use default: GDB_OSABI_UNINITIALIZED (-1). */ - enum gdb_osabi osabi; + enum gdb_osabi osabi = GDB_OSABI_UNKNOWN; - /* Use default: NULL (ZERO). */ - const struct target_desc *target_desc; + const struct target_desc *target_desc = nullptr; }; typedef struct gdbarch *(gdbarch_init_ftype) (struct gdbarch_info info, struct gdbarch_list *arches); @@ -1883,8 +1883,8 @@ extern int gdbarch_update_p (struct gdbarch_info info); /* Helper function. Find an architecture matching info. - INFO should be initialized using gdbarch_info_init, relevant fields - set, and then finished using gdbarch_info_fill. + INFO should have relevant fields set, and then finished using + gdbarch_info_fill. Returns the corresponding architecture, or NULL if no matching architecture was found. */ |