From d1a41061438a7f29a40c7bb91435111a1b61b641 Mon Sep 17 00:00:00 2001 From: Paul Pluzhnikov Date: Fri, 3 Oct 2008 16:36:10 +0000 Subject: 2008-10-03 Paul Pluzhnikov * 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. --- gdb/interps.c | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) (limited to 'gdb/interps.c') diff --git a/gdb/interps.c b/gdb/interps.c index 3bb7811..73bc51c 100644 --- a/gdb/interps.c +++ b/gdb/interps.c @@ -371,20 +371,15 @@ interpreter_exec_cmd (char *args, int from_tty) unsigned int i; int old_quiet, use_quiet; - prules = buildargv (args); - if (prules == NULL) - { - error (_("unable to parse arguments")); - } + if (args == NULL) + error_no_arg (_("interpreter-exec command")); + + prules = gdb_buildargv (args); + make_cleanup_freeargv (prules); nrules = 0; - if (prules != NULL) - { - for (trule = prules; *trule != NULL; trule++) - { - nrules++; - } - } + for (trule = prules; *trule != NULL; trule++) + nrules++; if (nrules < 2) error (_("usage: interpreter-exec [ ... ]")); -- cgit v1.1