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:
Paul Pluzhnikov 2008-10-03 16:36:10 +00:00
parent 388853f746
commit d1a4106143
16 changed files with 96 additions and 87 deletions

View file

@ -428,12 +428,9 @@ add_path (char *dirname, char **which_path, int parse_separators)
/* This will properly parse the space and tab separators
and any quotes that may exist. DIRNAME_SEPARATOR will
be dealt with later. */
argv = buildargv (dirname);
argv = gdb_buildargv (dirname);
make_cleanup_freeargv (argv);
if (argv == NULL)
nomem (0);
arg = argv[0];
}
else
@ -1813,7 +1810,7 @@ show_substitute_path_command (char *args, int from_tty)
char **argv;
char *from = NULL;
argv = buildargv (args);
argv = gdb_buildargv (args);
make_cleanup_freeargv (argv);
/* We expect zero or one argument. */
@ -1846,7 +1843,7 @@ static void
unset_substitute_path_command (char *args, int from_tty)
{
struct substitute_path_rule *rule = substitute_path_rules;
char **argv = buildargv (args);
char **argv = gdb_buildargv (args);
char *from = NULL;
int rule_found = 0;
@ -1899,7 +1896,7 @@ set_substitute_path_command (char *args, int from_tty)
char **argv;
struct substitute_path_rule *rule;
argv = buildargv (args);
argv = gdb_buildargv (args);
make_cleanup_freeargv (argv);
if (argv == NULL || argv[0] == NULL || argv [1] == NULL)