diff options
author | Andreas Schwab <schwab@linux-m68k.org> | 2007-06-30 17:15:15 +0000 |
---|---|---|
committer | Andreas Schwab <schwab@linux-m68k.org> | 2007-06-30 17:15:15 +0000 |
commit | 4713453b1e6866c908ee95678a44c371cc6cf208 (patch) | |
tree | c4def4a47d8e50af6ff47fd9254e7e0c725a9f98 /gdb/m68k-tdep.c | |
parent | 4ed7793328456e0503374bee02853a844ac07e9f (diff) | |
download | gdb-4713453b1e6866c908ee95678a44c371cc6cf208.zip gdb-4713453b1e6866c908ee95678a44c371cc6cf208.tar.gz gdb-4713453b1e6866c908ee95678a44c371cc6cf208.tar.bz2 |
* m68k-tdep.c (m68k_ps_type): New.
(m68k_init_types): New.
(m68k_register_type): Use m68k_ps_type for PS register.
(_initialize_m68k_tdep): Call m68k_init_types.
Diffstat (limited to 'gdb/m68k-tdep.c')
-rw-r--r-- | gdb/m68k-tdep.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/gdb/m68k-tdep.c b/gdb/m68k-tdep.c index 32aa8eb..f028472 100644 --- a/gdb/m68k-tdep.c +++ b/gdb/m68k-tdep.c @@ -69,6 +69,32 @@ m68k_local_breakpoint_from_pc (CORE_ADDR *pcptr, int *lenptr) *lenptr = sizeof (break_insn); return break_insn; } + + +/* Type for %ps. */ +struct type *m68k_ps_type; + +/* Construct types for ISA-specific registers. */ +static void +m68k_init_types (void) +{ + 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; +} /* Return the GDB type object for the "standard" data type of data in register N. This should be int for D0-D7, SR, FPCONTROL and @@ -112,6 +138,9 @@ m68k_register_type (struct gdbarch *gdbarch, int regnum) if (regnum >= M68K_A0_REGNUM && regnum <= M68K_A0_REGNUM + 7) return builtin_type_void_data_ptr; + if (regnum == M68K_PS_REGNUM) + return m68k_ps_type; + return builtin_type_int32; } @@ -1249,4 +1278,7 @@ 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 (); } |