Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Simon Marchi <simon.marchi@polymtl.ca>
To: Sergio Durigan Junior <sergiodj@redhat.com>
Cc: Simon Marchi <simon.marchi@ericsson.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH 1/3] gdbserver: Remove duplicate functions to find any thread of process
Date: Fri, 15 Sep 2017 12:53:00 -0000	[thread overview]
Message-ID: <3a7403a6edfa38cf515b423913f73dc5@polymtl.ca> (raw)
In-Reply-To: <87efr8txfy.fsf@redhat.com>

On 2017-09-15 06:09, Sergio Durigan Junior wrote:
> On Sunday, September 10 2017, Simon Marchi wrote:
> 
>> We have about 6 functions/callbacks to find_inferior meant to find a
>> thread that belongs to a given pid.  Remove all but
>> find_any_thread_of_pid and replace their uses with
>> find_any_thread_of_pid.
> 
> Thanks for doing.  gdbserver is really confusing when dealing with
> threads and their data structures, so this patch is a nice step towards
> a better interface.

One thing I'm working one is getting rid of 
inferior_list/inferior_list_entry.  The patch is pretty much complete, 
but I keep hesitating about meaningless details... I should just kick 
myself and submit what I have.

> I think this can go in as is, because it is a self contained cleanup,
> but I would like us to move yet another step ahead: recently I've
> implemente gdbserver's version of "switch_to_thread", and I couldn't
> help but think that a "switch_to_any_thread_of_pid" would be good to
> have, because that's what's happening most of the time in this patch.

Ok, sounds like implementing that would just be find_any_thread_of_pid + 
switch_to_thread.

> I know I have to bite the bullet and convert places where
> "current_thread = find_thread_ptid (ptid)" is still being used so that
> "switch_to_thread" is used globally.  I intend to submit a patch for
> that.

Seems like you already did!

> Anyway, this looks good to me.

Thanks for the review, I'll push it in.

Simon


      reply	other threads:[~2017-09-15 12:53 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-10 20:11 [PATCH 0/3] Small cleanups in gdbserver Simon Marchi
2017-09-10 20:11 ` [PATCH 3/3] gdbserver: Remove thread_to_gdb_id Simon Marchi
2017-09-15 11:02   ` Pedro Alves
2017-09-15 13:54     ` Simon Marchi
2017-09-15 14:00       ` Pedro Alves
2017-09-10 20:11 ` [PATCH 2/3] gdbserver: Remove gdb_id_to_thread_id Simon Marchi
2017-09-15 10:55   ` Pedro Alves
2017-09-15 13:07     ` Simon Marchi
2017-09-15 13:34       ` Simon Marchi
2017-09-15 13:44     ` Simon Marchi
2017-09-10 20:11 ` [PATCH 1/3] gdbserver: Remove duplicate functions to find any thread of process Simon Marchi
2017-09-15  4:09   ` Sergio Durigan Junior
2017-09-15 12:53     ` Simon Marchi [this message]

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=3a7403a6edfa38cf515b423913f73dc5@polymtl.ca \
    --to=simon.marchi@polymtl.ca \
    --cc=gdb-patches@sourceware.org \
    --cc=sergiodj@redhat.com \
    --cc=simon.marchi@ericsson.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