Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Mark Kettenis <mark.kettenis@xs4all.nl>
To: pedro@codesourcery.com
Cc: gdb@sourceware.org, stefano.sabatini-lala@poste.it
Subject: Re: pthread_t ids of threads not showed by "thread info"
Date: Fri, 23 Apr 2010 15:37:00 -0000	[thread overview]
Message-ID: <201004231536.o3NFa1Kn029584@glazunov.sibelius.xs4all.nl> (raw)
In-Reply-To: <201004231347.31809.pedro@codesourcery.com> (message from Pedro 	Alves on Fri, 23 Apr 2010 13:47:31 +0100)

> From: Pedro Alves <pedro@codesourcery.com>
> Date: Fri, 23 Apr 2010 13:47:31 +0100
> 
> On Friday 23 April 2010 13:29:52, Mark Kettenis wrote:
> > If you ask me, whoever made the change from process to thread (cvs
> > annotate says it's you ;), made a mistake.  
> 
> Yep.  No need to ask, I already said so.  ;-)
> 
> > The interpretation of the
> > pid read from the core file really is OS-specific.  The default
> > core_pid_to_str should really be the lowest common denominator, i.e,
> > normal_pid_to_str().  That's really the only thing that makes sense
> > for non-threaded code on a UNIX-like system.  
> 
> Yeah, probably.  What are the targets we support you're thinking
> where "process" would make more sense and be less confusing
> than "LWP"?  Pedantic-ness issues aside, seeing multiple
> "processes" in the list when all the processes share a single
> address space looks a bit strange to me.

I was thinking of *any* target running a UNIX-like OS.  For for the
(typical) user debugging a non-threaded program on a UNIX-like OS,
seeing "Thread ..." or "LWP ..." is confusing.  Especially the term
"LWP" will be pretty cryptic to many people not familliar with
implementation details of the Solaris/SVR4.2 MP/NetBSD threads
implementations.

One can even argue that it's the wrong thing to use on Linux.  I don't
think the Linux kernel has the concept of an LWP.  A more appropriate
term on Linux would be TID, at least that is what the gettid() man
page uses and what's used in the comments in the kernel sources.

> > The threads stratum then
> > can override this for threaded code.
> > 
> > If like on Linux, the threading stuff is messed up for core files, and
> > not easily fixable, it is probably more helpful to print LWP's like
> > you suggest.  
> 
> It's not about that, that's a different issue.  In linux, assume
> we're talking about the core of a program that didn't use any
> pthreads facilities (used raw `clone'), and you still have
> multiple processes listed in the core.

Right.  It would be nice if that produced meaningful output as well.

> > But in my opinion that really should be done by
> > overriding the default using set_gdbarch_core_pid_to_str().
> 
> That works, of course.  I'm just thinking of the practical
> aspect.  If we have many targets that want "LWP", and one
> that wants "process", is it worth the hassle?

I think decoupling things will help us here in the long run.


  reply	other threads:[~2010-04-23 15:37 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-22 15:19 Stefano Sabatini
2010-04-22 15:44 ` Stefano Sabatini
2010-04-22 16:59   ` Jan Kratochvil
2010-04-23  7:51     ` Stefano Sabatini
2010-04-23 10:25       ` Jan Kratochvil
2010-04-23 14:21         ` Stefano Sabatini
2010-04-23 14:25           ` Jan Kratochvil
2010-04-23 15:36             ` Stefano Sabatini
2010-04-23 15:46               ` Jan Kratochvil
2010-04-26  8:38                 ` Stefano Sabatini
2010-04-26  9:04                   ` Jan Kratochvil
2010-04-26 11:07                     ` Stefano Sabatini
2010-04-26 11:25                       ` Jan Kratochvil
2010-04-23 14:29           ` Stefano Sabatini
2010-04-23 11:50   ` Pedro Alves
2010-04-23 12:31     ` Mark Kettenis
2010-04-23 12:47       ` Pedro Alves
2010-04-23 15:37         ` Mark Kettenis [this message]
2010-04-23 15:51           ` Pedro Alves
2010-08-04 14:36             ` Pedro Alves
2010-08-04 14:57               ` Mark Kettenis
2010-08-04 15:29                 ` Pedro Alves
2010-08-04 16:53               ` Ulrich Weigand
2010-08-04 17:14                 ` Pedro Alves
2010-08-04 17:40                   ` Pedro Alves
2010-08-04 17:44                     ` Ulrich Weigand
2010-08-04 18:20                       ` Pedro Alves
2010-08-04 18:34                         ` Ulrich Weigand
2010-08-04 20:41                           ` Pedro Alves
2010-08-04 17:45                     ` Ulrich Weigand
2010-04-22 20:52 ` Petr Hluzín
2010-04-22 20:56   ` Daniel Jacobowitz
2010-08-18 14:17 ` Pedro Alves

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=201004231536.o3NFa1Kn029584@glazunov.sibelius.xs4all.nl \
    --to=mark.kettenis@xs4all.nl \
    --cc=gdb@sourceware.org \
    --cc=pedro@codesourcery.com \
    --cc=stefano.sabatini-lala@poste.it \
    /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