This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[committed] avr: add integer_to_address method


Hi,

because AVR is a true harvard cpu, it is necessary to have an integer_to_address method so that dwarf is
correctly decoded as well as addresses of values.


Tristan.


2009-11-10 Tristan Gingold <gingold@adacore.com>


	* avr-tdep.c (avr_integer_to_address): New function.
	(avr_gdbarch_init): Set integer_to_address.

*** avr-tdep.c	10 Nov 2009 10:35:57 -0000	1.120
--- avr-tdep.c	10 Nov 2009 10:41:49 -0000
***************
*** 318,323 ****
--- 318,332 ----
  }

  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)
  {
    ULONGEST pc;
***************
*** 1353,1358 ****
--- 1362,1368 ----

    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);


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]