Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(748)

Unified Diff: gdb/nacl-manifest.c

Issue 10837039: Allow to use quotes in nacl-manifest and nacl-irt commands. (Closed) Base URL: http://git.chromium.org/native_client/nacl-gdb.git@master
Patch Set: rename cleanup to old name Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698