(varobj_update): Ensure frame is restored when
authorNick Roberts <nickrob@snap.net.nz>
Fri, 8 Dec 2006 22:06:04 +0000 (22:06 +0000)
committerNick Roberts <nickrob@snap.net.nz>
Fri, 8 Dec 2006 22:06:04 +0000 (22:06 +0000)
variable object is out of scope.

gdb/varobj.c

index ae247c5c98f38eae24c1d34352a9206fdf32a4da..39760ad94628065328da8405ff2683af62f64e36 100644 (file)
@@ -1052,6 +1052,12 @@ varobj_update (struct varobj **varp, struct varobj ***changelist)
      has changed. */
   type_changed = 1;
   new = value_of_root (varp, &type_changed);
+
+  /* Restore selected frame */
+  fi = frame_find_by_id (old_fid);
+  if (fi)
+    select_frame (fi);
+
   if (new == NULL)
     {
       (*varp)->error = 1;
@@ -1147,11 +1153,6 @@ varobj_update (struct varobj **varp, struct varobj ***changelist)
       *(*changelist + changed) = NULL;
     }
 
-  /* Restore selected frame */
-  fi = frame_find_by_id (old_fid);
-  if (fi)
-    select_frame (fi);
-
   if (type_changed)
     return -2;
   else