2009-11-10 Tristan Gingold <gingold@adacore.com>
authorTristan Gingold <gingold@adacore.com>
Tue, 10 Nov 2009 10:48:51 +0000 (10:48 +0000)
committerTristan Gingold <gingold@adacore.com>
Tue, 10 Nov 2009 10:48:51 +0000 (10:48 +0000)
* avr-tdep.c (avr_integer_to_address): New function.
(avr_gdbarch_init): Set integer_to_address.

gdb/ChangeLog
gdb/avr-tdep.c

index f51bbf90ba3e15788b1d8a60fd493c8fcc23ccb2..e04dcd5cb4dfbbbaefbacc05add337d4aa29ba99 100644 (file)
@@ -1,3 +1,8 @@
+2009-11-10  Tristan Gingold  <gingold@adacore.com>
+
+       * avr-tdep.c (avr_integer_to_address): New function.
+       (avr_gdbarch_init): Set integer_to_address.
+
 2009-11-10  Tristan Gingold  <gingold@adacore.com>
 
        * avr-tdep.c (avr_skip_prologue): First try to skip prologue
index 68244fc4845e1cd5cc5278e327c311b04c293335..6d6d4886a473051ff6fbafa2be31ee01afd9f298 100644 (file)
@@ -317,6 +317,15 @@ avr_pointer_to_address (struct gdbarch *gdbarch,
     return avr_make_saddr (addr);
 }
 
+static CORE_ADDR
+avr_integer_to_address (struct gdbarch *gdbarch,
+                       struct type *type, const gdb_byte *buf)
+{
+  ULONGEST addr = unpack_long (type, buf);
+
+  return avr_make_saddr (addr);
+}
+
 static CORE_ADDR
 avr_read_pc (struct regcache *regcache)
 {
@@ -1353,6 +1362,7 @@ avr_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
 
   set_gdbarch_address_to_pointer (gdbarch, avr_address_to_pointer);
   set_gdbarch_pointer_to_address (gdbarch, avr_pointer_to_address);
+  set_gdbarch_integer_to_address (gdbarch, avr_integer_to_address);
 
   set_gdbarch_skip_prologue (gdbarch, avr_skip_prologue);
   set_gdbarch_inner_than (gdbarch, core_addr_lessthan);