aboutsummaryrefslogtreecommitdiff
path: root/gdb/m68k-tdep.c
diff options
context:
space:
mode:
authorUlrich Weigand <uweigand@de.ibm.com>2009-07-02 12:52:52 +0000
committerUlrich Weigand <uweigand@de.ibm.com>2009-07-02 12:52:52 +0000
commit209bd28e8ba1a8d4f3f5e90ea954437050870837 (patch)
treec698a17c33330d90bf8c511a622064e2ac6ccc82 /gdb/m68k-tdep.c
parent270677457f363b213b10923759f4f96ed1aa868b (diff)
downloadgdb-209bd28e8ba1a8d4f3f5e90ea954437050870837.zip
gdb-209bd28e8ba1a8d4f3f5e90ea954437050870837.tar.gz
gdb-209bd28e8ba1a8d4f3f5e90ea954437050870837.tar.bz2
* 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.
Diffstat (limited to 'gdb/m68k-tdep.c')
-rw-r--r--gdb/m68k-tdep.c52
1 files changed, 27 insertions, 25 deletions
diff --git a/gdb/m68k-tdep.c b/gdb/m68k-tdep.c
index dda67e3..0c551c6 100644
--- a/gdb/m68k-tdep.c
+++ b/gdb/m68k-tdep.c
@@ -71,29 +71,34 @@ m68k_local_breakpoint_from_pc (struct gdbarch *gdbarch,
}
-/* 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 *
@@ -152,7 +157,7 @@ m68k_register_type (struct gdbarch *gdbarch, int regnum)
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;
}
@@ -1257,7 +1262,4 @@ void
_initialize_m68k_tdep (void)
{
gdbarch_register (bfd_arch_m68k, m68k_gdbarch_init, m68k_dump_tdep);
-
- /* Initialize the m68k-specific register types. */
- m68k_init_types ();
}