From: Doug Evans <dje@google.com>
To: gdb@sourceware.org
Subject: Re: improved thread id reporting
Date: Sun, 05 Apr 2009 19:22:00 -0000 [thread overview]
Message-ID: <e394668d0904051150x3fb5fd4o94223223213e0275@mail.gmail.com> (raw)
In-Reply-To: <20090405011134.GA15762@caradoc.them.org>
On Sat, Apr 4, 2009 at 6:11 PM, Daniel Jacobowitz <drow@false.org> wrote:
> On Sat, Apr 04, 2009 at 03:17:02PM -0700, Doug Evans wrote:
>> > That said, if it's possible to print them without creating additional
>> > line breaks on an 80-column wide screen, I have no objections.
>> >
>> >> To fix (1) I'd like to simply remove the pthread id from the output.
>> >
>> > I think that's a bad idea.
>>
>> Even as a user-settable option?
>
> IMO, yes. I don't think we need more settable options for details of
> output formatting; 98% or so of users will use the default, so that's
> the part that matters.
Oh well, 2 out of 3 ...
[Modulo one could provide a command to look up the pthread id given
the thread number, or provide an option to "info threads" to include
or not include it. I'm just mentioning that for completeness sake
though.]
Question: Why does remote.c print pid.tid? [ref: remote_pid_to_str]
[I know I said it's kinda nice, but I still have a question.]
IOW, if printing pid is good for remote.c then why isn't it good for non-remote?
And if it's not good for non-remote, then why is it good for remote?
[I'm specifically referring to the linux case, but I'm guessing the
same applies to any gdbserver situation where one _could_ debug
locally as well.]
In the linux case at least the difference doesn't seem warranted
(except as some compromise, but why compromise?).
windows-nat.c:windows_pid_to_str, for example, prints pid.hex-tid. In
the windows case is pid the same for every thread? (in the
non-multiprocess case) Is there a case (windows or otherwise) where
pid _could_ be different for different threads in the non-multiprocess
case? I'd expect not (gdb pretty much assumes ptid.pid is the same
for all threads in a process, right?), but please let me know if I'm
wrong.
So if one were to start over, it seems like the printing of the pid
for every thread is better left to something else ("info proc pid" or
some such? If "proc" has too much of a linux connotation (/proc,
et.al.) then maybe "info inferior pid"? And if something like that
makes sense, can we remove the printing of pid from multi-threaded
target_pid_to_str's and remote_pid_to_str?
It seems like the pretty-printing of a ptid_t is not a property of the
target, per se (to the extent that all else being equal there doesn't
seem to be a justification for printing local linux ptids different
from remote linux ptids - I gather there was an implementation problem
in communicating remote pthread_t's over the remote protocol, but I'm
guessing what's there now is a compromise and not the preferred
choice).
I can't think of an existing place to move target_pid_to_str though. Blech.
And there's nothing else on the target stack for remote_pid_to_str to
defer to; IWBN if we could somehow teach it to print what the local
version would print.
next prev parent reply other threads:[~2009-04-05 18:50 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-04-04 19:06 Doug Evans
2009-04-04 19:07 ` Mark Kettenis
2009-04-04 20:40 ` Daniel Jacobowitz
2009-04-04 21:21 ` Eli Zaretskii
2009-04-04 22:17 ` Daniel Jacobowitz
2009-04-05 1:11 ` Doug Evans
2009-04-05 3:42 ` Eli Zaretskii
2009-04-05 3:48 ` Daniel Jacobowitz
2009-04-05 7:19 ` Paul Pluzhnikov
2009-04-05 18:50 ` Eli Zaretskii
2009-04-05 20:11 ` Paul Pluzhnikov
2009-04-05 20:36 ` Eli Zaretskii
2009-04-04 22:35 ` Doug Evans
2009-04-06 2:58 ` Doug Evans
2009-04-06 3:33 ` Eli Zaretskii
2009-04-06 15:36 ` Mark Kettenis
2009-04-06 20:21 ` Eli Zaretskii
2009-04-06 7:39 ` Daniel Jacobowitz
2009-04-06 21:21 ` Eli Zaretskii
2009-05-08 5:43 ` Doug Evans
2009-04-06 20:20 ` Tom Tromey
2009-04-06 20:20 ` Eli Zaretskii
2009-04-06 22:15 ` Tom Tromey
2009-04-07 15:18 ` Doug Evans
2009-04-04 22:24 ` Doug Evans
2009-04-05 3:13 ` Daniel Jacobowitz
2009-04-05 9:16 ` Mark Kettenis
2009-04-05 18:23 ` Eli Zaretskii
2009-04-05 19:22 ` Doug Evans [this message]
2009-04-04 19:20 ` Thiago Jung Bauermann
2009-04-04 19:21 ` Eli Zaretskii
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=e394668d0904051150x3fb5fd4o94223223213e0275@mail.gmail.com \
--to=dje@google.com \
--cc=gdb@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