From 4ea2465e326958603cb2e94329e2c3e7db6bddc0 Mon Sep 17 00:00:00 2001 From: "Theodore A. Roth" Date: Fri, 13 Jun 2003 17:52:28 +0000 Subject: [PATCH] * avr-tdep.c (avr_address_to_pointer): Shift code addrs right 1 bit. (avr_pointer_to_address): Shift code addrs left 1 bit. (avr_convert_from_func_ptr_addr): Delete function since operation is better handled by avr_address_to_pointer and avr_pointer_to_address. (avr_gdbarch_init): Don't set convert_from_func_ptr_add method. --- gdb/ChangeLog | 8 ++++++++ gdb/avr-tdep.c | 16 ++-------------- 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index d2aa809..bfe305b 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,11 @@ +2003-06-13 Theodore A. Roth + + * avr-tdep.c (avr_address_to_pointer): Shift code addrs right 1 bit. + (avr_pointer_to_address): Shift code addrs left 1 bit. + (avr_convert_from_func_ptr_addr): Delete function since operation is + better handled by avr_address_to_pointer and avr_pointer_to_address. + (avr_gdbarch_init): Don't set convert_from_func_ptr_add method. + 2003-06-13 Mark Kettenis From Kelley Cook : diff --git a/gdb/avr-tdep.c b/gdb/avr-tdep.c index b6967c8..df1ffdd 100644 --- a/gdb/avr-tdep.c +++ b/gdb/avr-tdep.c @@ -311,7 +311,7 @@ avr_address_to_pointer (struct type *type, void *buf, CORE_ADDR addr) || TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_METHOD) { store_unsigned_integer (buf, TYPE_LENGTH (type), - avr_convert_iaddr_to_raw (addr)); + avr_convert_iaddr_to_raw (addr >> 1)); } else { @@ -338,7 +338,7 @@ avr_pointer_to_address (struct type *type, const void *buf) if (TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_FUNC || TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_METHOD || TYPE_CODE_SPACE (TYPE_TARGET_TYPE (type))) - return avr_make_iaddr (addr); + return avr_make_iaddr (addr << 1); else return avr_make_saddr (addr); } @@ -411,15 +411,6 @@ avr_remote_translate_xfer_address (struct gdbarch *gdbarch, *targ_len = nr_bytes; } -/* Function pointers obtained from the target are half of what gdb expects so - multiply by 2. */ - -static CORE_ADDR -avr_convert_from_func_ptr_addr (CORE_ADDR addr) -{ - return addr * 2; -} - /* avr_scan_prologue is also used as the deprecated_frame_init_saved_regs(). @@ -1214,9 +1205,6 @@ avr_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_frame_locals_address (gdbarch, avr_frame_address); set_gdbarch_deprecated_saved_pc_after_call (gdbarch, avr_saved_pc_after_call); - set_gdbarch_convert_from_func_ptr_addr (gdbarch, - avr_convert_from_func_ptr_addr); - return gdbarch; } -- 2.7.4