[commit] Fix regcache API misuses

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[commit] Fix regcache API misuses

Ulrich Weigand
Hello,

this patch fixes two obvious misuses of the regcache API: the
hpux_thread_store_registers routine needs to use regcache_raw_collect,
not regcache_raw_read.   Likewise, the irix5-nat.c fetch_core_registers
routine needs to use regcache_raw_supply, not regcache_raw_write.

Committed to mainline.

Bye,
Ulrich


ChangeLog:

        * hpux-thread.c (hpux_thread_store_registers): Use
        regcache_raw_collect, not regcache_raw_read.
        * irix5-nat.c (fetch_core_registers): Use regcache_raw_supply,
        not regcache_raw_write.

Index: gdb/hpux-thread.c
===================================================================
RCS file: /cvs/src/src/gdb/hpux-thread.c,v
retrieving revision 1.33
diff -u -p -r1.33 hpux-thread.c
--- gdb/hpux-thread.c 9 Jan 2007 17:58:51 -0000 1.33
+++ gdb/hpux-thread.c 28 Apr 2007 22:46:19 -0000
@@ -359,7 +359,7 @@ hpux_thread_store_registers (int regno)
     deprecated_child_ops.to_store_registers (regno); /* Let lower layer handle this... */
   else if (regno == HPPA_SP_REGNUM)
     {
-      regcache_raw_read (current_regcache, regno, buf);
+      regcache_raw_collect (current_regcache, regno, buf);
       write_memory ((CORE_ADDR) &tcb_ptr->static_ctx.sp, buf,
     register_size (current_gdbarch, regno));
       tcb_ptr->static_ctx.sp
@@ -367,13 +367,13 @@ hpux_thread_store_registers (int regno)
     }
   else if (regno == HPPA_PCOQ_HEAD_REGNUM)
     {
-      regcache_raw_read (current_regcache, regno, buf);
+      regcache_raw_collect (current_regcache, regno, buf);
       write_memory (sp - 20, buf,
     register_size (current_gdbarch, regno));
     }
   else
     {
-      regcache_raw_read (current_regcache, regno, buf);
+      regcache_raw_collect (current_regcache, regno, buf);
       write_memory (sp + regmap[regno], buf,
     register_size (current_gdbarch, regno));
     }
Index: gdb/irix5-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/irix5-nat.c,v
retrieving revision 1.42
diff -u -p -r1.42 irix5-nat.c
--- gdb/irix5-nat.c 9 Jan 2007 17:58:51 -0000 1.42
+++ gdb/irix5-nat.c 28 Apr 2007 22:46:19 -0000
@@ -255,7 +255,7 @@ fetch_core_registers (char *core_reg_sec
 
   for (regno = 0; regno < NUM_REGS; regno++)
     {
-      regcache_raw_write (current_regcache, regno, srcp);
+      regcache_raw_supply (current_regcache, regno, srcp);
       srcp += regsize;
     }
 }
--
  Dr. Ulrich Weigand
  GNU Toolchain for Linux on System z and Cell BE
  [hidden email]