From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30508 invoked by alias); 28 Jun 2008 17:00:45 -0000 Received: (qmail 30468 invoked by uid 22791); 28 Jun 2008 17:00:42 -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; Sat, 28 Jun 2008 17:00:08 +0000 Received: (qmail 11510 invoked from network); 28 Jun 2008 17:00:05 -0000 Received: from unknown (HELO 172.16.unknown.plus.ru) (vladimir@127.0.0.2) by mail.codesourcery.com with ESMTPA; 28 Jun 2008 17:00:05 -0000 From: Vladimir Prus Date: Sat, 28 Jun 2008 17:22:00 -0000 Subject: [MI non-stop 10/11] Skip varobj in running threads. To: gdb-patches@sources.redhat.com X-TUID: 467a1f17e72583c3 X-Length: 2374 X-UID: 269 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200806282100.06214.vladimir@codesourcery.com> 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-06/txt/msg00549.txt.bz2 If a variable object is bound to a specific thread, and we're doing -var-update * and varobj's thread is running, we cannot update varobj -- so we skip it. Will commit when core non-stop is in. - Volodya * mi/mi-cmd-var.c (mi_cmd_var_update): If varobj's thread is running, skip the varobj. * Makefile.in: Update dependencies. --- gdb/Makefile.in | 3 ++- gdb/mi/mi-cmd-var.c | 16 ++++++++++++++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/gdb/Makefile.in b/gdb/Makefile.in index 779b99a..ceff555 100644 --- a/gdb/Makefile.in +++ b/gdb/Makefile.in @@ -3256,7 +3256,8 @@ mi-cmd-target.o: $(srcdir)/mi/mi-cmd-target.c $(defs_h) $(mi_cmds_h) \ $(mi_getopt_h) $(remote_h) $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-cmd-target.c mi-cmd-var.o: $(srcdir)/mi/mi-cmd-var.c $(defs_h) $(mi_cmds_h) $(ui_out_h) \ - $(mi_out_h) $(varobj_h) $(value_h) $(gdb_string_h) $(mi_getopt_h) + $(mi_out_h) $(varobj_h) $(value_h) $(gdb_string_h) $(mi_getopt_h) \ + $(gdbthread_h) $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-cmd-var.c mi-console.o: $(srcdir)/mi/mi-console.c $(defs_h) $(mi_console_h) \ $(gdb_string_h) diff --git a/gdb/mi/mi-cmd-var.c b/gdb/mi/mi-cmd-var.c index 0adcf1f..d348cb5 100644 --- a/gdb/mi/mi-cmd-var.c +++ b/gdb/mi/mi-cmd-var.c @@ -29,6 +29,7 @@ #include #include "gdb_string.h" #include "mi-getopt.h" +#include "gdbthread.h" 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 */); cr++; } do_cleanups (cleanup); -- 1.5.3.5