From: Frank Ch. Eigler Date: Thu, 2 Apr 1998 18:54:04 +0000 (+0000) Subject: * Fixes for PR 14571. X-Git-Tag: gdb-4_18~2783 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7cdd6cac82faad2083029b2ac014d44d869f76c0;p=platform%2Fupstream%2Fbinutils.git * Fixes for PR 14571. Thu Apr 2 12:47:41 1998 Frank Ch. Eigler * sol-thread.c (sol_thread_store_registers): Save & restore new value of single updated register to prevent accidental clobbering. --- 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);