diff options
author | Nathan Sidwell <nathan@codesourcery.com> | 2006-06-05 15:00:39 +0000 |
---|---|---|
committer | Nathan Sidwell <nathan@codesourcery.com> | 2006-06-05 15:00:39 +0000 |
commit | 2b521eaaa3fecf7ea8c1159941302b6052f9e154 (patch) | |
tree | ddf2a2bf536f843e78e632d8368b8595c786cb1b | |
parent | ab632323b39edf6b5ffa3a5e9341c85a71a51cf9 (diff) | |
download | fsf-binutils-gdb-2b521eaaa3fecf7ea8c1159941302b6052f9e154.zip fsf-binutils-gdb-2b521eaaa3fecf7ea8c1159941302b6052f9e154.tar.gz fsf-binutils-gdb-2b521eaaa3fecf7ea8c1159941302b6052f9e154.tar.bz2 |
* gdb/m68k-tdep.c (m68k_dwarf_reg_to_regnum): New.
(m68k_gdbarch_init): Set it for dwarf & dwarf2 reg number
conversion. Use M68K_NUM_REGS for number of regs.
-rw-r--r-- | ChangeLog.csl | 4 | ||||
-rw-r--r-- | gdb/m68k-tdep.c | 26 |
2 files changed, 29 insertions, 1 deletions
diff --git a/ChangeLog.csl b/ChangeLog.csl index 95f6f57..8855da1 100644 --- a/ChangeLog.csl +++ b/ChangeLog.csl @@ -1,5 +1,9 @@ 2006-06-05 Nathan Sidwell <nathan@codesourcery.com> + * gdb/m68k-tdep.c (m68k_dwarf_reg_to_regnum): New. + (m68k_gdbarch_init): Set it for dwarf & dwarf2 reg number + conversion. Use M68K_NUM_REGS for number of regs. + * gdb/configure.tgt (gdb_osabi): uclinux is like linux. * gdb/m68k-tdep.c (m68k_svr4_extract_return_value): Return value is never in %a0. diff --git a/gdb/m68k-tdep.c b/gdb/m68k-tdep.c index bfec932..4aeb70d 100644 --- a/gdb/m68k-tdep.c +++ b/gdb/m68k-tdep.c @@ -555,6 +555,28 @@ m68k_push_dummy_call (struct gdbarch *gdbarch, struct value *function, frame's CFA. */ return sp + 8; } + +/* Convert a dwarf or dwarf2 regnumber to a GDB regnum */ + +static int +m68k_dwarf_reg_to_regnum (int num) +{ + if (num < 8) + /* d0..7 */ + return (num - 0) + M68K_D0_REGNUM; + else if (num < 16) + /* a0..7 */ + return (num - 8) + M68K_A0_REGNUM; + else if (num < 24) + /* fp0..7 */ + return (num - 16) + M68K_FP0_REGNUM; + else if (num == 25) + /* pc */ + return M68K_PC_REGNUM; + else + return NUM_REGS + NUM_PSEUDO_REGS; +} + struct m68k_frame_cache { @@ -1240,10 +1262,12 @@ m68k_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_decr_pc_after_break (gdbarch, 2); set_gdbarch_frame_args_skip (gdbarch, 8); + set_gdbarch_dwarf_reg_to_regnum (gdbarch, m68k_dwarf_reg_to_regnum); + set_gdbarch_dwarf2_reg_to_regnum (gdbarch, m68k_dwarf_reg_to_regnum); set_gdbarch_register_type (gdbarch, m68k_register_type); set_gdbarch_register_name (gdbarch, m68k_register_name); - set_gdbarch_num_regs (gdbarch, 29); + set_gdbarch_num_regs (gdbarch, M68K_NUM_REGS); set_gdbarch_register_bytes_ok (gdbarch, m68k_register_bytes_ok); set_gdbarch_sp_regnum (gdbarch, M68K_SP_REGNUM); set_gdbarch_pc_regnum (gdbarch, M68K_PC_REGNUM); |