2004-01-09 Elena Zannoni <ezannoni@redhat.com>
[deliverable/binutils-gdb.git] / gdb / sol-thread.c
index 1d379e9ec19020f7cb1c79683b3fab34bf0d2245..72313dcb29c460b451af4928138a13b081f61442 100644 (file)
@@ -62,6 +62,8 @@
 #include "regcache.h"
 #include "symfile.h"
 
+#include "gdb_string.h"
+
 extern struct target_ops sol_thread_ops;       /* Forward declaration */
 extern struct target_ops sol_core_ops; /* Forward declaration */
 
@@ -399,8 +401,6 @@ lwp_to_thread (ptid_t lwp)
 /* Most target vector functions from here on actually just pass through to
    procfs.c, as they don't need to do anything specific for threads.  */
 
-
-/* ARGSUSED */
 static void
 sol_thread_open (char *arg, int from_tty)
 {
@@ -646,10 +646,10 @@ sol_thread_store_registers (int regno)
 
   if (regno != -1)
     {                          /* Not writing all the regs */
-      /* save new register value */
-      char* old_value = (char*) alloca (REGISTER_SIZE);
-      memcpy (old_value, &deprecated_registers[REGISTER_BYTE (regno)],
-             REGISTER_SIZE);
+      char old_value[MAX_REGISTER_SIZE];
+      
+      /* Save new register value.  */
+      regcache_collect (regno, old_value);
 
       val = p_td_thr_getgregs (&thandle, gregset);
       if (val != TD_OK)
@@ -660,9 +660,8 @@ sol_thread_store_registers (int regno)
        error ("sol_thread_store_registers: td_thr_getfpregs %s",
               td_err_string (val));
 
-      /* restore new register value */
-      memcpy (&deprecated_registers[REGISTER_BYTE (regno)], old_value,
-             REGISTER_SIZE);
+      /* Restore new register value.  */
+      supply_register (regno, old_value);
 
 #if 0
 /* thread_db doesn't seem to handle this right */
This page took 0.025733 seconds and 4 git commands to generate.