Index: gdb/nacl-manifest.c |
diff --git a/gdb/nacl-manifest.c b/gdb/nacl-manifest.c |
index f5b00b1e2b43d069a6766ddf4b422887f6723114..5627d269d7804bdd59956902ad584392c6e0fc04 100644 |
--- a/gdb/nacl-manifest.c |
+++ b/gdb/nacl-manifest.c |
@@ -341,13 +341,23 @@ nacl_irt_command (char *args, int from_tty) |
{ |
if (args) |
{ |
+ char **argv; |
+ struct cleanup *old_chain; |
char *nacl_irt_filename; |
- nacl_irt_filename = tilde_expand (args); |
+ |
+ argv = gdb_buildargv(args); |
+ old_chain = make_cleanup_freeargv(argv); |
+ if (*argv == NULL) |
+ error (_("No IRT file name was specified")); |
+ |
+ nacl_irt_filename = tilde_expand (*argv); |
+ make_cleanup(xfree, nacl_irt_filename); |
+ |
symbol_file_add (nacl_irt_filename, from_tty ? SYMFILE_VERBOSE : 0, |
NULL, OBJF_USERLOADED); |
- xfree (nacl_irt_filename); |
/* Recalculate frames. */ |
reinit_frame_cache (); |
+ do_cleanups(old_chain); |
} |
} |
@@ -369,12 +379,18 @@ nacl_manifest_command (char *args, int from_tty) |
{ |
if (args) |
{ |
- char *manifest_filename; |
+ char **argv; |
struct cleanup *old_chain; |
+ char *manifest_filename; |
struct json_manifest_reader r = { 0 }; |
- manifest_filename = tilde_expand (args); |
- old_chain = make_cleanup (xfree, manifest_filename); |
+ argv = gdb_buildargv (args); |
+ old_chain = make_cleanup_freeargv (argv); |
+ if (*argv == NULL) |
+ error (_("No manifest file name was specified")); |
+ |
+ manifest_filename = tilde_expand (*argv); |
+ make_cleanup (xfree, manifest_filename); |
r.file = fopen (manifest_filename, "r"); |
if (!r.file) |