Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: Doug Evans <dje@google.com>
Cc: Sandra Loosemore <sandra@codesourcery.com>, gdb-patches@sourceware.org
Subject: Re: Cannot execute this command without a live selected thread.
Date: Fri, 24 Oct 2014 22:07:00 -0000	[thread overview]
Message-ID: <544ACD83.2050509@redhat.com> (raw)
In-Reply-To: <21578.47311.671976.969985@ruffy.mtv.corp.google.com>

On 10/24/2014 09:38 PM, Doug Evans wrote:
> Pedro Alves writes:
>  > > Not all targets use ptid.lwp.
>  > 
>  > All process_stratum targets do.
> 
> windows-nat.c doesn't
> (at least I remember seeing all calls to ptid_build there
> passing 0 for lwp).
> Could be missing something of course.

Eh, I was quite sure I once wrote a patch for that, and
I thought I had pushed it, but I can't find it now.

Ah, back in 2008 I went through all targets migrating
away from storing the thread in ptid_t.pid.

commit 2dc38344f418c9abe65755308ef6db836a61103a
Author:     Pedro Alves <palves@redhat.com>

        Use ptid_t.tid to store thread ids instead of ptid_t.pid.

        * win32-nat.c (win32_add_thread): Change thread argument type to

etc.  That made way for the multi-process support in the core
being able to rely on ptid_t.pid.

It was much later (years) that I realized that ptid.lwpid would
be a better field.

Anyway, should be a trivial change.  Nothing outside the target
should be looking at ptid.lwpid vs ptid.tid.  I fixed gnu-nat.c
and remote.c recently, but I now see that nto-procfs.c, remote-sim.c
and darwin-nat.c still haven't been given the treatment.
I got confused with wishful thinking.  :-P

> 
>  >     I believe that on the GDB side too, it's best that we standardize on
>  >     process_stratum targets using the ptid.lwp field to store thread ids
>  >     anyway.  The idea being leave the ptid.tid field free for any
>  >     thread_stratum target that might want to sit on top.
> 
> The language in the comment in ptid.h waffles a bit:
> 
>    process_stratum targets that handle threading themselves should
>    prefer using the ptid.lwp field, leaving the ptid.tid field for any
>    thread_stratum target that might want to sit on top.
> 
> Can we make this more of a rule than just a "should prefer"?
> [and fix targets to follow]

Sure, guess I didn't use a stronger word at the time because
I hadn't yet forgotten that the all-targets conversion wasn't
finished.  :-)

Thanks,
Pedro Alves


  parent reply	other threads:[~2014-10-24 22:07 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-24 15:55 Sandra Loosemore
2014-10-24 16:07 ` Pedro Alves
2014-10-24 17:08   ` Sandra Loosemore
2014-10-24 17:23     ` Pedro Alves
2014-10-24 17:40       ` Pedro Alves
2014-10-24 19:02         ` Sandra Loosemore
2014-10-24 19:19         ` Doug Evans
2014-10-24 19:40           ` Pedro Alves
2014-10-24 20:02             ` Doug Evans
2014-10-24 20:20               ` Pedro Alves
2014-10-24 20:38                 ` Doug Evans
2014-10-24 20:52                   ` Remove libthread_db -> remove thread_stratum? [was Re: Cannot execute this command without a live selected thread.] Doug Evans
2014-10-24 22:07                   ` Pedro Alves [this message]
2014-10-27 19:53         ` Cannot execute this command without a live selected thread Sandra Loosemore
2014-10-28 12:10           ` [pushed] Workaround remote targets that report an empty list to qfThreadInfo (Re: Cannot execute this command without a live selected thread.) Pedro Alves
2014-10-29 19:16             ` Doug Evans
2014-10-24 17:57       ` Cannot execute this command without a live selected thread Sandra Loosemore
2014-10-24 18:15         ` 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=544ACD83.2050509@redhat.com \
    --to=palves@redhat.com \
    --cc=dje@google.com \
    --cc=gdb-patches@sourceware.org \
    --cc=sandra@codesourcery.com \
    /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