diff options
Diffstat (limited to 'gdb/varobj.c')
-rw-r--r-- | gdb/varobj.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/gdb/varobj.c b/gdb/varobj.c index 54c2a02..e8556d7 100644 --- a/gdb/varobj.c +++ b/gdb/varobj.c @@ -461,7 +461,6 @@ varobj_create (char *objname, char *p; enum varobj_languages lang; struct value *value = NULL; - int expr_len; /* Parse and evaluate the expression, filling in as much of the variable's data as possible. */ @@ -512,10 +511,9 @@ varobj_create (char *objname, var->format = variable_default_display (var); var->root->valid_block = innermost_block; - expr_len = strlen (expression); - var->name = savestring (expression, expr_len); + var->name = xstrdup (expression); /* For a root var, the name and the expr are the same. */ - var->path_expr = savestring (expression, expr_len); + var->path_expr = xstrdup (expression); /* When the frame is different from the current frame, we must select the appropriate frame before parsing @@ -561,7 +559,7 @@ varobj_create (char *objname, if ((var != NULL) && (objname != NULL)) { - var->obj_name = savestring (objname, strlen (objname)); + var->obj_name = xstrdup (objname); /* If a varobj name is duplicated, the install will fail so we must clenup */ @@ -1765,8 +1763,7 @@ value_of_root (struct varobj **var_handle, int *type_changed) } else { - tmp_var->obj_name = - savestring (var->obj_name, strlen (var->obj_name)); + tmp_var->obj_name = xstrdup (var->obj_name); varobj_delete (var, NULL, 0); install_variable (tmp_var); @@ -2015,7 +2012,7 @@ c_number_of_children (struct varobj *var) static char * c_name_of_variable (struct varobj *parent) { - return savestring (parent->name, strlen (parent->name)); + return xstrdup (parent->name); } /* Return the value of element TYPE_INDEX of a structure @@ -2114,10 +2111,7 @@ c_describe_child (struct varobj *parent, int index, case TYPE_CODE_STRUCT: case TYPE_CODE_UNION: if (cname) - { - char *string = TYPE_FIELD_NAME (type, index); - *cname = savestring (string, strlen (string)); - } + *cname = xstrdup (TYPE_FIELD_NAME (type, index)); if (cvalue && value) { |