From 1b36a34b7a279d934ee183f3d97562d49b612cc5 Mon Sep 17 00:00:00 2001 From: Jan Kratochvil Date: Sat, 23 May 2009 16:17:18 +0000 Subject: gdb/ Replace the savestring calls by xstrdup calls where possible. * breakpoint.c (condition_command, set_raw_breakpoint) (create_catchpoint, update_breakpoint_locations): Replace the savestring calls by xstrdup calls where possible. * buildsym.c (start_subfile, patch_subfile_names, record_debugformat) (record_producer): Likewise. * coffread.c (coff_start_symtab, complete_symtab): Likewise. * corefile.c (set_gnutarget): Likewise. * dbxread.c (add_new_header_file): Likewise. * demangle.c (set_demangling_command, set_demangling_style): Likewise. * event-top.c (push_prompt, pop_prompt, command_line_handler) (set_async_prompt): Likewise. * infcmd.c (set_inferior_io_terminal, attach_command_post_wait): Likewise. * language.c (set_language_command, _initialize_language): Likewise. * linespec.c (decode_line_2): Likewise. * rs6000-nat.c (add_vmap): Likewise. * top.c (set_prompt, init_history, init_main): Likewise. * tracepoint.c (stringify_collection_list): Likewise. * varobj.c (varobj_create): Remove variable expr_len. Replace the savestring calls by xstrdup calls where possible. (value_of_root, c_name_of_variable, c_describe_child): Replace the savestring calls by xstrdup calls where possible. * xcoffread.c (complete_symtab): Likewise. * cli/cli-script.c (build_command_line, define_command): Likewise. * cli/cli-setshow.c (do_setshow_command): Likewise. --- gdb/cli/cli-script.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'gdb/cli/cli-script.c') diff --git a/gdb/cli/cli-script.c b/gdb/cli/cli-script.c index d17e67a..054ce90 100644 --- a/gdb/cli/cli-script.c +++ b/gdb/cli/cli-script.c @@ -94,7 +94,7 @@ build_command_line (enum command_control_type type, char *args) = (struct command_line **) xmalloc (sizeof (struct command_line *) * cmd->body_count); memset (cmd->body_list, 0, sizeof (struct command_line *) * cmd->body_count); - cmd->line = savestring (args, strlen (args)); + cmd->line = xstrdup (args); return cmd; } @@ -1384,7 +1384,7 @@ define_command (char *comname, int from_tty) } } - comname = savestring (comname, strlen (comname)); + comname = xstrdup (comname); /* If the rest of the commands will be case insensitive, this one should behave in the same manner. */ @@ -1400,7 +1400,7 @@ define_command (char *comname, int from_tty) newc = add_cmd (comname, class_user, user_defined_command, (c && c->class == class_user) - ? c->doc : savestring ("User-defined.", 13), list); + ? c->doc : xstrdup ("User-defined."), list); newc->user_commands = cmds; /* If this new command is a hook, then mark both commands as being -- cgit v1.1