aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@codesourcery.com>2006-06-08 19:11:45 +0000
committerNathan Sidwell <nathan@codesourcery.com>2006-06-08 19:11:45 +0000
commit6dd0fba6719503d5e659547eaefeadb49b737ebd (patch)
tree41817221d9a1c966b4e09179b0ef2352efd18a1a /gdb
parentad9a8f3f0088e383aa284d3f654af2852ed59dac (diff)
downloadgdb-6dd0fba6719503d5e659547eaefeadb49b737ebd.zip
gdb-6dd0fba6719503d5e659547eaefeadb49b737ebd.tar.gz
gdb-6dd0fba6719503d5e659547eaefeadb49b737ebd.tar.bz2
* 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.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog4
-rw-r--r--gdb/m68k-tdep.c26
2 files changed, 29 insertions, 1 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 9a48694..ed7fb0e 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,9 @@
2006-06-08 Nathan Sidwell <nathan@codesourcery.com>
+ * 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.
+
* remote-fileio.c (remote_fileio_reset): New.
* remote-fileio.h (remote_fileio_reset): Prototype.
* remote.c (extended_remote_restart, remote_open_1): Call it.
diff --git a/gdb/m68k-tdep.c b/gdb/m68k-tdep.c
index 1761996..1ddd652 100644
--- a/gdb/m68k-tdep.c
+++ b/gdb/m68k-tdep.c
@@ -467,6 +467,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
{
@@ -1138,10 +1160,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);