[RFC] Print thread id in hex.

Manoj Iyer manjo@austin.ibm.com
Tue Jun 7 18:19:00 GMT 2005


>From the earlier discussion sub: "debugging threaded apps. thread ID
missing in corefile." I wrote this patch to print the thread ids in HEX
(%#lx)  instead of decimal (%ld).



2005-06-07  Manoj Iyer  <manjo@austin.ibm.com>

	* linux-thread-db.c (thread_db_pid_to_str): Print thread id in hex.

--------------------------------------------------------------------------
--- ./old/src/gdb/linux-thread-db.c	2005-06-07 12:52:32.000000000 -0500
+++ ./new/src/gdb/linux-thread-db.c	2005-06-07 12:55:11.000000000 -0500
@@ -1211,12 +1211,12 @@ thread_db_pid_to_str (ptid_t ptid)

       if (ti_p->ti_state == TD_THR_ACTIVE && ti_p->ti_lid != 0)
 	{
-	  snprintf (buf, sizeof (buf), "Thread %ld (LWP %d)",
+	  snprintf (buf, sizeof (buf), "Thread %#lx (LWP %d)",
 		    (long) ti_p->ti_tid, ti_p->ti_lid);
 	}
       else
 	{
-	  snprintf (buf, sizeof (buf), "Thread %ld (%s)",
+	  snprintf (buf, sizeof (buf), "Thread %#lx (%s)",
 		    (long) ti_p->ti_tid,
 		    thread_db_state_str (ti_p->ti_state));
 	}

Thanks
-----
manjo
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ Cogito ergo sum                                                          +
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++



More information about the Gdb-patches mailing list