From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10496 invoked by alias); 11 Jul 2008 13:57:02 -0000 Received: (qmail 10485 invoked by uid 22791); 11 Jul 2008 13:57:01 -0000 X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.4) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 11 Jul 2008 13:56:42 +0000 Received: (qmail 7718 invoked from network); 11 Jul 2008 13:56:41 -0000 Received: from unknown (HELO orlando.local) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 11 Jul 2008 13:56:41 -0000 From: Pedro Alves To: gdb-patches@sourceware.org Subject: Re: [MI non-stop 10/11] Skip varobj in running threads. Date: Fri, 11 Jul 2008 13:57:00 -0000 User-Agent: KMail/1.9.9 Cc: Vladimir Prus References: <200806282100.06214.vladimir@codesourcery.com> In-Reply-To: <200806282100.06214.vladimir@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200807111456.40088.pedro@codesourcery.com> X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2008-07/txt/msg00203.txt.bz2 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