From dbba82516a0ef15996744aff2bd7bbd19ee96a12 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Sun, 13 Jul 2008 05:31:44 +0000 Subject: [PATCH] Skip varobj in running threads. * mi/mi-cmd-var.c (mi_cmd_var_update): If varobj's thread is not stopped, skip the varobj. * Makefile.in: Update dependencies. --- gdb/ChangeLog | 7 +++++++ gdb/Makefile.in | 3 ++- gdb/mi/mi-cmd-var.c | 18 ++++++++++++++++-- 3 files changed, 25 insertions(+), 3 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 5e290c7e99e..8f16d1c9ec2 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,10 @@ +2008-07-13 Vladimir Prus + + Skip varobj in running threads. + * mi/mi-cmd-var.c (mi_cmd_var_update): If varobj's + thread is not stopped, skip the varobj. + * Makefile.in: Update dependencies. + 2008-07-13 Vladimir Prus Enable all commands while inferiour is running diff --git a/gdb/Makefile.in b/gdb/Makefile.in index 446d9673c1d..013d444ecde 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 0adcf1fd251..53c95da0747 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,21 @@ 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_stopped = 0; + if (thread_id == -1 && is_stopped (inferior_ptid)) + thread_stopped = 1; + else + { + struct thread_info *tp = find_thread_id (thread_id); + if (tp) + thread_stopped = is_stopped (tp->ptid); + else + thread_stopped = 1; + } + if (thread_stopped) + if (*name == '*' || varobj_floating_p (*cr)) + varobj_update_one (*cr, print_values, 0 /* implicit */); cr++; } do_cleanups (cleanup); -- 2.30.2