i386_mxcsr_type members.
(i386_eflags_type): Make into function.
(i386_mxcsr_type): Likewise.
* i386-tdep.c (i386_eflags_type): Make into function.
(i386_mxcsr_type): Likewise.
(i386_register_type): Update uses.
(i386_init_types): Remove.
(_initialize_i386_tdep): Do not call it.
* amd64-tdep.c (amd64_register_type): Update uses.
* m68k-tdep.h (struct gdbarch_tdep): Add m68k_ps_type member.
* m68k-tdep.c (m68k_ps_type): Make into function.
(m68k_register_type): Update use.
(m68k_init_types): Remove.
(_initialize_m68k_tdep): Do not call it.
* sparc-tdep.h (struct gdbarch_tdep): Add sparc_psr_type,
sparc_fsr_type, sparc64_pstate_type, sparc64_fsr_type, and
sparc64_fprs_type members.
* sparc-tdep.c (sparc_psr_type): Make into function.
(sparc_fsr_type): Likewise.
(sparc32_register_type): Update uses.
(sparc_init_types): Remove.
(_initialize_sparc_tdep): Do not call it.
* sparc64-tdep.c (sparc64_pstate_type): Make into function.
(sparc64_fsr_type): Likewise.
(sparc64_fprs_type): Likewise.
(sparc64_register_type): Update uses.
(sparc64_init_types): Remove.
(_initialize_sparc64_tdep): Likewise.
+2009-07-02 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * i386-tdep.h (struct gdbarch_tdep): Add i386_eflags_type and
+ i386_mxcsr_type members.
+ (i386_eflags_type): Make into function.
+ (i386_mxcsr_type): Likewise.
+ * i386-tdep.c (i386_eflags_type): Make into function.
+ (i386_mxcsr_type): Likewise.
+ (i386_register_type): Update uses.
+ (i386_init_types): Remove.
+ (_initialize_i386_tdep): Do not call it.
+ * amd64-tdep.c (amd64_register_type): Update uses.
+
+ * m68k-tdep.h (struct gdbarch_tdep): Add m68k_ps_type member.
+ * m68k-tdep.c (m68k_ps_type): Make into function.
+ (m68k_register_type): Update use.
+ (m68k_init_types): Remove.
+ (_initialize_m68k_tdep): Do not call it.
+
+ * sparc-tdep.h (struct gdbarch_tdep): Add sparc_psr_type,
+ sparc_fsr_type, sparc64_pstate_type, sparc64_fsr_type, and
+ sparc64_fprs_type members.
+ * sparc-tdep.c (sparc_psr_type): Make into function.
+ (sparc_fsr_type): Likewise.
+ (sparc32_register_type): Update uses.
+ (sparc_init_types): Remove.
+ (_initialize_sparc_tdep): Do not call it.
+ * sparc64-tdep.c (sparc64_pstate_type): Make into function.
+ (sparc64_fsr_type): Likewise.
+ (sparc64_fprs_type): Likewise.
+ (sparc64_register_type): Update uses.
+ (sparc64_init_types): Remove.
+ (_initialize_sparc64_tdep): Likewise.
+
2009-07-02 Ulrich Weigand <uweigand@de.ibm.com>
* gdbtypes.h (builtin_type_ieee_single, builtin_type_ieee_double,
if (regnum == AMD64_RIP_REGNUM)
return builtin_type (gdbarch)->builtin_func_ptr;
if (regnum == AMD64_EFLAGS_REGNUM)
- return i386_eflags_type;
+ return i386_eflags_type (gdbarch);
if (regnum >= AMD64_CS_REGNUM && regnum <= AMD64_GS_REGNUM)
return builtin_type (gdbarch)->builtin_int32;
if (regnum >= AMD64_ST0_REGNUM && regnum <= AMD64_ST0_REGNUM + 7)
if (regnum >= AMD64_XMM0_REGNUM && regnum <= AMD64_XMM0_REGNUM + 15)
return i386_sse_type (gdbarch);
if (regnum == AMD64_MXCSR_REGNUM)
- return i386_mxcsr_type;
+ return i386_mxcsr_type (gdbarch);
internal_error (__FILE__, __LINE__, _("invalid regnum"));
}
}
\f
-/* Type for %eflags. */
-struct type *i386_eflags_type;
+/* Construct types for ISA-specific registers. */
+struct type *
+i386_eflags_type (struct gdbarch *gdbarch)
+{
+ struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
-/* Type for %mxcsr. */
-struct type *i386_mxcsr_type;
+ if (!tdep->i386_eflags_type)
+ {
+ struct type *type;
+
+ type = init_flags_type ("builtin_type_i386_eflags", 4);
+ append_flags_type_flag (type, 0, "CF");
+ append_flags_type_flag (type, 1, NULL);
+ append_flags_type_flag (type, 2, "PF");
+ append_flags_type_flag (type, 4, "AF");
+ append_flags_type_flag (type, 6, "ZF");
+ append_flags_type_flag (type, 7, "SF");
+ append_flags_type_flag (type, 8, "TF");
+ append_flags_type_flag (type, 9, "IF");
+ append_flags_type_flag (type, 10, "DF");
+ append_flags_type_flag (type, 11, "OF");
+ append_flags_type_flag (type, 14, "NT");
+ append_flags_type_flag (type, 16, "RF");
+ append_flags_type_flag (type, 17, "VM");
+ append_flags_type_flag (type, 18, "AC");
+ append_flags_type_flag (type, 19, "VIF");
+ append_flags_type_flag (type, 20, "VIP");
+ append_flags_type_flag (type, 21, "ID");
+
+ tdep->i386_eflags_type = type;
+ }
-/* Construct types for ISA-specific registers. */
-static void
-i386_init_types (void)
+ return tdep->i386_eflags_type;
+}
+
+struct type *
+i386_mxcsr_type (struct gdbarch *gdbarch)
{
- struct type *type;
-
- type = init_flags_type ("builtin_type_i386_eflags", 4);
- append_flags_type_flag (type, 0, "CF");
- append_flags_type_flag (type, 1, NULL);
- append_flags_type_flag (type, 2, "PF");
- append_flags_type_flag (type, 4, "AF");
- append_flags_type_flag (type, 6, "ZF");
- append_flags_type_flag (type, 7, "SF");
- append_flags_type_flag (type, 8, "TF");
- append_flags_type_flag (type, 9, "IF");
- append_flags_type_flag (type, 10, "DF");
- append_flags_type_flag (type, 11, "OF");
- append_flags_type_flag (type, 14, "NT");
- append_flags_type_flag (type, 16, "RF");
- append_flags_type_flag (type, 17, "VM");
- append_flags_type_flag (type, 18, "AC");
- append_flags_type_flag (type, 19, "VIF");
- append_flags_type_flag (type, 20, "VIP");
- append_flags_type_flag (type, 21, "ID");
- i386_eflags_type = type;
-
- type = init_flags_type ("builtin_type_i386_mxcsr", 4);
- append_flags_type_flag (type, 0, "IE");
- append_flags_type_flag (type, 1, "DE");
- append_flags_type_flag (type, 2, "ZE");
- append_flags_type_flag (type, 3, "OE");
- append_flags_type_flag (type, 4, "UE");
- append_flags_type_flag (type, 5, "PE");
- append_flags_type_flag (type, 6, "DAZ");
- append_flags_type_flag (type, 7, "IM");
- append_flags_type_flag (type, 8, "DM");
- append_flags_type_flag (type, 9, "ZM");
- append_flags_type_flag (type, 10, "OM");
- append_flags_type_flag (type, 11, "UM");
- append_flags_type_flag (type, 12, "PM");
- append_flags_type_flag (type, 15, "FZ");
- i386_mxcsr_type = type;
+ struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+
+ if (!tdep->i386_mxcsr_type)
+ {
+ struct type *type;
+
+ type = init_flags_type ("builtin_type_i386_mxcsr", 4);
+ append_flags_type_flag (type, 0, "IE");
+ append_flags_type_flag (type, 1, "DE");
+ append_flags_type_flag (type, 2, "ZE");
+ append_flags_type_flag (type, 3, "OE");
+ append_flags_type_flag (type, 4, "UE");
+ append_flags_type_flag (type, 5, "PE");
+ append_flags_type_flag (type, 6, "DAZ");
+ append_flags_type_flag (type, 7, "IM");
+ append_flags_type_flag (type, 8, "DM");
+ append_flags_type_flag (type, 9, "ZM");
+ append_flags_type_flag (type, 10, "OM");
+ append_flags_type_flag (type, 11, "UM");
+ append_flags_type_flag (type, 12, "PM");
+ append_flags_type_flag (type, 15, "FZ");
+
+ tdep->i386_mxcsr_type = type;
+ }
+
+ return tdep->i386_mxcsr_type;
}
struct type *
return builtin_type (gdbarch)->builtin_func_ptr;
if (regnum == I386_EFLAGS_REGNUM)
- return i386_eflags_type;
+ return i386_eflags_type (gdbarch);
if (regnum == I386_EBP_REGNUM || regnum == I386_ESP_REGNUM)
return builtin_type (gdbarch)->builtin_data_ptr;
return i386_sse_type (gdbarch);
if (regnum == I387_MXCSR_REGNUM (gdbarch_tdep (gdbarch)))
- return i386_mxcsr_type;
+ return i386_mxcsr_type (gdbarch);
return builtin_type (gdbarch)->builtin_int;
}
gdbarch_register_osabi (bfd_arch_i386, 0, GDB_OSABI_GO32,
i386_go32_init_abi);
- /* Initialize the i386-specific register groups & types. */
+ /* Initialize the i386-specific register groups. */
i386_init_reggroups ();
- i386_init_types();
}
int sc_sp_offset;
/* ISA-specific data types. */
+ struct type *i386_eflags_type;
+ struct type *i386_mxcsr_type;
struct type *i386_mmx_type;
struct type *i386_sse_type;
struct type *i387_ext_type;
#define I386_MAX_REGISTER_SIZE 16
/* Types for i386-specific registers. */
-extern struct type *i386_eflags_type;
-extern struct type *i386_mxcsr_type;
-
+extern struct type *i386_eflags_type (struct gdbarch *gdbarch);
+extern struct type *i386_mxcsr_type (struct gdbarch *gdbarch);
extern struct type *i386_mmx_type (struct gdbarch *gdbarch);
extern struct type *i386_sse_type (struct gdbarch *gdbarch);
extern struct type *i387_ext_type (struct gdbarch *gdbarch);
}
\f
-/* Type for %ps. */
-struct type *m68k_ps_type;
-
/* Construct types for ISA-specific registers. */
-static void
-m68k_init_types (void)
+static struct type *
+m68k_ps_type (struct gdbarch *gdbarch)
{
- struct type *type;
-
- type = init_flags_type ("builtin_type_m68k_ps", 4);
- append_flags_type_flag (type, 0, "C");
- append_flags_type_flag (type, 1, "V");
- append_flags_type_flag (type, 2, "Z");
- append_flags_type_flag (type, 3, "N");
- append_flags_type_flag (type, 4, "X");
- append_flags_type_flag (type, 8, "I0");
- append_flags_type_flag (type, 9, "I1");
- append_flags_type_flag (type, 10, "I2");
- append_flags_type_flag (type, 12, "M");
- append_flags_type_flag (type, 13, "S");
- append_flags_type_flag (type, 14, "T0");
- append_flags_type_flag (type, 15, "T1");
- m68k_ps_type = type;
+ struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+
+ if (!tdep->m68k_ps_type)
+ {
+ struct type *type;
+
+ type = init_flags_type ("builtin_type_m68k_ps", 4);
+ append_flags_type_flag (type, 0, "C");
+ append_flags_type_flag (type, 1, "V");
+ append_flags_type_flag (type, 2, "Z");
+ append_flags_type_flag (type, 3, "N");
+ append_flags_type_flag (type, 4, "X");
+ append_flags_type_flag (type, 8, "I0");
+ append_flags_type_flag (type, 9, "I1");
+ append_flags_type_flag (type, 10, "I2");
+ append_flags_type_flag (type, 12, "M");
+ append_flags_type_flag (type, 13, "S");
+ append_flags_type_flag (type, 14, "T0");
+ append_flags_type_flag (type, 15, "T1");
+
+ tdep->m68k_ps_type = type;
+ }
+
+ return tdep->m68k_ps_type;
}
static struct type *
return builtin_type (gdbarch)->builtin_data_ptr;
if (regnum == M68K_PS_REGNUM)
- return m68k_ps_type;
+ return m68k_ps_type (gdbarch);
return builtin_type (gdbarch)->builtin_int32;
}
_initialize_m68k_tdep (void)
{
gdbarch_register (bfd_arch_m68k, m68k_gdbarch_init, m68k_dump_tdep);
-
- /* Initialize the m68k-specific register types. */
- m68k_init_types ();
}
int fpregs_present;
/* ISA-specific data types. */
+ struct type *m68k_ps_type;
struct type *m68881_ext_type;
};
return NULL;
}
\f
+/* Construct types for ISA-specific registers. */
-/* Type for %psr. */
-struct type *sparc_psr_type;
+static struct type *
+sparc_psr_type (struct gdbarch *gdbarch)
+{
+ struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
-/* Type for %fsr. */
-struct type *sparc_fsr_type;
+ if (!tdep->sparc_psr_type)
+ {
+ struct type *type;
-/* Construct types for ISA-specific registers. */
+ type = init_flags_type ("builtin_type_sparc_psr", 4);
+ append_flags_type_flag (type, 5, "ET");
+ append_flags_type_flag (type, 6, "PS");
+ append_flags_type_flag (type, 7, "S");
+ append_flags_type_flag (type, 12, "EF");
+ append_flags_type_flag (type, 13, "EC");
-static void
-sparc_init_types (void)
+ tdep->sparc_psr_type = type;
+ }
+
+ return tdep->sparc_psr_type;
+}
+
+static struct type *
+sparc_fsr_type (struct gdbarch *gdbarch)
{
- struct type *type;
-
- type = init_flags_type ("builtin_type_sparc_psr", 4);
- append_flags_type_flag (type, 5, "ET");
- append_flags_type_flag (type, 6, "PS");
- append_flags_type_flag (type, 7, "S");
- append_flags_type_flag (type, 12, "EF");
- append_flags_type_flag (type, 13, "EC");
- sparc_psr_type = type;
-
- type = init_flags_type ("builtin_type_sparc_fsr", 4);
- append_flags_type_flag (type, 0, "NXA");
- append_flags_type_flag (type, 1, "DZA");
- append_flags_type_flag (type, 2, "UFA");
- append_flags_type_flag (type, 3, "OFA");
- append_flags_type_flag (type, 4, "NVA");
- append_flags_type_flag (type, 5, "NXC");
- append_flags_type_flag (type, 6, "DZC");
- append_flags_type_flag (type, 7, "UFC");
- append_flags_type_flag (type, 8, "OFC");
- append_flags_type_flag (type, 9, "NVC");
- append_flags_type_flag (type, 22, "NS");
- append_flags_type_flag (type, 23, "NXM");
- append_flags_type_flag (type, 24, "DZM");
- append_flags_type_flag (type, 25, "UFM");
- append_flags_type_flag (type, 26, "OFM");
- append_flags_type_flag (type, 27, "NVM");
- sparc_fsr_type = type;
+ struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+
+ if (!tdep->sparc_fsr_type)
+ {
+ struct type *type;
+
+ type = init_flags_type ("builtin_type_sparc_fsr", 4);
+ append_flags_type_flag (type, 0, "NXA");
+ append_flags_type_flag (type, 1, "DZA");
+ append_flags_type_flag (type, 2, "UFA");
+ append_flags_type_flag (type, 3, "OFA");
+ append_flags_type_flag (type, 4, "NVA");
+ append_flags_type_flag (type, 5, "NXC");
+ append_flags_type_flag (type, 6, "DZC");
+ append_flags_type_flag (type, 7, "UFC");
+ append_flags_type_flag (type, 8, "OFC");
+ append_flags_type_flag (type, 9, "NVC");
+ append_flags_type_flag (type, 22, "NS");
+ append_flags_type_flag (type, 23, "NXM");
+ append_flags_type_flag (type, 24, "DZM");
+ append_flags_type_flag (type, 25, "UFM");
+ append_flags_type_flag (type, 26, "OFM");
+ append_flags_type_flag (type, 27, "NVM");
+
+ tdep->sparc_fsr_type = type;
+ }
+
+ return tdep->sparc_fsr_type;
}
/* Return the GDB type object for the "standard" data type of data in
return builtin_type (gdbarch)->builtin_func_ptr;
if (regnum == SPARC32_PSR_REGNUM)
- return sparc_psr_type;
+ return sparc_psr_type (gdbarch);
if (regnum == SPARC32_FSR_REGNUM)
- return sparc_fsr_type;
+ return sparc_fsr_type (gdbarch);
return builtin_type (gdbarch)->builtin_int32;
}
_initialize_sparc_tdep (void)
{
register_gdbarch_init (bfd_arch_sparc, sparc32_gdbarch_init);
-
- /* Initialize the SPARC-specific register types. */
- sparc_init_types();
}
/* Alternative location for trap return. Used for single-stepping. */
CORE_ADDR (*step_trap) (struct frame_info *frame, unsigned long insn);
+
+ /* ISA-specific data types. */
+ struct type *sparc_psr_type;
+ struct type *sparc_fsr_type;
+ struct type *sparc64_pstate_type;
+ struct type *sparc64_fsr_type;
+ struct type *sparc64_fprs_type;
};
/* Register numbers of various important registers. */
}
\f
-/* Type for %pstate. */
-struct type *sparc64_pstate_type;
+/* Construct types for ISA-specific registers. */
-/* Type for %fsr. */
-struct type *sparc64_fsr_type;
+static struct type *
+sparc64_pstate_type (struct gdbarch *gdbarch)
+{
+ struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
-/* Type for %fprs. */
-struct type *sparc64_fprs_type;
+ if (!tdep->sparc64_pstate_type)
+ {
+ struct type *type;
+
+ type = init_flags_type ("builtin_type_sparc64_pstate", 8);
+ append_flags_type_flag (type, 0, "AG");
+ append_flags_type_flag (type, 1, "IE");
+ append_flags_type_flag (type, 2, "PRIV");
+ append_flags_type_flag (type, 3, "AM");
+ append_flags_type_flag (type, 4, "PEF");
+ append_flags_type_flag (type, 5, "RED");
+ append_flags_type_flag (type, 8, "TLE");
+ append_flags_type_flag (type, 9, "CLE");
+ append_flags_type_flag (type, 10, "PID0");
+ append_flags_type_flag (type, 11, "PID1");
+
+ tdep->sparc64_pstate_type = type;
+ }
-/* Construct types for ISA-specific registers. */
+ return tdep->sparc64_pstate_type;
+}
-static void
-sparc64_init_types (void)
+static struct type *
+sparc64_fsr_type (struct gdbarch *gdbarch)
+{
+ struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+
+ if (!tdep->sparc64_fsr_type)
+ {
+ struct type *type;
+
+ type = init_flags_type ("builtin_type_sparc64_fsr", 8);
+ append_flags_type_flag (type, 0, "NXA");
+ append_flags_type_flag (type, 1, "DZA");
+ append_flags_type_flag (type, 2, "UFA");
+ append_flags_type_flag (type, 3, "OFA");
+ append_flags_type_flag (type, 4, "NVA");
+ append_flags_type_flag (type, 5, "NXC");
+ append_flags_type_flag (type, 6, "DZC");
+ append_flags_type_flag (type, 7, "UFC");
+ append_flags_type_flag (type, 8, "OFC");
+ append_flags_type_flag (type, 9, "NVC");
+ append_flags_type_flag (type, 22, "NS");
+ append_flags_type_flag (type, 23, "NXM");
+ append_flags_type_flag (type, 24, "DZM");
+ append_flags_type_flag (type, 25, "UFM");
+ append_flags_type_flag (type, 26, "OFM");
+ append_flags_type_flag (type, 27, "NVM");
+
+ tdep->sparc64_fsr_type = type;
+ }
+
+ return tdep->sparc64_fsr_type;
+}
+
+static struct type *
+sparc64_fprs_type (struct gdbarch *gdbarch)
{
- struct type *type;
-
- type = init_flags_type ("builtin_type_sparc64_pstate", 8);
- append_flags_type_flag (type, 0, "AG");
- append_flags_type_flag (type, 1, "IE");
- append_flags_type_flag (type, 2, "PRIV");
- append_flags_type_flag (type, 3, "AM");
- append_flags_type_flag (type, 4, "PEF");
- append_flags_type_flag (type, 5, "RED");
- append_flags_type_flag (type, 8, "TLE");
- append_flags_type_flag (type, 9, "CLE");
- append_flags_type_flag (type, 10, "PID0");
- append_flags_type_flag (type, 11, "PID1");
- sparc64_pstate_type = type;
-
- type = init_flags_type ("builtin_type_sparc64_fsr", 8);
- append_flags_type_flag (type, 0, "NXA");
- append_flags_type_flag (type, 1, "DZA");
- append_flags_type_flag (type, 2, "UFA");
- append_flags_type_flag (type, 3, "OFA");
- append_flags_type_flag (type, 4, "NVA");
- append_flags_type_flag (type, 5, "NXC");
- append_flags_type_flag (type, 6, "DZC");
- append_flags_type_flag (type, 7, "UFC");
- append_flags_type_flag (type, 8, "OFC");
- append_flags_type_flag (type, 9, "NVC");
- append_flags_type_flag (type, 22, "NS");
- append_flags_type_flag (type, 23, "NXM");
- append_flags_type_flag (type, 24, "DZM");
- append_flags_type_flag (type, 25, "UFM");
- append_flags_type_flag (type, 26, "OFM");
- append_flags_type_flag (type, 27, "NVM");
- sparc64_fsr_type = type;
-
- type = init_flags_type ("builtin_type_sparc64_fprs", 8);
- append_flags_type_flag (type, 0, "DL");
- append_flags_type_flag (type, 1, "DU");
- append_flags_type_flag (type, 2, "FEF");
- sparc64_fprs_type = type;
+ struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+
+ if (!tdep->sparc64_fprs_type)
+ {
+ struct type *type;
+
+ type = init_flags_type ("builtin_type_sparc64_fprs", 8);
+ append_flags_type_flag (type, 0, "DL");
+ append_flags_type_flag (type, 1, "DU");
+ append_flags_type_flag (type, 2, "FEF");
+
+ tdep->sparc64_fprs_type = type;
+ }
+
+ return tdep->sparc64_fprs_type;
}
+
/* Register information. */
static const char *sparc64_register_names[] =
if (regnum == SPARC64_STATE_REGNUM)
return builtin_type (gdbarch)->builtin_int64;
if (regnum == SPARC64_FSR_REGNUM)
- return sparc64_fsr_type;
+ return sparc64_fsr_type (gdbarch);
if (regnum == SPARC64_FPRS_REGNUM)
- return sparc64_fprs_type;
+ return sparc64_fprs_type (gdbarch);
/* "Although Y is a 64-bit register, its high-order 32 bits are
reserved and always read as 0." */
if (regnum == SPARC64_Y_REGNUM)
if (regnum == SPARC64_CWP_REGNUM)
return builtin_type (gdbarch)->builtin_int64;
if (regnum == SPARC64_PSTATE_REGNUM)
- return sparc64_pstate_type;
+ return sparc64_pstate_type (gdbarch);
if (regnum == SPARC64_ASI_REGNUM)
return builtin_type (gdbarch)->builtin_int64;
if (regnum == SPARC64_CCR_REGNUM)
}
}
-
-/* Provide a prototype to silence -Wmissing-prototypes. */
-void _initialize_sparc64_tdep (void);
-
-void
-_initialize_sparc64_tdep (void)
-{
- /* Initialize the UltraSPARC-specific register types. */
- sparc64_init_types();
-}