aboutsummaryrefslogtreecommitdiff
path: root/gdb/sol-thread.c
diff options
context:
space:
mode:
authorFrank Ch. Eigler <fche@redhat.com>1998-04-02 18:54:04 +0000
committerFrank Ch. Eigler <fche@redhat.com>1998-04-02 18:54:04 +0000
commit7cdd6cac82faad2083029b2ac014d44d869f76c0 (patch)
treefd48e30195dfba81e56e66a491ff560210cf3ed2 /gdb/sol-thread.c
parentc8b7788793737ea272a34be99f9e9c75a120c64e (diff)
downloadgdb-7cdd6cac82faad2083029b2ac014d44d869f76c0.zip
gdb-7cdd6cac82faad2083029b2ac014d44d869f76c0.tar.gz
gdb-7cdd6cac82faad2083029b2ac014d44d869f76c0.tar.bz2
* Fixes for PR 14571.
Thu Apr 2 12:47:41 1998 Frank Ch. Eigler <fche@cygnus.com> * sol-thread.c (sol_thread_store_registers): Save & restore new value of single updated register to prevent accidental clobbering.
Diffstat (limited to 'gdb/sol-thread.c')
-rw-r--r--gdb/sol-thread.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/gdb/sol-thread.c b/gdb/sol-thread.c
index edd54f1..fbbbbcb 100644
--- a/gdb/sol-thread.c
+++ b/gdb/sol-thread.c
@@ -704,6 +704,10 @@ sol_thread_store_registers (regno)
if (regno != -1)
{ /* Not writing all the regs */
+ /* save new register value */
+ char old_value[REGISTER_SIZE];
+ memcpy(old_value, & registers[REGISTER_BYTE(regno)], REGISTER_SIZE);
+
val = p_td_thr_getgregs (&thandle, regset);
if (val != TD_OK)
error ("sol_thread_store_registers: td_thr_getgregs %s",
@@ -713,6 +717,9 @@ sol_thread_store_registers (regno)
error ("sol_thread_store_registers: td_thr_getfpregs %s",
td_err_string (val));
+ /* restore register value */
+ memcpy(& registers[REGISTER_BYTE(regno)], old_value, REGISTER_SIZE);
+
#if 0
/* thread_db doesn't seem to handle this right */
val = td_thr_getxregsize (&thandle, &xregsize);