2009-11-10 Tristan Gingold <gingold@adacore.com>
authorTristan Gingold <gingold@adacore.com>
Tue, 10 Nov 2009 09:49:52 +0000 (09:49 +0000)
committerTristan Gingold <gingold@adacore.com>
Tue, 10 Nov 2009 09:49:52 +0000 (09:49 +0000)
* avr-tdep.c (avr_dwarf_reg_to_regnum): New function.
(avr_gdbarch_init): Call set_gdbarch_dwarf2_reg_to_regnum.

gdb/ChangeLog
gdb/avr-tdep.c

index b7e7fc58ddc4c2a7c710dda73a69cff581b24ea8..f532d4bca8233ffab6a270ce7c58427eda53d778 100644 (file)
@@ -1,3 +1,8 @@
+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.
+
 2009-11-09  Sebastien Granjoux  <seb.sfo@free.fr>
 
        PR mi/9583:
        * target.c (dummy_find_memory_regions): Change output.
        (dummy_make_corefile_notes): Ditto.
 
+2009-10-26  Tristan Gingold  <gingold@adacore.com>
+       
+       * charset.c (_initialize_charset): Set a default value to
+       auto_host_charset_name if empty.
+
 2009-10-26  Tristan Gingold  <gingold@adacore.com>
 
        * avr-tdep.c (avr_push_dummy_call): Handle avr6 architecture.
index 6340c21783f9db06d90bd6311b3199e044dc5e2e..6d04e56684cb09fae2548806aa883568c010f1c3 100644 (file)
@@ -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);