Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libpthread_dbg Preferentially read context pointer from ...



details:   https://anonhg.NetBSD.org/src/rev/5be990f9baed
branches:  trunk
changeset: 548445:5be990f9baed
user:      nathanw <nathanw%NetBSD.org@localhost>
date:      Thu Jun 26 21:51:59 2003 +0000

description:
Preferentially read context pointer from pt_trapuc.

diffstat:

 lib/libpthread_dbg/pthread_dbg.c |  25 +++++++++++++++++++------
 1 files changed, 19 insertions(+), 6 deletions(-)

diffs (59 lines):

diff -r d2044c10ddcd -r 5be990f9baed lib/libpthread_dbg/pthread_dbg.c
--- a/lib/libpthread_dbg/pthread_dbg.c  Thu Jun 26 21:49:17 2003 +0000
+++ b/lib/libpthread_dbg/pthread_dbg.c  Thu Jun 26 21:51:59 2003 +0000
@@ -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 @@
                 * 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 @@
                 * 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)



Home | Main Index | Thread Index | Old Index