diff options
author | Paul Pluzhnikov <ppluzhnikov@google.com> | 2008-10-03 16:36:10 +0000 |
---|---|---|
committer | Paul Pluzhnikov <ppluzhnikov@google.com> | 2008-10-03 16:36:10 +0000 |
commit | d1a41061438a7f29a40c7bb91435111a1b61b641 (patch) | |
tree | b378ea01b25b77f209a65dc3fc48db30b50f38f9 /gdb/remote.c | |
parent | 388853f746bee8a011fc076e798a7fd770f67fbe (diff) | |
download | gdb-d1a41061438a7f29a40c7bb91435111a1b61b641.zip gdb-d1a41061438a7f29a40c7bb91435111a1b61b641.tar.gz gdb-d1a41061438a7f29a40c7bb91435111a1b61b641.tar.bz2 |
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/remote.c')
-rw-r--r-- | gdb/remote.c | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/gdb/remote.c b/gdb/remote.c index 9dacd17..d7dc46b 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -5546,13 +5546,14 @@ extended_remote_run (char *args) error (_("Remote file name too long for run packet")); len += 2 * bin2hex ((gdb_byte *) remote_exec_file, rs->buf + len, 0); + gdb_assert (args != NULL); if (*args) { struct cleanup *back_to; int i; char **argv; - argv = buildargv (args); + argv = gdb_buildargv (args); back_to = make_cleanup ((void (*) (void *)) freeargv, argv); for (i = 0; argv[i] != NULL; i++) { @@ -7491,9 +7492,10 @@ remote_put_command (char *args, int from_tty) struct cleanup *back_to; char **argv; - argv = buildargv (args); - if (argv == NULL) - nomem (0); + if (args == NULL) + error_no_arg (_("file to put")); + + argv = gdb_buildargv (args); back_to = make_cleanup_freeargv (argv); if (argv[0] == NULL || argv[1] == NULL || argv[2] != NULL) error (_("Invalid parameters to remote put")); @@ -7509,9 +7511,10 @@ remote_get_command (char *args, int from_tty) struct cleanup *back_to; char **argv; - argv = buildargv (args); - if (argv == NULL) - nomem (0); + if (args == NULL) + error_no_arg (_("file to get")); + + argv = gdb_buildargv (args); back_to = make_cleanup_freeargv (argv); if (argv[0] == NULL || argv[1] == NULL || argv[2] != NULL) error (_("Invalid parameters to remote get")); @@ -7527,9 +7530,10 @@ remote_delete_command (char *args, int from_tty) struct cleanup *back_to; char **argv; - argv = buildargv (args); - if (argv == NULL) - nomem (0); + if (args == NULL) + error_no_arg (_("file to delete")); + + argv = gdb_buildargv (args); back_to = make_cleanup_freeargv (argv); if (argv[0] == NULL || argv[1] != NULL) error (_("Invalid parameters to remote delete")); |