From 76d9136b8f9434aaf3ca997511ec687e8b10847a Mon Sep 17 00:00:00 2001 From: Joakim Tjernlund Date: Mon, 31 Jan 2005 15:48:37 +0000 Subject: Sync with latest GLIBC. --- libpthread/linuxthreads_db/td_thr_getfpregs.c | 7 +++++-- libpthread/linuxthreads_db/td_thr_getgregs.c | 8 +++++--- 2 files changed, 10 insertions(+), 5 deletions(-) (limited to 'libpthread') diff --git a/libpthread/linuxthreads_db/td_thr_getfpregs.c b/libpthread/linuxthreads_db/td_thr_getfpregs.c index ea02760c9..31c55c876 100644 --- a/libpthread/linuxthreads_db/td_thr_getfpregs.c +++ b/libpthread/linuxthreads_db/td_thr_getfpregs.c @@ -1,5 +1,5 @@ /* Get a thread's floating-point register set. - Copyright (C) 1999, 2001 Free Software Foundation, Inc. + Copyright (C) 1999, 2001, 2003 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 1999. @@ -30,7 +30,10 @@ td_thr_getfpregs (const td_thrhandle_t *th, prfpregset_t *regset) if (th->th_unique == NULL) { - memset (regset, '\0', sizeof (*regset)); + /* No data yet. Use the main thread. */ + pid_t pid = ps_getpid (th->th_ta_p->ph); + if (ps_lgetfpregs (th->th_ta_p->ph, pid, regset) != PS_OK) + return TD_ERR; return TD_OK; } diff --git a/libpthread/linuxthreads_db/td_thr_getgregs.c b/libpthread/linuxthreads_db/td_thr_getgregs.c index 6f00677d6..a9ec6a37d 100644 --- a/libpthread/linuxthreads_db/td_thr_getgregs.c +++ b/libpthread/linuxthreads_db/td_thr_getgregs.c @@ -1,5 +1,5 @@ /* Get a thread's general register set. - Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc. + Copyright (C) 1999, 2000, 2001, 2003 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 1999. @@ -30,8 +30,10 @@ td_thr_getgregs (const td_thrhandle_t *th, prgregset_t gregs) if (th->th_unique == NULL) { - /* No data yet. */ - memset (gregs, '\0', sizeof (prgregset_t)); + /* No data yet. Use the main thread. */ + pid_t pid = ps_getpid (th->th_ta_p->ph); + if (ps_lgetregs (th->th_ta_p->ph, pid, gregs) != PS_OK) + return TD_ERR; return TD_OK; } -- cgit v1.2.3