diff options
Diffstat (limited to 'gdb/avr-tdep.c')
-rw-r--r-- | gdb/avr-tdep.c | 17 |
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); |