mirror of
https://github.com/bminor/binutils-gdb.git
synced 2025-12-26 01:07:52 +00:00
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.
This commit is contained in:
10
gdb/top.c
10
gdb/top.c
@@ -1153,11 +1153,11 @@ void
|
||||
set_prompt (char *s)
|
||||
{
|
||||
/* ??rehrauer: I don't know why this fails, since it looks as though
|
||||
assignments to prompt are wrapped in calls to savestring...
|
||||
assignments to prompt are wrapped in calls to xstrdup...
|
||||
if (prompt != NULL)
|
||||
xfree (prompt);
|
||||
*/
|
||||
PROMPT (0) = savestring (s, strlen (s));
|
||||
PROMPT (0) = xstrdup (s);
|
||||
}
|
||||
|
||||
|
||||
@@ -1458,7 +1458,7 @@ init_history (void)
|
||||
|
||||
tmpenv = getenv ("GDBHISTFILE");
|
||||
if (tmpenv)
|
||||
history_filename = savestring (tmpenv, strlen (tmpenv));
|
||||
history_filename = xstrdup (tmpenv);
|
||||
else if (!history_filename)
|
||||
{
|
||||
/* We include the current directory so that if the user changes
|
||||
@@ -1516,13 +1516,13 @@ init_main (void)
|
||||
whatever the DEFAULT_PROMPT is. */
|
||||
the_prompts.top = 0;
|
||||
PREFIX (0) = "";
|
||||
PROMPT (0) = savestring (DEFAULT_PROMPT, strlen (DEFAULT_PROMPT));
|
||||
PROMPT (0) = xstrdup (DEFAULT_PROMPT);
|
||||
SUFFIX (0) = "";
|
||||
/* Set things up for annotation_level > 1, if the user ever decides
|
||||
to use it. */
|
||||
async_annotation_suffix = "prompt";
|
||||
/* Set the variable associated with the setshow prompt command. */
|
||||
new_async_prompt = savestring (PROMPT (0), strlen (PROMPT (0)));
|
||||
new_async_prompt = xstrdup (PROMPT (0));
|
||||
|
||||
/* If gdb was started with --annotate=2, this is equivalent to the
|
||||
user entering the command 'set annotate 2' at the gdb prompt, so
|
||||
|
||||
Reference in New Issue
Block a user