From 87232496c6542210f59c3de7ffec559bcb187cb5 Mon Sep 17 00:00:00 2001 From: Mark Kettenis Date: Sun, 10 Aug 2003 14:05:47 +0000 Subject: [PATCH] * sol-thread.c (sol_thread_store_registers): Use regcache_collect and supply_register instead of manipulating the register buffer directly. From Peter Schauer (Peter.Schauer@regent.e-technik.tu-muenchen.de): --- gdb/ChangeLog | 5 +++++ gdb/sol-thread.c | 13 ++++++------- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 4b79aff9a60..e1f3b1111dd 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,10 @@ 2003-08-10 Mark Kettenis + From Peter Schauer (Peter.Schauer@regent.e-technik.tu-muenchen.de): + * sol-thread.c (sol_thread_store_registers): Use regcache_collect + and supply_register instead of manipulating the register buffer + directly. + From Peter Schauer (Peter.Schauer@regent.e-technik.tu-muenchen.de): * config/i386/nm-i386sol2.h (TARGET_REGION_SIZE_OK_FOR_HW_WATCHPOINT): Define to one. diff --git a/gdb/sol-thread.c b/gdb/sol-thread.c index 8e2c4ad57a8..a96e8cb7494 100644 --- a/gdb/sol-thread.c +++ b/gdb/sol-thread.c @@ -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 (DEPRECATED_REGISTER_SIZE); - memcpy (old_value, &deprecated_registers[REGISTER_BYTE (regno)], - DEPRECATED_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, - DEPRECATED_REGISTER_SIZE); + /* Restore new register value. */ + supply_register (regno, old_value); #if 0 /* thread_db doesn't seem to handle this right */ -- 2.30.2