aboutsummaryrefslogtreecommitdiff
path: root/gdb/avr-tdep.c
diff options
context:
space:
mode:
authorTristan Gingold <gingold@adacore.com>2009-11-10 09:49:52 +0000
committerTristan Gingold <gingold@adacore.com>2009-11-10 09:49:52 +0000
commit53f6a2c9fa05574449d01931ed87a7619810dced (patch)
tree946a7bc5cccfcaada73b3700a6fb48972a4f5492 /gdb/avr-tdep.c
parentdb81c99eac28a42792440750810d437faed20612 (diff)
downloadgdb-53f6a2c9fa05574449d01931ed87a7619810dced.zip
gdb-53f6a2c9fa05574449d01931ed87a7619810dced.tar.gz
gdb-53f6a2c9fa05574449d01931ed87a7619810dced.tar.bz2
2009-11-10 Tristan Gingold <gingold@adacore.com>
* avr-tdep.c (avr_dwarf_reg_to_regnum): New function. (avr_gdbarch_init): Call set_gdbarch_dwarf2_reg_to_regnum.
Diffstat (limited to 'gdb/avr-tdep.c')
-rw-r--r--gdb/avr-tdep.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/gdb/avr-tdep.c b/gdb/avr-tdep.c
index 6340c21..6d04e56 100644
--- a/gdb/avr-tdep.c
+++ b/gdb/avr-tdep.c
@@ -1263,6 +1263,21 @@ avr_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
return sp + call_length;
}
+/* Unfortunately dwarf2 register for SP is 32. */
+
+static int
+avr_dwarf_reg_to_regnum (struct gdbarch *gdbarch, int reg)
+{
+ if (reg >= 0 && reg < 32)
+ return reg;
+ if (reg == 32)
+ return AVR_SP_REGNUM;
+
+ warning (_("Unmapped DWARF Register #%d encountered."), reg);
+
+ return -1;
+}
+
/* Initialize the gdbarch structure for the AVR's. */
static struct gdbarch *
@@ -1335,6 +1350,8 @@ avr_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_push_dummy_call (gdbarch, avr_push_dummy_call);
+ set_gdbarch_dwarf2_reg_to_regnum (gdbarch, avr_dwarf_reg_to_regnum);
+
set_gdbarch_address_to_pointer (gdbarch, avr_address_to_pointer);
set_gdbarch_pointer_to_address (gdbarch, avr_pointer_to_address);