* 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.
This commit is contained in:
Frank Ch. Eigler 1998-04-02 18:54:04 +00:00
parent c8b7788793
commit 7cdd6cac82

View File

@ -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);