- struct varobj *var;
-
- var = (struct varobj *) xmalloc (sizeof (struct varobj));
- var->name = NULL;
- var->path_expr = NULL;
- var->obj_name = NULL;
- var->index = -1;
- var->type = NULL;
- var->value = NULL;
- var->num_children = -1;
- var->parent = NULL;
- var->children = NULL;
- var->format = 0;
- var->root = NULL;
- var->updated = 0;
- var->print_value = NULL;
- var->frozen = 0;
- var->not_fetched = 0;
- var->dynamic
- = (struct varobj_dynamic *) xmalloc (sizeof (struct varobj_dynamic));
- var->dynamic->children_requested = 0;
- var->from = -1;
- var->to = -1;
- var->dynamic->constructor = 0;
- var->dynamic->pretty_printer = 0;
- var->dynamic->child_iter = 0;
- var->dynamic->saved_item = 0;
-
- return var;
-}
-
-/* Allocate memory and initialize a new root variable. */
-static struct varobj *
-new_root_variable (void)
-{
- struct varobj *var = new_variable ();
-
- var->root = (struct varobj_root *) xmalloc (sizeof (struct varobj_root));
- var->root->lang_ops = NULL;
- var->root->exp = NULL;
- var->root->valid_block = NULL;
- var->root->frame = null_frame_id;
- var->root->floating = 0;
- var->root->rootvar = NULL;
- var->root->is_valid = 1;
-
- return var;