aboutsummaryrefslogtreecommitdiff
path: root/gdb/avr-tdep.c
diff options
context:
space:
mode:
authorTheodore A. Roth <troth@openavr.org>2003-06-20 16:55:51 +0000
committerTheodore A. Roth <troth@openavr.org>2003-06-20 16:55:51 +0000
commit8619218dfc6cef48ebba54c7e4ea05d02457dc81 (patch)
treed83c76c30720710f8c44de3a4e9547052150a55b /gdb/avr-tdep.c
parent73d37363f30bd902230cbb601d76aa8ec22f81ad (diff)
downloadgdb-8619218dfc6cef48ebba54c7e4ea05d02457dc81.zip
gdb-8619218dfc6cef48ebba54c7e4ea05d02457dc81.tar.gz
gdb-8619218dfc6cef48ebba54c7e4ea05d02457dc81.tar.bz2
* avr-tdep.c (avr_read_pc): Use regcache instead of read_register.
(avr_read_sp): Ditto.
Diffstat (limited to 'gdb/avr-tdep.c')
-rw-r--r--gdb/avr-tdep.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/gdb/avr-tdep.c b/gdb/avr-tdep.c
index aeb901f..7322432 100644
--- a/gdb/avr-tdep.c
+++ b/gdb/avr-tdep.c
@@ -324,12 +324,12 @@ static CORE_ADDR
avr_read_pc (ptid_t ptid)
{
ptid_t save_ptid;
- CORE_ADDR pc;
+ ULONGEST pc;
CORE_ADDR retval;
save_ptid = inferior_ptid;
inferior_ptid = ptid;
- pc = (int) read_register (AVR_PC_REGNUM);
+ regcache_cooked_read_unsigned (current_regcache, AVR_PC_REGNUM, &pc);
inferior_ptid = save_ptid;
retval = avr_make_iaddr (pc);
return retval;
@@ -349,7 +349,10 @@ avr_write_pc (CORE_ADDR val, ptid_t ptid)
static CORE_ADDR
avr_read_sp (void)
{
- return (avr_make_saddr (read_register (AVR_SP_REGNUM)));
+ ULONGEST sp;
+
+ regcache_cooked_read_unsigned (current_regcache, AVR_SP_REGNUM, &sp);
+ return (avr_make_saddr (sp));
}
static int