Module Name:    src
Committed By:   kamil
Date:           Sun Nov 20 03:11:32 UTC 2016

Modified Files:
        src/lib/libpthread_dbg: pthread_dbg.c

Log Message:
Catch up with correct pt_magic reads in td_thr_{getname,suspend,resume}

The pt_magic field is not the first one in the pthread_t structure.

Sponsored by <The NetBSD Foundation>


To generate a diff of this commit:
cvs rdiff -u -r1.45 -r1.46 src/lib/libpthread_dbg/pthread_dbg.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libpthread_dbg/pthread_dbg.c
diff -u src/lib/libpthread_dbg/pthread_dbg.c:1.45 src/lib/libpthread_dbg/pthread_dbg.c:1.46
--- src/lib/libpthread_dbg/pthread_dbg.c:1.45	Sun Nov 20 02:27:56 2016
+++ src/lib/libpthread_dbg/pthread_dbg.c	Sun Nov 20 03:11:32 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: pthread_dbg.c,v 1.45 2016/11/20 02:27:56 kamil Exp $	*/
+/*	$NetBSD: pthread_dbg.c,v 1.46 2016/11/20 03:11:32 kamil Exp $	*/
 
 /*-
  * Copyright (c) 2002 Wasabi Systems, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: pthread_dbg.c,v 1.45 2016/11/20 02:27:56 kamil Exp $");
+__RCSID("$NetBSD: pthread_dbg.c,v 1.46 2016/11/20 03:11:32 kamil Exp $");
 
 #define __EXPOSE_STACK 1
 
@@ -263,7 +263,7 @@ td_thr_getname(td_thread_t *thread, char
 	caddr_t nameaddr;
 	
 
-	val = READ(thread->proc, thread->addr, &tmp, sizeof(tmp));
+	val = READ(thread->proc, OFFSET(thread, pt_magic), &tmp, sizeof(tmp));
 	if (val != 0)
 		return val;
 
@@ -441,7 +441,7 @@ td_thr_suspend(td_thread_t *thread)
 	int tmp, val;
 
 	/* validate the thread */
-	val = READ(thread->proc, thread->addr, &tmp, sizeof(tmp));
+	val = READ(thread->proc, OFFSET(thread, pt_magic), &tmp, sizeof(tmp));
 	if (val != 0)
 		return val;
 	if (tmp != PT_MAGIC)
@@ -463,7 +463,7 @@ td_thr_resume(td_thread_t *thread)
 	int tmp, val;
 
 	/* validate the thread */
-	val = READ(thread->proc, thread->addr, &tmp, sizeof(tmp));
+	val = READ(thread->proc, OFFSET(thread, pt_magic), &tmp, sizeof(tmp));
 	if (val != 0)
 		return val;
 	if (tmp != PT_MAGIC)

Reply via email to