diff options
author | Paul Pluzhnikov <ppluzhnikov@google.com> | 2008-10-03 16:36:07 +0000 |
---|---|---|
committer | Paul Pluzhnikov <ppluzhnikov@google.com> | 2008-10-03 16:36:07 +0000 |
commit | 5ac6c51a4987ba2a168aa025c0bb3a6b30c9ef0f (patch) | |
tree | 4f5d93a9516ce312e42fa882e91c771f3c65b04e /gdb/symfile.c | |
parent | 1a528656c56a81c26edd333d43fdb757700de276 (diff) | |
download | gdb-5ac6c51a4987ba2a168aa025c0bb3a6b30c9ef0f.tar.gz |
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.
Diffstat (limited to 'gdb/symfile.c')
-rw-r--r-- | gdb/symfile.c | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/gdb/symfile.c b/gdb/symfile.c index 92fa9da1ff7..d9aff2f1e1c 100644 --- a/gdb/symfile.c +++ b/gdb/symfile.c @@ -1483,14 +1483,11 @@ symbol_file_command (char *args, int from_tty) } else { - char **argv = buildargv (args); + char **argv = gdb_buildargv (args); int flags = OBJF_USERLOADED; struct cleanup *cleanups; char *name = NULL; - if (argv == NULL) - nomem (0); - cleanups = make_cleanup_freeargv (argv); while (*argv != NULL) { @@ -1924,11 +1921,10 @@ generic_load (char *args, int from_tty) make_cleanup (clear_memory_write_data, &cbdata.requests); - argv = buildargv (args); - - if (argv == NULL) - nomem(0); + if (args == NULL) + error_no_arg (_("file to load")); + argv = gdb_buildargv (args); make_cleanup_freeargv (argv); filename = tilde_expand (argv[0]); @@ -2117,12 +2113,9 @@ add_symbol_file_command (char *args, int from_tty) if (args == NULL) error (_("add-symbol-file takes a file name and an address")); - argv = buildargv (args); + argv = gdb_buildargv (args); make_cleanup_freeargv (argv); - if (argv == NULL) - nomem (0); - for (arg = argv[0], argcnt = 0; arg != NULL; arg = argv[++argcnt]) { /* Process the argument. */ |