summaryrefslogtreecommitdiff
path: root/lib/libpthread_dbg
diff options
context:
space:
mode:
authornathanw <nathanw@NetBSD.org>2003-06-26 21:51:59 +0000
committernathanw <nathanw@NetBSD.org>2003-06-26 21:51:59 +0000
commit6a0c6dddb767943cbe706f3f6cb74a44a47cd2fb (patch)
treece33724eae7486c776a731eaeaf0c15e25f0dff0 /lib/libpthread_dbg
parent73ed908c034fd173dc1ecb443cb472afcef10cca (diff)
Preferentially read context pointer from pt_trapuc.
Diffstat (limited to 'lib/libpthread_dbg')
-rw-r--r--lib/libpthread_dbg/pthread_dbg.c25
1 files changed, 19 insertions, 6 deletions
diff --git a/lib/libpthread_dbg/pthread_dbg.c b/lib/libpthread_dbg/pthread_dbg.c
index d1fc23e929f..bca5c91c41c 100644
--- a/lib/libpthread_dbg/pthread_dbg.c
+++ b/lib/libpthread_dbg/pthread_dbg.c
@@ -1,4 +1,4 @@
-/* $NetBSD: pthread_dbg.c,v 1.6 2003/04/05 01:39:13 nathanw Exp $ */
+/* $NetBSD: pthread_dbg.c,v 1.7 2003/06/26 21:51:59 nathanw Exp $ */
/*-
* Copyright (c) 2002 Wasabi Systems, Inc.
@@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
-__RCSID("$NetBSD: pthread_dbg.c,v 1.6 2003/04/05 01:39:13 nathanw Exp $");
+__RCSID("$NetBSD: pthread_dbg.c,v 1.7 2003/06/26 21:51:59 nathanw Exp $");
#include <stddef.h>
#include <stdlib.h>
@@ -337,12 +337,18 @@ td_thr_getregs(td_thread_t *thread, int regset, void *buf)
* of the thread structure.
*/
val = READ(thread->proc,
- thread->addr + offsetof(struct pthread_st, pt_uc),
+ thread->addr + offsetof(struct pthread_st, pt_trapuc),
&addr, sizeof(addr));
if (val != 0)
return val;
- val = READ(thread->proc,
- addr, &uc, sizeof(uc));
+ if (addr == 0) {
+ val = READ(thread->proc,
+ thread->addr + offsetof(struct pthread_st, pt_uc),
+ &addr, sizeof(addr));
+ if (val != 0)
+ return val;
+ }
+ val = READ(thread->proc, addr, &uc, sizeof(uc));
if (val != 0)
return val;
@@ -400,10 +406,17 @@ td_thr_setregs(td_thread_t *thread, int regset, void *buf)
* besides the registers that should be preserved.
*/
val = READ(thread->proc,
- thread->addr + offsetof(struct pthread_st, pt_uc),
+ thread->addr + offsetof(struct pthread_st, pt_trapuc),
&addr, sizeof(addr));
if (val != 0)
return val;
+ if (addr == 0) {
+ val = READ(thread->proc,
+ thread->addr + offsetof(struct pthread_st, pt_uc),
+ &addr, sizeof(addr));
+ if (val != 0)
+ return val;
+ }
val = READ(thread->proc,
addr, &uc, sizeof(uc));
if (val != 0)