summaryrefslogtreecommitdiff
path: root/gdb/avr-tdep.c
diff options
context:
space:
mode:
authorUlrich Weigand <uweigand@de.ibm.com>2007-05-14 15:17:00 +0000
committerUlrich Weigand <uweigand@de.ibm.com>2007-05-14 15:17:00 +0000
commit4bc36e1dd42c0dfd500b85c81afd28de08c72409 (patch)
tree5edddbb3da2f18c41737256f790c3eb7ef3ec679 /gdb/avr-tdep.c
parent60787702b6ed7e5290e316688e4798355603b9c0 (diff)
downloadgdb-4bc36e1dd42c0dfd500b85c81afd28de08c72409.tar.gz
* gdbarch.sh (read_sp): Remove.
* gdbarch.c, gdbarch.h: Regenerate. * frame.c (frame_sp_unwind): Do not call TARGET_READ_SP. * avr-tdep.c (avr_read_sp): Remove. (avr_unwind_sp): New function. (avr_gdbarch_init): Install unwind_sp instead of read_sp callback. * mips-tdep.c (mips_read_sp): Remove. (mips_unwind_sp): New function. (mips_gdbarch_init): Install unwind_sp instead of read_sp callback. * score-tdep.c (score_read_unsigned_register): Remove. (score_read_sp): Remove. (score_unwind_sp): New function. (score_gdbarch_init): Install unwind_sp instead of read_sp callback.
Diffstat (limited to 'gdb/avr-tdep.c')
-rw-r--r--gdb/avr-tdep.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/gdb/avr-tdep.c b/gdb/avr-tdep.c
index 9f0793e2fbc..d07245942e3 100644
--- a/gdb/avr-tdep.c
+++ b/gdb/avr-tdep.c
@@ -337,15 +337,6 @@ avr_write_pc (CORE_ADDR val, ptid_t ptid)
inferior_ptid = save_ptid;
}
-static CORE_ADDR
-avr_read_sp (void)
-{
- ULONGEST sp;
-
- regcache_cooked_read_unsigned (current_regcache, AVR_SP_REGNUM, &sp);
- return (avr_make_saddr (sp));
-}
-
static int
avr_scan_arg_moves (int vpc, unsigned char *prologue)
{
@@ -943,6 +934,16 @@ avr_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame)
return avr_make_iaddr (pc);
}
+static CORE_ADDR
+avr_unwind_sp (struct gdbarch *gdbarch, struct frame_info *next_frame)
+{
+ ULONGEST sp;
+
+ frame_unwind_unsigned_register (next_frame, AVR_SP_REGNUM, &sp);
+
+ return avr_make_saddr (sp);
+}
+
/* Given a GDB frame, determine the address of the calling function's
frame. This will be used to create a new GDB frame struct. */
@@ -1274,7 +1275,6 @@ avr_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_read_pc (gdbarch, avr_read_pc);
set_gdbarch_write_pc (gdbarch, avr_write_pc);
- set_gdbarch_read_sp (gdbarch, avr_read_sp);
set_gdbarch_num_regs (gdbarch, AVR_NUM_REGS);
@@ -1303,6 +1303,7 @@ avr_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_unwind_dummy_id (gdbarch, avr_unwind_dummy_id);
set_gdbarch_unwind_pc (gdbarch, avr_unwind_pc);
+ set_gdbarch_unwind_sp (gdbarch, avr_unwind_sp);
return gdbarch;
}