From d9d63369dfd1b31e0eb89ce38d6be12cffdb7274 Mon Sep 17 00:00:00 2001 From: Caroline Tice Date: Tue, 7 Dec 2010 19:58:26 +0000 Subject: - Fix alias-building & resolving to properly handle optional arguments for command options. - Add logging for command resolution ('log enable lldb commands') - Fix alias resolution to properly handle commands that take raw input (resolve the alias, but don't muck up the raw arguments). Net result: Among other things, 'expr' command can now take strings with escaped characters and not have the command handling & alias resolution code muck up the escaped characters. E.g. 'expr printf ("\n\n\tHello there!")' should now work properly. Not working yet: Creating aliases with raw input for commands that take raw input. Working on that. e.g. 'command alias print_hi expr printf ("\n\tHi!")' does not work yet. llvm-svn: 121171 --- lldb/source/Commands/CommandObjectCommands.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'lldb/source/Commands/CommandObjectCommands.cpp') diff --git a/lldb/source/Commands/CommandObjectCommands.cpp b/lldb/source/Commands/CommandObjectCommands.cpp index ea4ae03939b..0ca50b0ff65 100644 --- a/lldb/source/Commands/CommandObjectCommands.cpp +++ b/lldb/source/Commands/CommandObjectCommands.cpp @@ -336,9 +336,11 @@ public: argc = args.GetArgumentCount(); for (size_t i = 0; i < argc; ++i) - if (strcmp (args.GetArgumentAtIndex (i), "") != 0) - option_arg_vector->push_back (OptionArgPair ("", - std::string (args.GetArgumentAtIndex (i)))); + if (strcmp (args.GetArgumentAtIndex (i), "") != 0) + option_arg_vector->push_back + (OptionArgPair ("", + OptionArgValue (-1, + std::string (args.GetArgumentAtIndex (i))))); } // Create the alias. -- cgit v1.2.3