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: [MI non-stop 10/11] Skip varobj in running threads.
Date: Fri, 11 Jul 2008 13:57:00 -0000	[thread overview]
Message-ID: <200807111456.40088.pedro@codesourcery.com> (raw)
In-Reply-To: <200806282100.06214.vladimir@codesourcery.com>

On Saturday 28 June 2008 18:00:06, Vladimir Prus wrote:

>
>  const char mi_no_values[] = "--no-values";
>  const char mi_simple_values[] = "--simple-values";
> @@ -610,8 +611,19 @@ mi_cmd_var_update (char *command, char **argv, int
> argc) cr = rootlist;
>        while (*cr != NULL)
>  	{
> -	  if (*name == '*' || varobj_floating_p (*cr))
> -	    varobj_update_one (*cr, print_values, 0 /* implicit */);
> +	  int thread_id = varobj_get_thread_id (*cr);
> +	  int thread_running = 0;
> +	  if (thread_id == 0 && is_executing (inferior_ptid))
> +	    thread_running = 1;
> +	  else if (thread_id > 0)
> +	    {
> +	      struct thread_info *tp = find_thread_id (thread_id);
> +	      if (tp)
> +		thread_running = is_running (tp->ptid);
> +	    }
> +	  if (!thread_running)
> +	    if (*name == '*' || varobj_floating_p (*cr))
> +	      varobj_update_one (*cr, print_values, 0 /* implicit */);

You should reverse the logic, and do the update if the thread is_stopped
instead of !is_running.  That is because there is now exited state
to care for as well, and is_running also returns false on those.  Essentially,
the is_STATE functions should not be tested with negation, if you're looking
for a particular state.

-- 
Pedro Alves


  parent reply	other threads:[~2008-07-11 13:57 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-28 17:22 Vladimir Prus
2008-07-11 13:53 ` Daniel Jacobowitz
2008-07-11 19:07   ` Vladimir Prus
2008-07-11 13:57 ` Pedro Alves [this message]
2008-07-11 14:02   ` Daniel Jacobowitz
2008-07-13  5:34 ` 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=200807111456.40088.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