CommandObjectCommands.cpp revision 44c841d68a439da13e3f170427675bff8c7f2731
1767af88aa617288e584afcfed055f7755e408542Jim Ingham//===-- CommandObjectSource.cpp ---------------------------------*- C++ -*-===// 2767af88aa617288e584afcfed055f7755e408542Jim Ingham// 3767af88aa617288e584afcfed055f7755e408542Jim Ingham// The LLVM Compiler Infrastructure 4767af88aa617288e584afcfed055f7755e408542Jim Ingham// 5767af88aa617288e584afcfed055f7755e408542Jim Ingham// This file is distributed under the University of Illinois Open Source 6767af88aa617288e584afcfed055f7755e408542Jim Ingham// License. See LICENSE.TXT for details. 7767af88aa617288e584afcfed055f7755e408542Jim Ingham// 8767af88aa617288e584afcfed055f7755e408542Jim Ingham//===----------------------------------------------------------------------===// 9767af88aa617288e584afcfed055f7755e408542Jim Ingham 10767af88aa617288e584afcfed055f7755e408542Jim Ingham#include "CommandObjectCommands.h" 11767af88aa617288e584afcfed055f7755e408542Jim Ingham 12767af88aa617288e584afcfed055f7755e408542Jim Ingham// C Includes 13767af88aa617288e584afcfed055f7755e408542Jim Ingham// C++ Includes 14767af88aa617288e584afcfed055f7755e408542Jim Ingham// Other libraries and framework includes 15767af88aa617288e584afcfed055f7755e408542Jim Ingham// Project includes 16767af88aa617288e584afcfed055f7755e408542Jim Ingham#include "lldb/Interpreter/Args.h" 17767af88aa617288e584afcfed055f7755e408542Jim Ingham#include "lldb/Core/Debugger.h" 18767af88aa617288e584afcfed055f7755e408542Jim Ingham#include "lldb/Interpreter/CommandInterpreter.h" 19767af88aa617288e584afcfed055f7755e408542Jim Ingham#include "lldb/Interpreter/CommandReturnObject.h" 20767af88aa617288e584afcfed055f7755e408542Jim Ingham#include "lldb/Interpreter/Options.h" 21767af88aa617288e584afcfed055f7755e408542Jim Ingham 22767af88aa617288e584afcfed055f7755e408542Jim Inghamusing namespace lldb; 23767af88aa617288e584afcfed055f7755e408542Jim Inghamusing namespace lldb_private; 24767af88aa617288e584afcfed055f7755e408542Jim Ingham 25767af88aa617288e584afcfed055f7755e408542Jim Inghamconst char *k_space_characters = "\t\n\v\f\r "; 26767af88aa617288e584afcfed055f7755e408542Jim Ingham 27767af88aa617288e584afcfed055f7755e408542Jim Ingham//------------------------------------------------------------------------- 28767af88aa617288e584afcfed055f7755e408542Jim Ingham// CommandObjectCommandsSource 29767af88aa617288e584afcfed055f7755e408542Jim Ingham//------------------------------------------------------------------------- 30767af88aa617288e584afcfed055f7755e408542Jim Ingham 31767af88aa617288e584afcfed055f7755e408542Jim Inghamclass CommandObjectCommandsSource : public CommandObject 32767af88aa617288e584afcfed055f7755e408542Jim Ingham{ 33767af88aa617288e584afcfed055f7755e408542Jim Inghampublic: 34238c0a1e7b733cee539258faa656159c63f9e893Greg Clayton CommandObjectCommandsSource(CommandInterpreter &interpreter) : 35238c0a1e7b733cee539258faa656159c63f9e893Greg Clayton CommandObject (interpreter, 36238c0a1e7b733cee539258faa656159c63f9e893Greg Clayton "commands source", 37238c0a1e7b733cee539258faa656159c63f9e893Greg Clayton "Read in debugger commands from the file <filename> and execute them.", 3843b014aa33e20e61790e16ed69a2c57aae2fbc6eCaroline Tice NULL) 39767af88aa617288e584afcfed055f7755e408542Jim Ingham { 4043b014aa33e20e61790e16ed69a2c57aae2fbc6eCaroline Tice CommandArgumentEntry arg; 4143b014aa33e20e61790e16ed69a2c57aae2fbc6eCaroline Tice CommandArgumentData file_arg; 4243b014aa33e20e61790e16ed69a2c57aae2fbc6eCaroline Tice 4343b014aa33e20e61790e16ed69a2c57aae2fbc6eCaroline Tice // Define the first (and only) variant of this arg. 4443b014aa33e20e61790e16ed69a2c57aae2fbc6eCaroline Tice file_arg.arg_type = eArgTypeFilename; 4543b014aa33e20e61790e16ed69a2c57aae2fbc6eCaroline Tice file_arg.arg_repetition = eArgRepeatPlain; 4643b014aa33e20e61790e16ed69a2c57aae2fbc6eCaroline Tice 4743b014aa33e20e61790e16ed69a2c57aae2fbc6eCaroline Tice // There is only one variant this argument could be; put it into the argument entry. 4843b014aa33e20e61790e16ed69a2c57aae2fbc6eCaroline Tice arg.push_back (file_arg); 4943b014aa33e20e61790e16ed69a2c57aae2fbc6eCaroline Tice 5043b014aa33e20e61790e16ed69a2c57aae2fbc6eCaroline Tice // Push the data for the first argument into the m_arguments vector. 5143b014aa33e20e61790e16ed69a2c57aae2fbc6eCaroline Tice m_arguments.push_back (arg); 52767af88aa617288e584afcfed055f7755e408542Jim Ingham } 53767af88aa617288e584afcfed055f7755e408542Jim Ingham 54767af88aa617288e584afcfed055f7755e408542Jim Ingham ~CommandObjectCommandsSource () 55767af88aa617288e584afcfed055f7755e408542Jim Ingham { 56767af88aa617288e584afcfed055f7755e408542Jim Ingham } 57767af88aa617288e584afcfed055f7755e408542Jim Ingham 58767af88aa617288e584afcfed055f7755e408542Jim Ingham bool 59767af88aa617288e584afcfed055f7755e408542Jim Ingham Execute 60767af88aa617288e584afcfed055f7755e408542Jim Ingham ( 61767af88aa617288e584afcfed055f7755e408542Jim Ingham Args& args, 62767af88aa617288e584afcfed055f7755e408542Jim Ingham CommandReturnObject &result 63767af88aa617288e584afcfed055f7755e408542Jim Ingham ) 64767af88aa617288e584afcfed055f7755e408542Jim Ingham { 65767af88aa617288e584afcfed055f7755e408542Jim Ingham const int argc = args.GetArgumentCount(); 66767af88aa617288e584afcfed055f7755e408542Jim Ingham if (argc == 1) 67767af88aa617288e584afcfed055f7755e408542Jim Ingham { 68767af88aa617288e584afcfed055f7755e408542Jim Ingham const char *filename = args.GetArgumentAtIndex(0); 69767af88aa617288e584afcfed055f7755e408542Jim Ingham bool success = true; 70767af88aa617288e584afcfed055f7755e408542Jim Ingham 71767af88aa617288e584afcfed055f7755e408542Jim Ingham result.AppendMessageWithFormat ("Executing commands in '%s'.\n", filename); 72767af88aa617288e584afcfed055f7755e408542Jim Ingham 73a83ea887f6165d59cfeac1bbb96011f3b0568af8Johnny Chen FileSpec cmd_file (filename, true); 74767af88aa617288e584afcfed055f7755e408542Jim Ingham if (cmd_file.Exists()) 75767af88aa617288e584afcfed055f7755e408542Jim Ingham { 76767af88aa617288e584afcfed055f7755e408542Jim Ingham STLStringArray commands; 77767af88aa617288e584afcfed055f7755e408542Jim Ingham success = cmd_file.ReadFileLines (commands); 78767af88aa617288e584afcfed055f7755e408542Jim Ingham 79767af88aa617288e584afcfed055f7755e408542Jim Ingham STLStringArray::iterator pos = commands.begin(); 80767af88aa617288e584afcfed055f7755e408542Jim Ingham 81767af88aa617288e584afcfed055f7755e408542Jim Ingham // Trim out any empty lines or lines that start with the comment 82767af88aa617288e584afcfed055f7755e408542Jim Ingham // char '#' 83767af88aa617288e584afcfed055f7755e408542Jim Ingham while (pos != commands.end()) 84767af88aa617288e584afcfed055f7755e408542Jim Ingham { 85767af88aa617288e584afcfed055f7755e408542Jim Ingham size_t non_space = pos->find_first_not_of (k_space_characters); 86a830adbcd63d1995a01e6e18da79893c1426ca43Greg Clayton // Check for empty line or comment line (lines whose first 87a830adbcd63d1995a01e6e18da79893c1426ca43Greg Clayton // non-space character is a '#') 88a830adbcd63d1995a01e6e18da79893c1426ca43Greg Clayton if (non_space == std::string::npos || (*pos)[non_space] == '#') 89767af88aa617288e584afcfed055f7755e408542Jim Ingham pos = commands.erase(pos); 90767af88aa617288e584afcfed055f7755e408542Jim Ingham else 91767af88aa617288e584afcfed055f7755e408542Jim Ingham ++pos; 92767af88aa617288e584afcfed055f7755e408542Jim Ingham } 93767af88aa617288e584afcfed055f7755e408542Jim Ingham 94767af88aa617288e584afcfed055f7755e408542Jim Ingham if (commands.size() > 0) 95767af88aa617288e584afcfed055f7755e408542Jim Ingham { 96767af88aa617288e584afcfed055f7755e408542Jim Ingham const size_t num_commands = commands.size(); 97767af88aa617288e584afcfed055f7755e408542Jim Ingham size_t i; 98767af88aa617288e584afcfed055f7755e408542Jim Ingham for (i = 0; i<num_commands; ++i) 99767af88aa617288e584afcfed055f7755e408542Jim Ingham { 100238c0a1e7b733cee539258faa656159c63f9e893Greg Clayton result.GetOutputStream().Printf ("%s %s\n", 101238c0a1e7b733cee539258faa656159c63f9e893Greg Clayton m_interpreter.GetPrompt(), 102238c0a1e7b733cee539258faa656159c63f9e893Greg Clayton commands[i].c_str()); 103238c0a1e7b733cee539258faa656159c63f9e893Greg Clayton if (!m_interpreter.HandleCommand(commands[i].c_str(), false, result)) 104767af88aa617288e584afcfed055f7755e408542Jim Ingham break; 105767af88aa617288e584afcfed055f7755e408542Jim Ingham } 106767af88aa617288e584afcfed055f7755e408542Jim Ingham 107767af88aa617288e584afcfed055f7755e408542Jim Ingham if (i < num_commands) 108767af88aa617288e584afcfed055f7755e408542Jim Ingham { 109767af88aa617288e584afcfed055f7755e408542Jim Ingham result.AppendErrorWithFormat("Aborting source of '%s' after command '%s' failed.\n", 110767af88aa617288e584afcfed055f7755e408542Jim Ingham filename, commands[i].c_str()); 111767af88aa617288e584afcfed055f7755e408542Jim Ingham result.SetStatus (eReturnStatusSuccessFinishResult); 112767af88aa617288e584afcfed055f7755e408542Jim Ingham } 113767af88aa617288e584afcfed055f7755e408542Jim Ingham else 114767af88aa617288e584afcfed055f7755e408542Jim Ingham { 115767af88aa617288e584afcfed055f7755e408542Jim Ingham success = true; 116767af88aa617288e584afcfed055f7755e408542Jim Ingham result.SetStatus (eReturnStatusFailed); 117767af88aa617288e584afcfed055f7755e408542Jim Ingham } 118767af88aa617288e584afcfed055f7755e408542Jim Ingham } 119767af88aa617288e584afcfed055f7755e408542Jim Ingham } 120767af88aa617288e584afcfed055f7755e408542Jim Ingham else 121767af88aa617288e584afcfed055f7755e408542Jim Ingham { 122767af88aa617288e584afcfed055f7755e408542Jim Ingham result.AppendErrorWithFormat ("File '%s' does not exist.\n", filename); 123767af88aa617288e584afcfed055f7755e408542Jim Ingham result.SetStatus (eReturnStatusFailed); 124767af88aa617288e584afcfed055f7755e408542Jim Ingham success = false; 125767af88aa617288e584afcfed055f7755e408542Jim Ingham } 126767af88aa617288e584afcfed055f7755e408542Jim Ingham 127767af88aa617288e584afcfed055f7755e408542Jim Ingham if (success) 128767af88aa617288e584afcfed055f7755e408542Jim Ingham { 129767af88aa617288e584afcfed055f7755e408542Jim Ingham result.SetStatus (eReturnStatusSuccessFinishNoResult); 130767af88aa617288e584afcfed055f7755e408542Jim Ingham } 131767af88aa617288e584afcfed055f7755e408542Jim Ingham } 132767af88aa617288e584afcfed055f7755e408542Jim Ingham else 133767af88aa617288e584afcfed055f7755e408542Jim Ingham { 134767af88aa617288e584afcfed055f7755e408542Jim Ingham result.AppendErrorWithFormat("'%s' takes exactly one executable filename argument.\n", GetCommandName()); 135767af88aa617288e584afcfed055f7755e408542Jim Ingham result.SetStatus (eReturnStatusFailed); 136767af88aa617288e584afcfed055f7755e408542Jim Ingham } 137767af88aa617288e584afcfed055f7755e408542Jim Ingham return result.Succeeded(); 138767af88aa617288e584afcfed055f7755e408542Jim Ingham 139767af88aa617288e584afcfed055f7755e408542Jim Ingham } 140767af88aa617288e584afcfed055f7755e408542Jim Ingham}; 141767af88aa617288e584afcfed055f7755e408542Jim Ingham 142767af88aa617288e584afcfed055f7755e408542Jim Ingham#pragma mark CommandObjectCommandsAlias 143767af88aa617288e584afcfed055f7755e408542Jim Ingham//------------------------------------------------------------------------- 144767af88aa617288e584afcfed055f7755e408542Jim Ingham// CommandObjectCommandsAlias 145767af88aa617288e584afcfed055f7755e408542Jim Ingham//------------------------------------------------------------------------- 146767af88aa617288e584afcfed055f7755e408542Jim Ingham 147767af88aa617288e584afcfed055f7755e408542Jim Inghamclass CommandObjectCommandsAlias : public CommandObject 148767af88aa617288e584afcfed055f7755e408542Jim Ingham{ 149767af88aa617288e584afcfed055f7755e408542Jim Inghampublic: 150238c0a1e7b733cee539258faa656159c63f9e893Greg Clayton CommandObjectCommandsAlias (CommandInterpreter &interpreter) : 151238c0a1e7b733cee539258faa656159c63f9e893Greg Clayton CommandObject (interpreter, 152238c0a1e7b733cee539258faa656159c63f9e893Greg Clayton "commands alias", 153abb507ae79e20ab2dd8365049921df73a24c95a5Caroline Tice "Allow users to define their own debugger command abbreviations.", 15443b014aa33e20e61790e16ed69a2c57aae2fbc6eCaroline Tice NULL) 155767af88aa617288e584afcfed055f7755e408542Jim Ingham { 156767af88aa617288e584afcfed055f7755e408542Jim Ingham SetHelpLong( 157767af88aa617288e584afcfed055f7755e408542Jim Ingham "'alias' allows the user to create a short-cut or abbreviation for long \n\ 158767af88aa617288e584afcfed055f7755e408542Jim Ingham commands, multi-word commands, and commands that take particular options. \n\ 159767af88aa617288e584afcfed055f7755e408542Jim Ingham Below are some simple examples of how one might use the 'alias' command: \n\ 16031fbb64aee1432672f776610e15466cbdc2f9795Caroline Tice \n 'commands alias sc script' // Creates the abbreviation 'sc' for the 'script' \n\ 16131fbb64aee1432672f776610e15466cbdc2f9795Caroline Tice // command. \n\ 16231fbb64aee1432672f776610e15466cbdc2f9795Caroline Tice 'commands alias bp breakpoint' // Creates the abbreviation 'bp' for the 'breakpoint' \n\ 16331fbb64aee1432672f776610e15466cbdc2f9795Caroline Tice // command. Since breakpoint commands are two-word \n\ 16431fbb64aee1432672f776610e15466cbdc2f9795Caroline Tice // commands, the user will still need to enter the \n\ 16531fbb64aee1432672f776610e15466cbdc2f9795Caroline Tice // second word after 'bp', e.g. 'bp enable' or \n\ 16631fbb64aee1432672f776610e15466cbdc2f9795Caroline Tice // 'bp delete'. \n\ 16731fbb64aee1432672f776610e15466cbdc2f9795Caroline Tice 'commands alias bpl breakpoint list' // Creates the abbreviation 'bpl' for the \n\ 16831fbb64aee1432672f776610e15466cbdc2f9795Caroline Tice // two-word command 'breakpoint list'. \n\ 169767af88aa617288e584afcfed055f7755e408542Jim Ingham \nAn alias can include some options for the command, with the values either \n\ 170767af88aa617288e584afcfed055f7755e408542Jim Ingham filled in at the time the alias is created, or specified as positional \n\ 171767af88aa617288e584afcfed055f7755e408542Jim Ingham arguments, to be filled in when the alias is invoked. The following example \n\ 172767af88aa617288e584afcfed055f7755e408542Jim Ingham shows how to create aliases with options: \n\ 173767af88aa617288e584afcfed055f7755e408542Jim Ingham \n\ 17431fbb64aee1432672f776610e15466cbdc2f9795Caroline Tice 'commands alias bfl breakpoint set -f %1 -l %2' \n\ 175767af88aa617288e584afcfed055f7755e408542Jim Ingham \nThis creates the abbreviation 'bfl' (for break-file-line), with the -f and -l \n\ 176767af88aa617288e584afcfed055f7755e408542Jim Ingham options already part of the alias. So if the user wants to set a breakpoint \n\ 177767af88aa617288e584afcfed055f7755e408542Jim Ingham by file and line without explicitly having to use the -f and -l options, the \n\ 178767af88aa617288e584afcfed055f7755e408542Jim Ingham user can now use 'bfl' instead. The '%1' and '%2' are positional placeholders \n\ 179767af88aa617288e584afcfed055f7755e408542Jim Ingham for the actual arguments that will be passed when the alias command is used. \n\ 180767af88aa617288e584afcfed055f7755e408542Jim Ingham The number in the placeholder refers to the position/order the actual value \n\ 181767af88aa617288e584afcfed055f7755e408542Jim Ingham occupies when the alias is used. So all the occurrences of '%1' in the alias \n\ 182767af88aa617288e584afcfed055f7755e408542Jim Ingham will be replaced with the first argument, all the occurrences of '%2' in the \n\ 183767af88aa617288e584afcfed055f7755e408542Jim Ingham alias will be replaced with the second argument, and so on. This also allows \n\ 184767af88aa617288e584afcfed055f7755e408542Jim Ingham actual arguments to be used multiple times within an alias (see 'process \n\ 185767af88aa617288e584afcfed055f7755e408542Jim Ingham launch' example below). So in the 'bfl' case, the actual file value will be \n\ 186767af88aa617288e584afcfed055f7755e408542Jim Ingham filled in with the first argument following 'bfl' and the actual line number \n\ 187767af88aa617288e584afcfed055f7755e408542Jim Ingham value will be filled in with the second argument. The user would use this \n\ 188767af88aa617288e584afcfed055f7755e408542Jim Ingham alias as follows: \n\ 18931fbb64aee1432672f776610e15466cbdc2f9795Caroline Tice \n (lldb) commands alias bfl breakpoint set -f %1 -l %2 \n\ 190a3aff73b5151c97b3adb1cea3022df967e33db45Sean Callanan <... some time later ...> \n\ 19131fbb64aee1432672f776610e15466cbdc2f9795Caroline Tice (lldb) bfl my-file.c 137 \n\ 192767af88aa617288e584afcfed055f7755e408542Jim Ingham \nThis would be the same as if the user had entered \n\ 193767af88aa617288e584afcfed055f7755e408542Jim Ingham 'breakpoint set -f my-file.c -l 137'. \n\ 194767af88aa617288e584afcfed055f7755e408542Jim Ingham \nAnother example: \n\ 19531fbb64aee1432672f776610e15466cbdc2f9795Caroline Tice \n (lldb) commands alias pltty process launch -s -o %1 -e %1 \n\ 19631fbb64aee1432672f776610e15466cbdc2f9795Caroline Tice (lldb) pltty /dev/tty0 \n\ 197a3aff73b5151c97b3adb1cea3022df967e33db45Sean Callanan // becomes 'process launch -s -o /dev/tty0 -e /dev/tty0' \n\ 198767af88aa617288e584afcfed055f7755e408542Jim Ingham \nIf the user always wanted to pass the same value to a particular option, the \n\ 199767af88aa617288e584afcfed055f7755e408542Jim Ingham alias could be defined with that value directly in the alias as a constant, \n\ 200767af88aa617288e584afcfed055f7755e408542Jim Ingham rather than using a positional placeholder: \n\ 201a3aff73b5151c97b3adb1cea3022df967e33db45Sean Callanan \n commands alias bl3 breakpoint set -f %1 -l 3 // Always sets a breakpoint on line \n\ 202a3aff73b5151c97b3adb1cea3022df967e33db45Sean Callanan // 3 of whatever file is indicated. \n"); 203767af88aa617288e584afcfed055f7755e408542Jim Ingham 20443b014aa33e20e61790e16ed69a2c57aae2fbc6eCaroline Tice CommandArgumentEntry arg1; 20543b014aa33e20e61790e16ed69a2c57aae2fbc6eCaroline Tice CommandArgumentEntry arg2; 20643b014aa33e20e61790e16ed69a2c57aae2fbc6eCaroline Tice CommandArgumentEntry arg3; 20743b014aa33e20e61790e16ed69a2c57aae2fbc6eCaroline Tice CommandArgumentData alias_arg; 20843b014aa33e20e61790e16ed69a2c57aae2fbc6eCaroline Tice CommandArgumentData cmd_arg; 20943b014aa33e20e61790e16ed69a2c57aae2fbc6eCaroline Tice CommandArgumentData options_arg; 21043b014aa33e20e61790e16ed69a2c57aae2fbc6eCaroline Tice 21143b014aa33e20e61790e16ed69a2c57aae2fbc6eCaroline Tice // Define the first (and only) variant of this arg. 21243b014aa33e20e61790e16ed69a2c57aae2fbc6eCaroline Tice alias_arg.arg_type = eArgTypeAliasName; 21343b014aa33e20e61790e16ed69a2c57aae2fbc6eCaroline Tice alias_arg.arg_repetition = eArgRepeatPlain; 21443b014aa33e20e61790e16ed69a2c57aae2fbc6eCaroline Tice 21543b014aa33e20e61790e16ed69a2c57aae2fbc6eCaroline Tice // There is only one variant this argument could be; put it into the argument entry. 21643b014aa33e20e61790e16ed69a2c57aae2fbc6eCaroline Tice arg1.push_back (alias_arg); 21743b014aa33e20e61790e16ed69a2c57aae2fbc6eCaroline Tice 21843b014aa33e20e61790e16ed69a2c57aae2fbc6eCaroline Tice // Define the first (and only) variant of this arg. 21943b014aa33e20e61790e16ed69a2c57aae2fbc6eCaroline Tice cmd_arg.arg_type = eArgTypeCommandName; 22043b014aa33e20e61790e16ed69a2c57aae2fbc6eCaroline Tice cmd_arg.arg_repetition = eArgRepeatPlain; 22143b014aa33e20e61790e16ed69a2c57aae2fbc6eCaroline Tice 22243b014aa33e20e61790e16ed69a2c57aae2fbc6eCaroline Tice // There is only one variant this argument could be; put it into the argument entry. 22343b014aa33e20e61790e16ed69a2c57aae2fbc6eCaroline Tice arg2.push_back (cmd_arg); 22443b014aa33e20e61790e16ed69a2c57aae2fbc6eCaroline Tice 22543b014aa33e20e61790e16ed69a2c57aae2fbc6eCaroline Tice // Define the first (and only) variant of this arg. 22643b014aa33e20e61790e16ed69a2c57aae2fbc6eCaroline Tice options_arg.arg_type = eArgTypeAliasOptions; 22743b014aa33e20e61790e16ed69a2c57aae2fbc6eCaroline Tice options_arg.arg_repetition = eArgRepeatOptional; 22843b014aa33e20e61790e16ed69a2c57aae2fbc6eCaroline Tice 22943b014aa33e20e61790e16ed69a2c57aae2fbc6eCaroline Tice // There is only one variant this argument could be; put it into the argument entry. 23043b014aa33e20e61790e16ed69a2c57aae2fbc6eCaroline Tice arg3.push_back (options_arg); 23143b014aa33e20e61790e16ed69a2c57aae2fbc6eCaroline Tice 23243b014aa33e20e61790e16ed69a2c57aae2fbc6eCaroline Tice // Push the data for the first argument into the m_arguments vector. 23343b014aa33e20e61790e16ed69a2c57aae2fbc6eCaroline Tice m_arguments.push_back (arg1); 23443b014aa33e20e61790e16ed69a2c57aae2fbc6eCaroline Tice m_arguments.push_back (arg2); 23543b014aa33e20e61790e16ed69a2c57aae2fbc6eCaroline Tice m_arguments.push_back (arg3); 236767af88aa617288e584afcfed055f7755e408542Jim Ingham } 237767af88aa617288e584afcfed055f7755e408542Jim Ingham 238767af88aa617288e584afcfed055f7755e408542Jim Ingham ~CommandObjectCommandsAlias () 239767af88aa617288e584afcfed055f7755e408542Jim Ingham { 240767af88aa617288e584afcfed055f7755e408542Jim Ingham } 241767af88aa617288e584afcfed055f7755e408542Jim Ingham 242767af88aa617288e584afcfed055f7755e408542Jim Ingham 243767af88aa617288e584afcfed055f7755e408542Jim Ingham bool 244767af88aa617288e584afcfed055f7755e408542Jim Ingham Execute 245767af88aa617288e584afcfed055f7755e408542Jim Ingham ( 246767af88aa617288e584afcfed055f7755e408542Jim Ingham Args& args, 247767af88aa617288e584afcfed055f7755e408542Jim Ingham CommandReturnObject &result 248767af88aa617288e584afcfed055f7755e408542Jim Ingham ) 249767af88aa617288e584afcfed055f7755e408542Jim Ingham { 2508bb61f099795a3fd98edf655c3e6899cd2668f6cCaroline Tice size_t argc = args.GetArgumentCount(); 251767af88aa617288e584afcfed055f7755e408542Jim Ingham 252767af88aa617288e584afcfed055f7755e408542Jim Ingham if (argc < 2) 25354e7afa84d945f9137f9372ecde432f9e1a702fcGreg Clayton { 254767af88aa617288e584afcfed055f7755e408542Jim Ingham result.AppendError ("'alias' requires at least two arguments"); 255767af88aa617288e584afcfed055f7755e408542Jim Ingham result.SetStatus (eReturnStatusFailed); 256767af88aa617288e584afcfed055f7755e408542Jim Ingham return false; 25754e7afa84d945f9137f9372ecde432f9e1a702fcGreg Clayton } 258767af88aa617288e584afcfed055f7755e408542Jim Ingham 259767af88aa617288e584afcfed055f7755e408542Jim Ingham const std::string alias_command = args.GetArgumentAtIndex(0); 260767af88aa617288e584afcfed055f7755e408542Jim Ingham const std::string actual_command = args.GetArgumentAtIndex(1); 261767af88aa617288e584afcfed055f7755e408542Jim Ingham 262767af88aa617288e584afcfed055f7755e408542Jim Ingham args.Shift(); // Shift the alias command word off the argument vector. 263767af88aa617288e584afcfed055f7755e408542Jim Ingham args.Shift(); // Shift the old command word off the argument vector. 264767af88aa617288e584afcfed055f7755e408542Jim Ingham 265767af88aa617288e584afcfed055f7755e408542Jim Ingham // Verify that the command is alias'able, and get the appropriate command object. 266767af88aa617288e584afcfed055f7755e408542Jim Ingham 267238c0a1e7b733cee539258faa656159c63f9e893Greg Clayton if (m_interpreter.CommandExists (alias_command.c_str())) 268767af88aa617288e584afcfed055f7755e408542Jim Ingham { 269767af88aa617288e584afcfed055f7755e408542Jim Ingham result.AppendErrorWithFormat ("'%s' is a permanent debugger command and cannot be redefined.\n", 270767af88aa617288e584afcfed055f7755e408542Jim Ingham alias_command.c_str()); 271767af88aa617288e584afcfed055f7755e408542Jim Ingham result.SetStatus (eReturnStatusFailed); 272767af88aa617288e584afcfed055f7755e408542Jim Ingham } 273767af88aa617288e584afcfed055f7755e408542Jim Ingham else 274767af88aa617288e584afcfed055f7755e408542Jim Ingham { 275238c0a1e7b733cee539258faa656159c63f9e893Greg Clayton CommandObjectSP command_obj_sp(m_interpreter.GetCommandSPExact (actual_command.c_str(), true)); 276767af88aa617288e584afcfed055f7755e408542Jim Ingham CommandObjectSP subcommand_obj_sp; 277767af88aa617288e584afcfed055f7755e408542Jim Ingham bool use_subcommand = false; 278767af88aa617288e584afcfed055f7755e408542Jim Ingham if (command_obj_sp.get()) 279767af88aa617288e584afcfed055f7755e408542Jim Ingham { 280767af88aa617288e584afcfed055f7755e408542Jim Ingham CommandObject *cmd_obj = command_obj_sp.get(); 28154e7afa84d945f9137f9372ecde432f9e1a702fcGreg Clayton CommandObject *sub_cmd_obj = NULL; 282767af88aa617288e584afcfed055f7755e408542Jim Ingham OptionArgVectorSP option_arg_vector_sp = OptionArgVectorSP (new OptionArgVector); 283767af88aa617288e584afcfed055f7755e408542Jim Ingham OptionArgVector *option_arg_vector = option_arg_vector_sp.get(); 284767af88aa617288e584afcfed055f7755e408542Jim Ingham 285767af88aa617288e584afcfed055f7755e408542Jim Ingham if (cmd_obj->IsMultiwordObject()) 286767af88aa617288e584afcfed055f7755e408542Jim Ingham { 287767af88aa617288e584afcfed055f7755e408542Jim Ingham if (argc >= 3) 288767af88aa617288e584afcfed055f7755e408542Jim Ingham { 289767af88aa617288e584afcfed055f7755e408542Jim Ingham const std::string sub_command = args.GetArgumentAtIndex(0); 290767af88aa617288e584afcfed055f7755e408542Jim Ingham assert (sub_command.length() != 0); 291767af88aa617288e584afcfed055f7755e408542Jim Ingham subcommand_obj_sp = 292767af88aa617288e584afcfed055f7755e408542Jim Ingham (((CommandObjectMultiword *) cmd_obj)->GetSubcommandSP (sub_command.c_str())); 293767af88aa617288e584afcfed055f7755e408542Jim Ingham if (subcommand_obj_sp.get()) 294767af88aa617288e584afcfed055f7755e408542Jim Ingham { 295767af88aa617288e584afcfed055f7755e408542Jim Ingham sub_cmd_obj = subcommand_obj_sp.get(); 296767af88aa617288e584afcfed055f7755e408542Jim Ingham use_subcommand = true; 297767af88aa617288e584afcfed055f7755e408542Jim Ingham args.Shift(); // Shift the sub_command word off the argument vector. 298767af88aa617288e584afcfed055f7755e408542Jim Ingham } 299767af88aa617288e584afcfed055f7755e408542Jim Ingham else 300767af88aa617288e584afcfed055f7755e408542Jim Ingham { 3015d53b621dea6a2ca6ece7528b22d089f864ae18fCaroline Tice result.AppendErrorWithFormat("'%s' is not a valid sub-command of '%s'. " 3025d53b621dea6a2ca6ece7528b22d089f864ae18fCaroline Tice "Unable to create alias.\n", 3035d53b621dea6a2ca6ece7528b22d089f864ae18fCaroline Tice sub_command.c_str(), actual_command.c_str()); 304767af88aa617288e584afcfed055f7755e408542Jim Ingham result.SetStatus (eReturnStatusFailed); 305767af88aa617288e584afcfed055f7755e408542Jim Ingham return false; 306767af88aa617288e584afcfed055f7755e408542Jim Ingham } 307767af88aa617288e584afcfed055f7755e408542Jim Ingham } 308767af88aa617288e584afcfed055f7755e408542Jim Ingham } 309767af88aa617288e584afcfed055f7755e408542Jim Ingham 310767af88aa617288e584afcfed055f7755e408542Jim Ingham // Verify & handle any options/arguments passed to the alias command 311767af88aa617288e584afcfed055f7755e408542Jim Ingham 312767af88aa617288e584afcfed055f7755e408542Jim Ingham if (args.GetArgumentCount () > 0) 313767af88aa617288e584afcfed055f7755e408542Jim Ingham { 314767af88aa617288e584afcfed055f7755e408542Jim Ingham if ((!use_subcommand && (cmd_obj->GetOptions() != NULL)) 315767af88aa617288e584afcfed055f7755e408542Jim Ingham || (use_subcommand && (sub_cmd_obj->GetOptions() != NULL))) 316767af88aa617288e584afcfed055f7755e408542Jim Ingham { 317767af88aa617288e584afcfed055f7755e408542Jim Ingham Options *options; 318767af88aa617288e584afcfed055f7755e408542Jim Ingham if (use_subcommand) 319767af88aa617288e584afcfed055f7755e408542Jim Ingham options = sub_cmd_obj->GetOptions(); 320767af88aa617288e584afcfed055f7755e408542Jim Ingham else 321767af88aa617288e584afcfed055f7755e408542Jim Ingham options = cmd_obj->GetOptions(); 322767af88aa617288e584afcfed055f7755e408542Jim Ingham options->ResetOptionValues (); 323767af88aa617288e584afcfed055f7755e408542Jim Ingham args.Unshift ("dummy_arg"); 324767af88aa617288e584afcfed055f7755e408542Jim Ingham args.ParseAliasOptions (*options, result, option_arg_vector); 325767af88aa617288e584afcfed055f7755e408542Jim Ingham args.Shift (); 326767af88aa617288e584afcfed055f7755e408542Jim Ingham if (result.Succeeded()) 327767af88aa617288e584afcfed055f7755e408542Jim Ingham options->VerifyPartialOptions (result); 3288bb61f099795a3fd98edf655c3e6899cd2668f6cCaroline Tice if (!result.Succeeded() && result.GetStatus() != lldb::eReturnStatusStarted) 3298bb61f099795a3fd98edf655c3e6899cd2668f6cCaroline Tice { 3308bb61f099795a3fd98edf655c3e6899cd2668f6cCaroline Tice result.AppendError ("Unable to create requested command alias.\n"); 331e6866a3819d68be21004ffdf773e36e7f00a6a26Caroline Tice return false; 3328bb61f099795a3fd98edf655c3e6899cd2668f6cCaroline Tice } 333767af88aa617288e584afcfed055f7755e408542Jim Ingham } 3348bb61f099795a3fd98edf655c3e6899cd2668f6cCaroline Tice 3358bb61f099795a3fd98edf655c3e6899cd2668f6cCaroline Tice // Anything remaining in args must be a plain argument. 3368bb61f099795a3fd98edf655c3e6899cd2668f6cCaroline Tice 3378bb61f099795a3fd98edf655c3e6899cd2668f6cCaroline Tice argc = args.GetArgumentCount(); 3388bb61f099795a3fd98edf655c3e6899cd2668f6cCaroline Tice for (size_t i = 0; i < argc; ++i) 33944c841d68a439da13e3f170427675bff8c7f2731Caroline Tice if (strcmp (args.GetArgumentAtIndex (i), "") != 0) 34044c841d68a439da13e3f170427675bff8c7f2731Caroline Tice option_arg_vector->push_back 34144c841d68a439da13e3f170427675bff8c7f2731Caroline Tice (OptionArgPair ("<argument>", 34244c841d68a439da13e3f170427675bff8c7f2731Caroline Tice OptionArgValue (-1, 34344c841d68a439da13e3f170427675bff8c7f2731Caroline Tice std::string (args.GetArgumentAtIndex (i))))); 344767af88aa617288e584afcfed055f7755e408542Jim Ingham } 345767af88aa617288e584afcfed055f7755e408542Jim Ingham 346767af88aa617288e584afcfed055f7755e408542Jim Ingham // Create the alias. 347767af88aa617288e584afcfed055f7755e408542Jim Ingham 348238c0a1e7b733cee539258faa656159c63f9e893Greg Clayton if (m_interpreter.AliasExists (alias_command.c_str()) 349238c0a1e7b733cee539258faa656159c63f9e893Greg Clayton || m_interpreter.UserCommandExists (alias_command.c_str())) 350767af88aa617288e584afcfed055f7755e408542Jim Ingham { 351238c0a1e7b733cee539258faa656159c63f9e893Greg Clayton OptionArgVectorSP tmp_option_arg_sp (m_interpreter.GetAliasOptions (alias_command.c_str())); 352767af88aa617288e584afcfed055f7755e408542Jim Ingham if (tmp_option_arg_sp.get()) 353767af88aa617288e584afcfed055f7755e408542Jim Ingham { 354767af88aa617288e584afcfed055f7755e408542Jim Ingham if (option_arg_vector->size() == 0) 355238c0a1e7b733cee539258faa656159c63f9e893Greg Clayton m_interpreter.RemoveAliasOptions (alias_command.c_str()); 356767af88aa617288e584afcfed055f7755e408542Jim Ingham } 357767af88aa617288e584afcfed055f7755e408542Jim Ingham result.AppendWarningWithFormat ("Overwriting existing definition for '%s'.\n", 358767af88aa617288e584afcfed055f7755e408542Jim Ingham alias_command.c_str()); 359767af88aa617288e584afcfed055f7755e408542Jim Ingham } 360767af88aa617288e584afcfed055f7755e408542Jim Ingham 361767af88aa617288e584afcfed055f7755e408542Jim Ingham if (use_subcommand) 362238c0a1e7b733cee539258faa656159c63f9e893Greg Clayton m_interpreter.AddAlias (alias_command.c_str(), subcommand_obj_sp); 363767af88aa617288e584afcfed055f7755e408542Jim Ingham else 364238c0a1e7b733cee539258faa656159c63f9e893Greg Clayton m_interpreter.AddAlias (alias_command.c_str(), command_obj_sp); 365767af88aa617288e584afcfed055f7755e408542Jim Ingham if (option_arg_vector->size() > 0) 366238c0a1e7b733cee539258faa656159c63f9e893Greg Clayton m_interpreter.AddOrReplaceAliasOptions (alias_command.c_str(), option_arg_vector_sp); 367767af88aa617288e584afcfed055f7755e408542Jim Ingham result.SetStatus (eReturnStatusSuccessFinishNoResult); 368767af88aa617288e584afcfed055f7755e408542Jim Ingham } 369767af88aa617288e584afcfed055f7755e408542Jim Ingham else 370767af88aa617288e584afcfed055f7755e408542Jim Ingham { 371767af88aa617288e584afcfed055f7755e408542Jim Ingham result.AppendErrorWithFormat ("'%s' is not an existing command.\n", actual_command.c_str()); 372767af88aa617288e584afcfed055f7755e408542Jim Ingham result.SetStatus (eReturnStatusFailed); 373e6866a3819d68be21004ffdf773e36e7f00a6a26Caroline Tice return false; 374767af88aa617288e584afcfed055f7755e408542Jim Ingham } 375767af88aa617288e584afcfed055f7755e408542Jim Ingham } 376767af88aa617288e584afcfed055f7755e408542Jim Ingham 377767af88aa617288e584afcfed055f7755e408542Jim Ingham return result.Succeeded(); 378767af88aa617288e584afcfed055f7755e408542Jim Ingham } 379767af88aa617288e584afcfed055f7755e408542Jim Ingham}; 380767af88aa617288e584afcfed055f7755e408542Jim Ingham 381767af88aa617288e584afcfed055f7755e408542Jim Ingham#pragma mark CommandObjectCommandsUnalias 382767af88aa617288e584afcfed055f7755e408542Jim Ingham//------------------------------------------------------------------------- 383767af88aa617288e584afcfed055f7755e408542Jim Ingham// CommandObjectCommandsUnalias 384767af88aa617288e584afcfed055f7755e408542Jim Ingham//------------------------------------------------------------------------- 385767af88aa617288e584afcfed055f7755e408542Jim Ingham 386767af88aa617288e584afcfed055f7755e408542Jim Inghamclass CommandObjectCommandsUnalias : public CommandObject 387767af88aa617288e584afcfed055f7755e408542Jim Ingham{ 388767af88aa617288e584afcfed055f7755e408542Jim Inghampublic: 389238c0a1e7b733cee539258faa656159c63f9e893Greg Clayton CommandObjectCommandsUnalias (CommandInterpreter &interpreter) : 390238c0a1e7b733cee539258faa656159c63f9e893Greg Clayton CommandObject (interpreter, 391238c0a1e7b733cee539258faa656159c63f9e893Greg Clayton "commands unalias", 392146292c83470680b98a4e4046428e0849e1ffe8fCaroline Tice "Allow the user to remove/delete a user-defined command abbreviation.", 39343b014aa33e20e61790e16ed69a2c57aae2fbc6eCaroline Tice NULL) 394767af88aa617288e584afcfed055f7755e408542Jim Ingham { 39543b014aa33e20e61790e16ed69a2c57aae2fbc6eCaroline Tice CommandArgumentEntry arg; 39643b014aa33e20e61790e16ed69a2c57aae2fbc6eCaroline Tice CommandArgumentData alias_arg; 39743b014aa33e20e61790e16ed69a2c57aae2fbc6eCaroline Tice 39843b014aa33e20e61790e16ed69a2c57aae2fbc6eCaroline Tice // Define the first (and only) variant of this arg. 39943b014aa33e20e61790e16ed69a2c57aae2fbc6eCaroline Tice alias_arg.arg_type = eArgTypeAliasName; 40043b014aa33e20e61790e16ed69a2c57aae2fbc6eCaroline Tice alias_arg.arg_repetition = eArgRepeatPlain; 40143b014aa33e20e61790e16ed69a2c57aae2fbc6eCaroline Tice 40243b014aa33e20e61790e16ed69a2c57aae2fbc6eCaroline Tice // There is only one variant this argument could be; put it into the argument entry. 40343b014aa33e20e61790e16ed69a2c57aae2fbc6eCaroline Tice arg.push_back (alias_arg); 40443b014aa33e20e61790e16ed69a2c57aae2fbc6eCaroline Tice 40543b014aa33e20e61790e16ed69a2c57aae2fbc6eCaroline Tice // Push the data for the first argument into the m_arguments vector. 40643b014aa33e20e61790e16ed69a2c57aae2fbc6eCaroline Tice m_arguments.push_back (arg); 407767af88aa617288e584afcfed055f7755e408542Jim Ingham } 408767af88aa617288e584afcfed055f7755e408542Jim Ingham 409767af88aa617288e584afcfed055f7755e408542Jim Ingham ~CommandObjectCommandsUnalias() 410767af88aa617288e584afcfed055f7755e408542Jim Ingham { 411767af88aa617288e584afcfed055f7755e408542Jim Ingham } 412767af88aa617288e584afcfed055f7755e408542Jim Ingham 413767af88aa617288e584afcfed055f7755e408542Jim Ingham 414767af88aa617288e584afcfed055f7755e408542Jim Ingham bool 415767af88aa617288e584afcfed055f7755e408542Jim Ingham Execute 416767af88aa617288e584afcfed055f7755e408542Jim Ingham ( 417767af88aa617288e584afcfed055f7755e408542Jim Ingham Args& args, 418767af88aa617288e584afcfed055f7755e408542Jim Ingham CommandReturnObject &result 419767af88aa617288e584afcfed055f7755e408542Jim Ingham ) 420767af88aa617288e584afcfed055f7755e408542Jim Ingham { 421767af88aa617288e584afcfed055f7755e408542Jim Ingham CommandObject::CommandMap::iterator pos; 422767af88aa617288e584afcfed055f7755e408542Jim Ingham CommandObject *cmd_obj; 423767af88aa617288e584afcfed055f7755e408542Jim Ingham 424767af88aa617288e584afcfed055f7755e408542Jim Ingham if (args.GetArgumentCount() != 0) 425767af88aa617288e584afcfed055f7755e408542Jim Ingham { 426767af88aa617288e584afcfed055f7755e408542Jim Ingham const char *command_name = args.GetArgumentAtIndex(0); 427238c0a1e7b733cee539258faa656159c63f9e893Greg Clayton cmd_obj = m_interpreter.GetCommandObject(command_name); 428767af88aa617288e584afcfed055f7755e408542Jim Ingham if (cmd_obj) 429767af88aa617288e584afcfed055f7755e408542Jim Ingham { 430238c0a1e7b733cee539258faa656159c63f9e893Greg Clayton if (m_interpreter.CommandExists (command_name)) 431767af88aa617288e584afcfed055f7755e408542Jim Ingham { 432767af88aa617288e584afcfed055f7755e408542Jim Ingham result.AppendErrorWithFormat ("'%s' is a permanent debugger command and cannot be removed.\n", 433767af88aa617288e584afcfed055f7755e408542Jim Ingham command_name); 434767af88aa617288e584afcfed055f7755e408542Jim Ingham result.SetStatus (eReturnStatusFailed); 435767af88aa617288e584afcfed055f7755e408542Jim Ingham } 436767af88aa617288e584afcfed055f7755e408542Jim Ingham else 437767af88aa617288e584afcfed055f7755e408542Jim Ingham { 438767af88aa617288e584afcfed055f7755e408542Jim Ingham 439238c0a1e7b733cee539258faa656159c63f9e893Greg Clayton if (m_interpreter.RemoveAlias (command_name) == false) 440767af88aa617288e584afcfed055f7755e408542Jim Ingham { 441238c0a1e7b733cee539258faa656159c63f9e893Greg Clayton if (m_interpreter.AliasExists (command_name)) 442767af88aa617288e584afcfed055f7755e408542Jim Ingham result.AppendErrorWithFormat ("Error occurred while attempting to unalias '%s'.\n", 443767af88aa617288e584afcfed055f7755e408542Jim Ingham command_name); 444767af88aa617288e584afcfed055f7755e408542Jim Ingham else 445767af88aa617288e584afcfed055f7755e408542Jim Ingham result.AppendErrorWithFormat ("'%s' is not an existing alias.\n", command_name); 446767af88aa617288e584afcfed055f7755e408542Jim Ingham result.SetStatus (eReturnStatusFailed); 447767af88aa617288e584afcfed055f7755e408542Jim Ingham } 448767af88aa617288e584afcfed055f7755e408542Jim Ingham else 449767af88aa617288e584afcfed055f7755e408542Jim Ingham result.SetStatus (eReturnStatusSuccessFinishNoResult); 450767af88aa617288e584afcfed055f7755e408542Jim Ingham } 451767af88aa617288e584afcfed055f7755e408542Jim Ingham } 452767af88aa617288e584afcfed055f7755e408542Jim Ingham else 453767af88aa617288e584afcfed055f7755e408542Jim Ingham { 454767af88aa617288e584afcfed055f7755e408542Jim Ingham result.AppendErrorWithFormat ("'%s' is not a known command.\nTry 'help' to see a " 455767af88aa617288e584afcfed055f7755e408542Jim Ingham "current list of commands.\n", 456767af88aa617288e584afcfed055f7755e408542Jim Ingham command_name); 457767af88aa617288e584afcfed055f7755e408542Jim Ingham result.SetStatus (eReturnStatusFailed); 458767af88aa617288e584afcfed055f7755e408542Jim Ingham } 459767af88aa617288e584afcfed055f7755e408542Jim Ingham } 460767af88aa617288e584afcfed055f7755e408542Jim Ingham else 461767af88aa617288e584afcfed055f7755e408542Jim Ingham { 462767af88aa617288e584afcfed055f7755e408542Jim Ingham result.AppendError ("must call 'unalias' with a valid alias"); 463767af88aa617288e584afcfed055f7755e408542Jim Ingham result.SetStatus (eReturnStatusFailed); 464767af88aa617288e584afcfed055f7755e408542Jim Ingham } 465767af88aa617288e584afcfed055f7755e408542Jim Ingham 466767af88aa617288e584afcfed055f7755e408542Jim Ingham return result.Succeeded(); 467767af88aa617288e584afcfed055f7755e408542Jim Ingham } 468767af88aa617288e584afcfed055f7755e408542Jim Ingham}; 469767af88aa617288e584afcfed055f7755e408542Jim Ingham 470767af88aa617288e584afcfed055f7755e408542Jim Ingham#pragma mark CommandObjectMultiwordCommands 471767af88aa617288e584afcfed055f7755e408542Jim Ingham 472767af88aa617288e584afcfed055f7755e408542Jim Ingham//------------------------------------------------------------------------- 473767af88aa617288e584afcfed055f7755e408542Jim Ingham// CommandObjectMultiwordCommands 474767af88aa617288e584afcfed055f7755e408542Jim Ingham//------------------------------------------------------------------------- 475767af88aa617288e584afcfed055f7755e408542Jim Ingham 476767af88aa617288e584afcfed055f7755e408542Jim InghamCommandObjectMultiwordCommands::CommandObjectMultiwordCommands (CommandInterpreter &interpreter) : 477238c0a1e7b733cee539258faa656159c63f9e893Greg Clayton CommandObjectMultiword (interpreter, 478238c0a1e7b733cee539258faa656159c63f9e893Greg Clayton "commands", 479c1ad82eb979ee856b86aec6e2acb7bddf75f7c4fCaroline Tice "A set of commands for managing or customizing the debugger commands.", 480767af88aa617288e584afcfed055f7755e408542Jim Ingham "commands <subcommand> [<subcommand-options>]") 481767af88aa617288e584afcfed055f7755e408542Jim Ingham{ 482238c0a1e7b733cee539258faa656159c63f9e893Greg Clayton LoadSubCommand ("source", CommandObjectSP (new CommandObjectCommandsSource (interpreter))); 483238c0a1e7b733cee539258faa656159c63f9e893Greg Clayton LoadSubCommand ("alias", CommandObjectSP (new CommandObjectCommandsAlias (interpreter))); 484238c0a1e7b733cee539258faa656159c63f9e893Greg Clayton LoadSubCommand ("unalias", CommandObjectSP (new CommandObjectCommandsUnalias (interpreter))); 485767af88aa617288e584afcfed055f7755e408542Jim Ingham} 486767af88aa617288e584afcfed055f7755e408542Jim Ingham 487767af88aa617288e584afcfed055f7755e408542Jim InghamCommandObjectMultiwordCommands::~CommandObjectMultiwordCommands () 488767af88aa617288e584afcfed055f7755e408542Jim Ingham{ 489767af88aa617288e584afcfed055f7755e408542Jim Ingham} 490767af88aa617288e584afcfed055f7755e408542Jim Ingham 491