This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[PATCH] Fix threads support on Solaris x86
- From: Mark Kettenis <kettenis at chello dot nl>
- To: gdb-patches at sources dot redhat dot com
- Date: Sun, 10 Aug 2003 16:10:08 +0200 (CEST)
- Subject: [PATCH] Fix threads support on Solaris x86
Got this patch from Peter Schauer too. Checked in on both mainline
and branch.
Mark
Index: ChangeLog
from Mark Kettenis <kettenis@gnu.org>
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.
Index: sol-thread.c
===================================================================
RCS file: /cvs/src/src/gdb/sol-thread.c,v
retrieving revision 1.35
diff -u -p -r1.35 sol-thread.c
--- sol-thread.c 5 May 2003 17:56:56 -0000 1.35
+++ sol-thread.c 10 Aug 2003 14:04:11 -0000
@@ -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 */