diff options
Diffstat (limited to 'gdb/varobj.c')
-rw-r--r-- | gdb/varobj.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/gdb/varobj.c b/gdb/varobj.c index 15eb90f..2a95c86 100644 --- a/gdb/varobj.c +++ b/gdb/varobj.c @@ -1955,7 +1955,7 @@ install_variable (struct varobj *var) error (_("Duplicate variable object name")); /* Add varobj to hash table. */ - newvl = xmalloc (sizeof (struct vlist)); + newvl = XNEW (struct vlist); newvl->next = *(varobj_table + index); newvl->var = var; *(varobj_table + index) = newvl; @@ -2113,7 +2113,7 @@ new_variable (void) { struct varobj *var; - var = (struct varobj *) xmalloc (sizeof (struct varobj)); + var = XNEW (struct varobj); var->name = NULL; var->path_expr = NULL; var->obj_name = NULL; @@ -2129,8 +2129,7 @@ new_variable (void) var->print_value = NULL; var->frozen = 0; var->not_fetched = 0; - var->dynamic - = (struct varobj_dynamic *) xmalloc (sizeof (struct varobj_dynamic)); + var->dynamic = XNEW (struct varobj_dynamic); var->dynamic->children_requested = 0; var->from = -1; var->to = -1; @@ -2148,7 +2147,7 @@ new_root_variable (void) { struct varobj *var = new_variable (); - var->root = (struct varobj_root *) xmalloc (sizeof (struct varobj_root)); + var->root = XNEW (struct varobj_root); var->root->lang_ops = NULL; var->root->exp = NULL; var->root->valid_block = NULL; @@ -2251,7 +2250,7 @@ cppush (struct cpstack **pstack, char *name) { struct cpstack *s; - s = (struct cpstack *) xmalloc (sizeof (struct cpstack)); + s = XNEW (struct cpstack); s->name = name; s->next = *pstack; *pstack = s; @@ -2792,10 +2791,7 @@ extern void _initialize_varobj (void); void _initialize_varobj (void) { - int sizeof_table = sizeof (struct vlist *) * VAROBJ_TABLE_SIZE; - - varobj_table = xmalloc (sizeof_table); - memset (varobj_table, 0, sizeof_table); + varobj_table = XCNEWVEC (struct vlist *, VAROBJ_TABLE_SIZE); add_setshow_zuinteger_cmd ("varobj", class_maintenance, &varobjdebug, |