Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Yoriko Komatsuzaki <yoriko@sm.sony.co.jp>
To: gdb-patches@sourceware.org
Subject: deal thread id as unsigned
Date: Mon, 16 Apr 2007 12:02:00 -0000	[thread overview]
Message-ID: <20070416111505.AE36.YORIKO@sm.sony.co.jp> (raw)

Hello.

I would like to ask you to consider this tiny patch about thread id type.
Thread id is unsigned type in Linux.

Without this patch (especially about linux-thread-db.c), thread id
display can be minus...

# Apologies in advance if this is already-known issue.

Thank you.

--- gdb-6.6/gdb/defs.org.h	2007-04-10 16:04:51.000000000 +0900
+++ gdb-6.6/gdb/defs.h	2007-04-10 16:05:06.000000000 +0900
@@ -795,7 +795,7 @@ struct ptid
     long lwp;
 
     /* Thread id */
-    long tid;
+    unsigned long tid;
   };
 
 typedef struct ptid ptid_t;
--- gdb-6.6/gdb/linux-thread-db.org.c	2007-04-10 16:55:55.000000000 +0900
+++ gdb-6.6/gdb/linux-thread-db.c	2007-04-10 16:53:30.000000000 +0900
@@ -1031,10 +1031,10 @@ thread_db_pid_to_str (ptid_t ptid)
 
       thread_info = find_thread_pid (ptid);
       if (thread_info == NULL)
-	snprintf (buf, sizeof (buf), "Thread %ld (LWP %ld) (Missing)",
+	snprintf (buf, sizeof (buf), "Thread %lu (LWP %ld) (Missing)",
 		  GET_THREAD (ptid), GET_LWP (ptid));
       else
-	snprintf (buf, sizeof (buf), "Thread %ld (LWP %ld)",
+	snprintf (buf, sizeof (buf), "Thread %lu (LWP %ld)",
 		  GET_THREAD (ptid), GET_LWP (ptid));
 
       return buf;

---
Yoriko Komatsuzaki (yoriko@sm.sony.co.jp)


             reply	other threads:[~2007-04-16  2:40 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-16 12:02 Yoriko Komatsuzaki [this message]
2007-04-16 14:19 ` Mark Kettenis
2007-04-16 15:14   ` Daniel Jacobowitz
2007-04-17 14:50     ` Yoriko Komatsuzaki
2007-05-14 16:53       ` Daniel Jacobowitz
2007-05-14 16:56         ` Daniel Jacobowitz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070416111505.AE36.YORIKO@sm.sony.co.jp \
    --to=yoriko@sm.sony.co.jp \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox