retitle 579834 Patch to enable a fully working gdb for GNU/Hurd
thanks

Hello,

It looks like the patch in this bug report is missing some details.
Correct patch is attached. The patch will also be reported upstream, but
so far it has not been applied yet. In order to have a fully functional
gdb in GNU/Hurd it would be very good if this patch is included in next
release of gdb_7.2. 

Currently the package is built and hosted at debian-ports using an
earlier patch and built with gcc-4.4. gdb-7.2 was built with gcc-4.6.0-5
and successfully tested with the attached patch applied. It should build
cleanly on the GNU/Hurd buildds.
--- gdb-7.2/gdb/gnu-nat.c.orig	2010-05-14 22:17:37.000000000 +0200
+++ gdb-7.2/gdb/gnu-nat.c	2011-03-28 09:07:49.000000000 +0200
@@ -1578,8 +1578,8 @@
 	  if (--inf->pending_execs == 0)
 	    /* We're done!  */
 	    {
+	      prune_threads ();	/* Get rid of the old shell threads */
 #if 0				/* do we need this? */
-	      prune_threads (1);	/* Get rid of the old shell threads */
 	      renumber_threads (0);	/* Give our threads reasonable names. */
 #endif
 	    }
--- gdb-7.2/gdb/thread.c.orig	2010-08-06 21:51:49.000000000 +0200
+++ gdb-7.2/gdb/thread.c	2011-03-28 09:04:52.000000000 +0200
@@ -61,7 +61,6 @@
 static void info_threads_command (char *, int);
 static void thread_apply_command (char *, int);
 static void restore_current_thread (ptid_t);
-static void prune_threads (void);
 
 /* Frontend view of the thread state.  Possible extensions: stepping,
    finishing, until(ling),...  */
@@ -518,7 +517,7 @@
   return 1;
 }
 
-static void
+void
 prune_threads (void)
 {
   struct thread_info *tp, *next;
--- gdb-7.2/gdb/gdbthread.h.orig	2010-01-12 22:40:24.000000000 +0100
+++ gdb-7.2/gdb/gdbthread.h	2011-03-28 09:03:55.000000000 +0200
@@ -213,6 +213,9 @@
 /* Delete an existing thread list entry.  */
 extern void delete_thread (ptid_t);
 
+/* Prune inactive threads  */
+extern void prune_threads (void);
+
 /* Delete an existing thread list entry, and be quiet about it.  Used
    after the process this thread having belonged to having already
    exited, for example.  */

Reply via email to