Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <pedro@codesourcery.com>
To: gdb-patches@sourceware.org
Cc: Vladimir Prus <vladimir@codesourcery.com>
Subject: Re: [non-stop] 01/10 Add "executing" property
Date: Wed, 25 Jun 2008 19:13:00 -0000	[thread overview]
Message-ID: <200806252002.27906.pedro@codesourcery.com> (raw)
In-Reply-To: <g3u0d1$on$2@ger.gmane.org>

A Wednesday 25 June 2008 18:48:27, Vladimir Prus escreveu:
> Pedro Alves wrote:
> > +
> > +/* Reports if thread PTID is executing.  */
> > +extern int is_executing (ptid_t ptid);
>
> I know if follows is_running, introduced by me, but I think this is not
> the best interface. Say, somewhere later in this patch series we have
> this function:
>

Right.  I actually think I introduced is_running in one of those early
non-stop patches  :-)  It goes hand in hand with set_running.  By
your reasoning, we should make it set_running_ptid too.

>         static int
>         proceed_thread_callback (struct thread_info *thread, void *arg)
>         {
>           if (!is_stopped (thread->ptid))
>           ....
>
> Here, we already have thread_info, and using ptid to search for thread
> again, and get its state seems not nice. How about:
>
>         extern int is_executing (struct thread_info *thread);
>         extern int is_executing_ptid (ptid_t ptid);
>

There are actually very few places that need to check for
is_executing, (frame.c, stack.c), and I don't expect much more.
None of these places have a thread_info pointer around.  I can change
the interface, no problem with me, but in this case, we only need the
ptid form currently.

>         static int
>         proceed_thread_callback (struct thread_info *thread, void *arg)
>         {
>           if (!is_stopped (thread->ptid))
>           ....
> and a similar change for is_running?

The is_stopped method is only introduced in patch 10 actually.

We could also do is_stopped_thread (struct thread_info *) instead,
as I expect the ptid versions to be used more often.

I'll wait for review on it (as it is the patch that will probably need
more adjustement) before making interface changes, OK?

-- 
Pedro Alves


  reply	other threads:[~2008-06-25 19:02 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-15 21:04 Pedro Alves
2008-06-15 22:18 ` Eli Zaretskii
2008-06-16  1:42   ` Daniel Jacobowitz
2008-06-16  3:23     ` Eli Zaretskii
2008-06-16  6:45       ` ChangeLog entries [was Re: [non-stop] 01/10 Add "executing" property] Nick Roberts
2008-06-16  7:22     ` [non-stop] 01/10 Add "executing" property Vladimir Prus
2008-06-17  0:40       ` Eli Zaretskii
2008-06-17 17:10         ` Vladimir Prus
2008-06-17 20:38           ` Eli Zaretskii
2008-06-23 17:27       ` Tom Tromey
2008-06-17 16:14   ` Joel Brobecker
2008-06-17 18:24     ` Eli Zaretskii
2008-06-17 18:32       ` Joel Brobecker
2008-06-18  0:22         ` Eli Zaretskii
2008-06-17 18:34       ` Pedro Alves
2008-06-17 20:58         ` Eli Zaretskii
2008-06-23  1:13         ` Daniel Jacobowitz
2008-06-23 11:54           ` Vladimir Prus
2008-06-23 14:41             ` Pedro Alves
2008-06-23 18:22               ` Eli Zaretskii
2008-06-23 18:25                 ` Vladimir Prus
2008-06-23 19:52                   ` Pedro Alves
2008-06-24  1:13                     ` Eli Zaretskii
2008-06-23 18:14             ` Eli Zaretskii
2008-07-02  3:29           ` Pedro Alves
2008-06-25 19:02 ` Vladimir Prus
2008-06-25 19:13   ` Pedro Alves [this message]
2008-06-25 19:22     ` Daniel Jacobowitz
2008-06-26 13:37       ` Vladimir Prus

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=200806252002.27906.pedro@codesourcery.com \
    --to=pedro@codesourcery.com \
    --cc=gdb-patches@sourceware.org \
    --cc=vladimir@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