[uClibc-cvs] svn commit: trunk/uClibc/libpthread/linuxthreads

vapier at uclibc.org vapier at uclibc.org
Fri Jul 1 00:26:57 UTC 2005


Author: vapier
Date: 2005-06-30 18:26:56 -0600 (Thu, 30 Jun 2005)
New Revision: 10671

Log:
update the debug macros so they build with newer gcc versions

Modified:
   trunk/uClibc/libpthread/linuxthreads/debug.h
   trunk/uClibc/libpthread/linuxthreads/join.c
   trunk/uClibc/libpthread/linuxthreads/manager.c
   trunk/uClibc/libpthread/linuxthreads/pthread.c


Changeset:
Modified: trunk/uClibc/libpthread/linuxthreads/debug.h
===================================================================
--- trunk/uClibc/libpthread/linuxthreads/debug.h	2005-07-01 00:23:19 UTC (rev 10670)
+++ trunk/uClibc/libpthread/linuxthreads/debug.h	2005-07-01 00:26:56 UTC (rev 10671)
@@ -23,13 +23,19 @@
 #ifndef _PT_DEBUG_H
 #define _PT_DEBUG_H
 
+#include <features.h>
+
+#ifdef __DODEBUG_PT__
+# define DEBUG_PT
+#endif
+
 /* include asserts for now */
 #define DO_ASSERT
 
 /* define the PDEBUG macro here */
 #undef PDEBUG
 #ifdef DEBUG_PT
-#  define PDEBUG(fmt, args...) __pthread_message(__FUNCTION__": " fmt, ## args)
+#  define PDEBUG(fmt, args...) __pthread_message("%s: " fmt, __FUNCTION__, ## args)
 #else
 #  define PDEBUG(fmt, args...) /* debug switched off */
 #endif

Modified: trunk/uClibc/libpthread/linuxthreads/join.c
===================================================================
--- trunk/uClibc/libpthread/linuxthreads/join.c	2005-07-01 00:23:19 UTC (rev 10670)
+++ trunk/uClibc/libpthread/linuxthreads/join.c	2005-07-01 00:26:56 UTC (rev 10671)
@@ -31,7 +31,7 @@
   pthread_descr self = thread_self();
   pthread_descr joining;
   struct pthread_request request;
-PDEBUG("self=%p, pid=%d\n", self, self->p_pid);
+  PDEBUG("self=%p, pid=%d\n", self, self->p_pid);
 
   /* Reset the cancellation flag to avoid looping if the cleanup handlers
      contain cancellation points */
@@ -67,7 +67,7 @@
   THREAD_SETMEM(self, p_terminated, 1);
   /* See if someone is joining on us */
   joining = THREAD_GETMEM(self, p_joining);
-PDEBUG("joining = %p, pid=%d\n", joining, joining->p_pid);
+  PDEBUG("joining = %p, pid=%d\n", joining, joining->p_pid);
   __pthread_unlock(THREAD_GETMEM(self, p_lock));
   /* Restart joining thread if any */
   if (joining != NULL) restart(joining);
@@ -117,7 +117,7 @@
   pthread_descr th;
   pthread_extricate_if extr;
   int already_canceled = 0;
-PDEBUG("\n");
+  PDEBUG("\n");
 
   /* Set up extrication interface */
   extr.pu_object = handle;
@@ -154,9 +154,9 @@
       pthread_exit(PTHREAD_CANCELED);
     }
 
-PDEBUG("before suspend\n");
+  PDEBUG("before suspend\n");
     suspend(self);
-PDEBUG("after suspend\n");
+  PDEBUG("after suspend\n");
     /* Deregister extrication interface */
     __pthread_set_own_extricate_if(self, 0); 
 

Modified: trunk/uClibc/libpthread/linuxthreads/manager.c
===================================================================
--- trunk/uClibc/libpthread/linuxthreads/manager.c	2005-07-01 00:23:19 UTC (rev 10670)
+++ trunk/uClibc/libpthread/linuxthreads/manager.c	2005-07-01 00:26:56 UTC (rev 10671)
@@ -165,9 +165,9 @@
     FD_SET (reqfd, &fd);
     n = select (reqfd + 1, &fd, NULL, NULL, &tv);
 #else
-PDEBUG("before poll\n");
+    PDEBUG("before poll\n");
     n = poll(&ufd, 1, 2000);
-PDEBUG("after poll\n");
+    PDEBUG("after poll\n");
 #endif
     /* Check for termination of the main thread */
     if (getppid() == 1) {
@@ -187,13 +187,13 @@
 #endif
     {
 
-PDEBUG("before __libc_read\n");
+      PDEBUG("before __libc_read\n");
       n = __libc_read(reqfd, (char *)&request, sizeof(request));
-PDEBUG("after __libc_read, n=%d\n", n);
+      PDEBUG("after __libc_read, n=%d\n", n);
       ASSERT(n == sizeof(request));
       switch(request.req_kind) {
       case REQ_CREATE:
-PDEBUG("got REQ_CREATE\n");
+        PDEBUG("got REQ_CREATE\n");
         request.req_thread->p_retcode =
           pthread_handle_create((pthread_t *) &request.req_thread->p_retval,
                                 request.req_args.create.attr,
@@ -201,23 +201,23 @@
                                 request.req_args.create.arg,
                                 &request.req_args.create.mask,
                                 request.req_thread->p_pid,
-				request.req_thread->p_report_events,
-				&request.req_thread->p_eventbuf.eventmask);
-PDEBUG("restarting %d\n", request.req_thread);
+                                request.req_thread->p_report_events,
+                                &request.req_thread->p_eventbuf.eventmask);
+        PDEBUG("restarting %d\n", request.req_thread);
         restart(request.req_thread);
         break;
       case REQ_FREE:
-PDEBUG("got REQ_FREE\n");
-	pthread_handle_free(request.req_args.free.thread_id);
+        PDEBUG("got REQ_FREE\n");
+        pthread_handle_free(request.req_args.free.thread_id);
         break;
       case REQ_PROCESS_EXIT:
-PDEBUG("got REQ_PROCESS_EXIT from %d, exit code = %d\n", 
-		request.req_thread, request.req_args.exit.code);
+        PDEBUG("got REQ_PROCESS_EXIT from %d, exit code = %d\n", 
+        request.req_thread, request.req_args.exit.code);
         pthread_handle_exit(request.req_thread,
                             request.req_args.exit.code);
         break;
       case REQ_MAIN_THREAD_EXIT:
-PDEBUG("got REQ_MAIN_THREAD_EXIT\n");
+        PDEBUG("got REQ_MAIN_THREAD_EXIT\n");
         main_thread_exiting = 1;
 	/* Reap children in case all other threads died and the signal handler
 	   went off before we set main_thread_exiting to 1, and therefore did
@@ -233,15 +233,15 @@
 	}
         break;
       case REQ_POST:
-PDEBUG("got REQ_POST\n");
+        PDEBUG("got REQ_POST\n");
         __new_sem_post(request.req_args.post);
         break;
       case REQ_DEBUG:
-PDEBUG("got REQ_DEBUG\n");
+        PDEBUG("got REQ_DEBUG\n");
 	/* Make gdb aware of new thread and gdb will restart the
 	   new thread when it is ready to handle the new thread. */
 	if (__pthread_threads_debug && __pthread_sig_debug > 0) {
-PDEBUG("about to call raise(__pthread_sig_debug)\n");
+      PDEBUG("about to call raise(__pthread_sig_debug)\n");
 	  raise(__pthread_sig_debug);
 	}
       case REQ_KICK:
@@ -280,7 +280,7 @@
 #ifdef INIT_THREAD_SELF
   INIT_THREAD_SELF(self, self->p_nr);
 #endif
-PDEBUG("\n");
+  PDEBUG("\n");
   /* Make sure our pid field is initialized, just in case we get there
      before our father has initialized it. */
   THREAD_SETMEM(self, p_pid, __getpid());
@@ -608,7 +608,7 @@
     }
   if (pid == 0)
     {
-PDEBUG("cloning new_thread = %p\n", new_thread);
+      PDEBUG("cloning new_thread = %p\n", new_thread);
       pid = clone(pthread_start_thread, (void **) new_thread,
 		    CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND |
 		    __pthread_sig_cancel, new_thread);
@@ -641,7 +641,7 @@
     __pthread_handles_num--;
     return errno;
   }
-PDEBUG("new thread pid = %d\n", pid);
+  PDEBUG("new thread pid = %d\n", pid);
 
 #if 0
   /* ***********************************************************
@@ -783,7 +783,7 @@
 {
   pid_t pid;
   int status;
-PDEBUG("\n");
+  PDEBUG("\n");
 
   while ((pid = __libc_waitpid(-1, &status, WNOHANG | __WCLONE)) > 0) {
     pthread_exited(pid);

Modified: trunk/uClibc/libpthread/linuxthreads/pthread.c
===================================================================
--- trunk/uClibc/libpthread/linuxthreads/pthread.c	2005-07-01 00:23:19 UTC (rev 10670)
+++ trunk/uClibc/libpthread/linuxthreads/pthread.c	2005-07-01 00:26:56 UTC (rev 10671)
@@ -513,7 +513,7 @@
       __pthread_wait_for_restart_signal(thread_self());
     }
   /* Synchronize debugging of the thread manager */
-PDEBUG("send REQ_DEBUG to manager thread\n");
+  PDEBUG("send REQ_DEBUG to manager thread\n");
   request.req_kind = REQ_DEBUG;
   TEMP_FAILURE_RETRY(__libc_write(__pthread_manager_request,
 	      (char *) &request, sizeof(request)));
@@ -540,9 +540,9 @@
   PDEBUG("write REQ_CREATE to manager thread\n");
   TEMP_FAILURE_RETRY(__libc_write(__pthread_manager_request,
 	      (char *) &request, sizeof(request)));
-PDEBUG("before suspend(self)\n");
+  PDEBUG("before suspend(self)\n");
   suspend(self);
-PDEBUG("after suspend(self)\n");
+  PDEBUG("after suspend(self)\n");
   if (THREAD_GETMEM(self, p_retcode) == 0)
     *thread = (pthread_t) THREAD_GETMEM(self, p_retval);
   return THREAD_GETMEM(self, p_retcode);
@@ -577,7 +577,7 @@
 
 #ifdef DEBUG_PT
   if (h->h_descr == NULL) {
-      printf("*** "__FUNCTION__" ERROR descriptor is NULL!!!!! ***\n\n");
+      printf("*** %s ERROR descriptor is NULL!!!!! ***\n\n", __FUNCTION__);
       _exit(1);
   }
 #endif



More information about the uClibc-cvs mailing list