]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
* avr-tdep.c (avr_read_pc): Use regcache instead of read_register.
authorTheodore A. Roth <troth@openavr.org>
Fri, 20 Jun 2003 16:55:51 +0000 (16:55 +0000)
committerTheodore A. Roth <troth@openavr.org>
Fri, 20 Jun 2003 16:55:51 +0000 (16:55 +0000)
(avr_read_sp): Ditto.

gdb/ChangeLog
gdb/avr-tdep.c

index 1d520472d9a39d9ea907b26e218f85d7618501c3..634004ca486a6a194356fcbc6d56e0cc6712abf5 100644 (file)
@@ -1,3 +1,8 @@
+2003-06-20  Theodore A. Roth  <troth@openavr.org>
+
+       * avr-tdep.c (avr_read_pc): Use regcache instead of read_register.
+       (avr_read_sp): Ditto.
+
 2003-06-20  Daniel Jacobowitz  <drow@mvista.com>
 
        * config/arm/linux.mt: Remove code protected by GDBSERVER define.
index aeb901f3117309ed76441efb437ddff72c34c3a9..7322432ea294417ad47edac148831c95e7594a86 100644 (file)
@@ -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