* [RFC] Print thread id in hex.
@ 2005-06-07 18:19 Manoj Iyer
2005-06-13 3:29 ` Daniel Jacobowitz
0 siblings, 1 reply; 2+ messages in thread
From: Manoj Iyer @ 2005-06-07 18:19 UTC (permalink / raw)
To: gdb-patches
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 +
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [RFC] Print thread id in hex.
2005-06-07 18:19 [RFC] Print thread id in hex Manoj Iyer
@ 2005-06-13 3:29 ` Daniel Jacobowitz
0 siblings, 0 replies; 2+ messages in thread
From: Daniel Jacobowitz @ 2005-06-13 3:29 UTC (permalink / raw)
To: Manoj Iyer; +Cc: gdb-patches
On Tue, Jun 07, 2005 at 01:10:36PM -0500, Manoj Iyer wrote:
>
> 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).
This is OK, with two trivial changes: please use 0x%lx instead of %#lx,
and please cast to unsigned long instead of long. Neither of these
makes a real difference, but they're both a little clearer. Thanks!
> 2005-06-07 Manoj Iyer <manjo@austin.ibm.com>
>
> * linux-thread-db.c (thread_db_pid_to_str): Print thread id in hex.
--
Daniel Jacobowitz
CodeSourcery, LLC
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2005-06-13 3:29 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-06-07 18:19 [RFC] Print thread id in hex Manoj Iyer
2005-06-13 3:29 ` Daniel Jacobowitz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox