about summary refs log tree commit diff
path: root/nptl_db/td_ta_event_getmsg.c
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>2002-12-09 10:49:37 +0000
committerRoland McGrath <roland@gnu.org>2002-12-09 10:49:37 +0000
commit58a851f1082519eab4b881036dea70a8ef052f25 (patch)
tree8add850ab754c41407e02756b9b017f8deb70375 /nptl_db/td_ta_event_getmsg.c
parent57b4cb25227fbb4c4e379877de27a5aa119ba938 (diff)
downloadglibc-58a851f1082519eab4b881036dea70a8ef052f25.tar.gz
glibc-58a851f1082519eab4b881036dea70a8ef052f25.tar.xz
glibc-58a851f1082519eab4b881036dea70a8ef052f25.zip
* td_ta_event_getmsg.c (td_ta_event_getmsg): Write the NEXT pointer
	into the inferior's __pthread_last_event variable, not a word from
	an inferior address used in the parent.  Pass the address of a
	null word to ps_pdwrite, not a null pointer.
Diffstat (limited to 'nptl_db/td_ta_event_getmsg.c')
-rw-r--r--nptl_db/td_ta_event_getmsg.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/nptl_db/td_ta_event_getmsg.c b/nptl_db/td_ta_event_getmsg.c
index 4e3245d07b..919ba6569b 100644
--- a/nptl_db/td_ta_event_getmsg.c
+++ b/nptl_db/td_ta_event_getmsg.c
@@ -43,11 +43,11 @@ td_ta_event_getmsg (const td_thragent_t *ta, td_event_msg_t *msg)
 		 &addr, sizeof (struct pthread *)) != PS_OK)
     return TD_ERR;	/* XXX Other error value?  */
 
-  /* Read the even structure from the target.  */
   if (addr == 0)
+    /* Nothing waiting.  */
     return TD_NOMSG;
 
-  /* Read the even structure from the target.  */
+  /* Read the event structure from the target.  */
   td_eventbuf_t event;
   if (ps_pdread (ta->ph, (char *) addr + offsetof (struct pthread, eventbuf),
 		 &event, sizeof (td_eventbuf_t)) != PS_OK)
@@ -73,12 +73,13 @@ td_ta_event_getmsg (const td_thragent_t *ta, td_event_msg_t *msg)
 
   /* Store the pointer in the list head variable.  */
   if (ps_pdwrite (ta->ph, ta->pthread_last_event,
-		 addr, sizeof (struct pthread *)) != PS_OK)
+		  &next, sizeof (struct pthread *)) != PS_OK)
     return TD_ERR;	/* XXX Other error value?  */
 
   /* Clear the next pointer in the current descriptor.  */
+  next = NULL;
   if (ps_pdwrite (ta->ph, (char *) addr + offsetof (struct pthread, nextevent),
-		  NULL, sizeof (struct pthread *)) != PS_OK)
+		  &next, sizeof (struct pthread *)) != PS_OK)
     return TD_ERR;	/* XXX Other error value?  */
 
   return TD_OK;