mirror of
https://github.com/bminor/binutils-gdb.git
synced 2025-12-26 09:08:59 +00:00
2008-10-03 Paul Pluzhnikov <ppluzhnikov@google.com>
* utils.c, defs.h (gdb_buildargv): New fn. Wrap buildargv and check for out-of-memory condition. * exec.c (exec_file_command): Call it. * infrun.c (handle_command, xdb_handle_command): Likewise. * interps.c (interpreter_exec_cmd): Likewise. * linux-nat.c (linux_nat_info_proc_cmd): Likewise. * procfs.c (info_proc_cmd): Likewise. * remote-mips.c (common_open): Likewise. * remote-sim.c (gdbsim_kill, gdbsim_create_inferior) (gdbsim_open): Likewise. * remote.c (extended_remote_run, remote_put_command) (remote_get_command, remote_delete_command): Likewise. * ser-mingw.c (pipe_windows_open): Likesise. * source.c (add_path, show_substitute_path_command) (unset_substitute_path_command, set_substitute_path_command): Likewise. * stack.c (backtrace_command): Likewise. * symfile.c (symbol_file_command, generic_load) (add_symbol_file_command): Likesise. * symmisc.c (maintenance_print_symbols, maintenance_print_psymbols) (maintenance_print_msymbols): Likewise.
This commit is contained in:
@@ -406,12 +406,13 @@ gdbsim_kill (void)
|
||||
static void
|
||||
gdbsim_load (char *args, int fromtty)
|
||||
{
|
||||
char **argv = buildargv (args);
|
||||
char **argv;
|
||||
char *prog;
|
||||
|
||||
if (argv == NULL)
|
||||
nomem (0);
|
||||
if (args == NULL)
|
||||
error_no_arg (_("program to load"));
|
||||
|
||||
argv = gdb_buildargv (args);
|
||||
make_cleanup_freeargv (argv);
|
||||
|
||||
prog = tilde_expand (argv[0]);
|
||||
@@ -472,7 +473,7 @@ gdbsim_create_inferior (char *exec_file, char *args, char **env, int from_tty)
|
||||
strcat (arg_buf, exec_file);
|
||||
strcat (arg_buf, " ");
|
||||
strcat (arg_buf, args);
|
||||
argv = buildargv (arg_buf);
|
||||
argv = gdb_buildargv (arg_buf);
|
||||
make_cleanup_freeargv (argv);
|
||||
}
|
||||
else
|
||||
@@ -546,9 +547,7 @@ gdbsim_open (char *args, int from_tty)
|
||||
strcat (arg_buf, " "); /* 1 */
|
||||
strcat (arg_buf, args);
|
||||
}
|
||||
argv = buildargv (arg_buf);
|
||||
if (argv == NULL)
|
||||
error (_("Insufficient memory available to allocate simulator arg list."));
|
||||
argv = gdb_buildargv (arg_buf);
|
||||
make_cleanup_freeargv (argv);
|
||||
|
||||
init_callbacks ();
|
||||
|
||||
Reference in New Issue
Block a user