summaryrefslogtreecommitdiff
path: root/libpthread/linuxthreads_db/td_thr_getgregs.c
diff options
context:
space:
mode:
Diffstat (limited to 'libpthread/linuxthreads_db/td_thr_getgregs.c')
-rw-r--r--libpthread/linuxthreads_db/td_thr_getgregs.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/libpthread/linuxthreads_db/td_thr_getgregs.c b/libpthread/linuxthreads_db/td_thr_getgregs.c
index 5a42b6770..6f00677d6 100644
--- a/libpthread/linuxthreads_db/td_thr_getgregs.c
+++ b/libpthread/linuxthreads_db/td_thr_getgregs.c
@@ -26,7 +26,14 @@ td_thr_getgregs (const td_thrhandle_t *th, prgregset_t gregs)
{
struct _pthread_descr_struct pds;
- LOG (__FUNCTION__);
+ LOG ("td_thr_getgregs");
+
+ if (th->th_unique == NULL)
+ {
+ /* No data yet. */
+ memset (gregs, '\0', sizeof (prgregset_t));
+ return TD_OK;
+ }
/* We have to get the state and the PID for this thread. */
if (ps_pdread (th->th_ta_p->ph, th->th_unique, &pds,