/* Now it's safe to re-add the breakpoints. */
breakpoint_re_set ();
+
+ /* Also, it's safe to re-add varobjs. */
+ varobj_re_set ();
}
}
clear_pc_function_cache ();
gdb::observers::new_objfile.notify (NULL);
- /* Varobj may refer to old symbols, perform a cleanup. */
- varobj_invalidate ();
-
/* Now that the various caches have been cleared, we can re_set
our breakpoints without risking it using stale data. */
if ((add_flags & SYMFILE_DEFER_BP_RESET) == 0)
# When reloading the symbol file, only the var for the global in the main
# executable is re-created.
mi_gdb_test "-var-update global_var" \
- "\\^done,changelist=\\\[{name=\"global_var\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"}\\\]" \
+ "\\^done,changelist=\\\[\\\]" \
"global_var recreated"
mi_gdb_test "-var-update global_shlib_var" \
"\\^done,changelist=\\\[{name=\"global_shlib_var\",in_scope=\"invalid\",has_more=\"0\"}\\\]" \
}
}
-/* Invalidate varobj VAR if it is tied to locals and re-create it if it is
- defined on globals. It is a helper for varobj_invalidate.
-
- This function is called after changing the symbol file, in this case the
- pointers to "struct type" stored by the varobj are no longer valid. All
- varobj must be either re-evaluated, or marked as invalid here. */
+/* Try to recreate the varobj VAR if it is a global or floating. This is a
+ helper function for varobj_re_set. */
static void
-varobj_invalidate_iter (struct varobj *var)
+varobj_re_set_iter (struct varobj *var)
{
- /* global and floating var must be re-evaluated. */
- if (var->root->floating || var->root->global)
+ /* Invalidated globals and floating var must be re-evaluated. */
+ if (var->root->global || var->root->floating)
{
struct varobj *tmp_var;
}
}
-/* Invalidate the varobjs that are tied to locals and re-create the ones that
- are defined on globals.
- Invalidated varobjs will be always printed in_scope="invalid". */
+/* See varobj.h. */
void
-varobj_invalidate (void)
+varobj_re_set (void)
{
- all_root_varobjs (varobj_invalidate_iter);
+ all_root_varobjs (varobj_re_set_iter);
}
/* Ensure that no varobj keep references to OBJFILE. */
extern std::vector<varobj_update_result>
varobj_update (struct varobj **varp, bool is_explicit);
-extern void varobj_invalidate (void);
+/* Try to recreate any global or floating varobj. This is called after
+ changing symbol files. */
+
+extern void varobj_re_set (void);
extern bool varobj_editable_p (const struct varobj *var);