Rename common to gdbsupport
[deliverable/binutils-gdb.git] / gdb / mi / mi-cmd-var.c
index 38c59c7e66d877b597e45182ac6f64b95c0781a5..662ffa3f4d915c78fd7b3911907367cb8a8d52bd 100644 (file)
@@ -1,5 +1,5 @@
 /* MI Command Set - varobj commands.
-   Copyright (C) 2000-2018 Free Software Foundation, Inc.
+   Copyright (C) 2000-2019 Free Software Foundation, Inc.
 
    Contributed by Cygnus Solutions (a Red Hat company).
 
@@ -30,7 +30,8 @@
 #include "mi-getopt.h"
 #include "gdbthread.h"
 #include "mi-parse.h"
-#include "common/gdb_optional.h"
+#include "gdbsupport/gdb_optional.h"
+#include "inferior.h"
 
 extern unsigned int varobjdebug;               /* defined in varobj.c.  */
 
@@ -600,22 +601,21 @@ static void
 mi_cmd_var_update_iter (struct varobj *var, void *data_pointer)
 {
   struct mi_cmd_var_update *data = (struct mi_cmd_var_update *) data_pointer;
-  int thread_id, thread_stopped;
+  bool thread_stopped;
 
-  thread_id = varobj_get_thread_id (var);
+  int thread_id = varobj_get_thread_id (var);
 
-  if (thread_id == -1
-      && (ptid_equal (inferior_ptid, null_ptid)
-         || is_stopped (inferior_ptid)))
-    thread_stopped = 1;
+  if (thread_id == -1)
+    {
+      thread_stopped = (inferior_ptid == null_ptid
+                       || inferior_thread ()->state == THREAD_STOPPED);
+    }
   else
     {
-      struct thread_info *tp = find_thread_global_id (thread_id);
+      thread_info *tp = find_thread_global_id (thread_id);
 
-      if (tp)
-       thread_stopped = is_stopped (tp->ptid);
-      else
-       thread_stopped = 1;
+      thread_stopped = (tp == NULL
+                       || tp->state == THREAD_STOPPED);
     }
 
   if (thread_stopped
@@ -752,7 +752,7 @@ varobj_update_one (struct varobj *var, enum print_values print_values,
 
          for (varobj *child : r.newobj)
            {
-             ui_out_emit_tuple tuple_emitter (uiout, NULL);
+             ui_out_emit_tuple inner_tuple_emitter (uiout, NULL);
              print_varobj (child, print_values, 1 /* print_expression */);
            }
        }
This page took 0.026025 seconds and 4 git commands to generate.