diff options
author | emaste <emaste@FreeBSD.org> | 2014-03-19 13:11:35 +0000 |
---|---|---|
committer | emaste <emaste@FreeBSD.org> | 2014-03-19 13:11:35 +0000 |
commit | 958843c32b7a29741f2e45996b5b3e89f9e108b0 (patch) | |
tree | 95ae4ffabc848a86b94be3ad3cd42471cdb66b06 /contrib/llvm/tools/lldb/source/Interpreter/CommandInterpreter.cpp | |
parent | 2a9993c246f3a2463ccd6b8786781e5b97a35065 (diff) | |
download | FreeBSD-src-958843c32b7a29741f2e45996b5b3e89f9e108b0.zip FreeBSD-src-958843c32b7a29741f2e45996b5b3e89f9e108b0.tar.gz |
MFC r258054: Update LLDB to upstream r194122 snapshot
Inludes minor changes relative to upstream, for compatibility with
FreeBSD's in-tree LLVM 3.3:
- Reverted LLDB r191806, restoring use of previous API.
- Reverted part of LLDB r189317, restoring previous enum names.
- Work around missing LLVM r192504, using previous registerEHFrames API
(limited functionality).
- Removed PlatformWindows header include and init/terminate calls.
Sponsored by: DARPA, AFRL
Diffstat (limited to 'contrib/llvm/tools/lldb/source/Interpreter/CommandInterpreter.cpp')
-rw-r--r-- | contrib/llvm/tools/lldb/source/Interpreter/CommandInterpreter.cpp | 43 |
1 files changed, 34 insertions, 9 deletions
diff --git a/contrib/llvm/tools/lldb/source/Interpreter/CommandInterpreter.cpp b/contrib/llvm/tools/lldb/source/Interpreter/CommandInterpreter.cpp index db2f2fa..794cc71 100644 --- a/contrib/llvm/tools/lldb/source/Interpreter/CommandInterpreter.cpp +++ b/contrib/llvm/tools/lldb/source/Interpreter/CommandInterpreter.cpp @@ -11,8 +11,6 @@ #include <string> #include <vector> - -#include <getopt.h> #include <stdlib.h> #include "CommandObjectScript.h" @@ -230,6 +228,13 @@ CommandInterpreter::Initialize () AddAlias ("t", cmd_obj_sp); } + cmd_obj_sp = GetCommandSPExact ("_regexp-jump",false); + if (cmd_obj_sp) + { + AddAlias ("j", cmd_obj_sp); + AddAlias ("jump", cmd_obj_sp); + } + cmd_obj_sp = GetCommandSPExact ("_regexp-list", false); if (cmd_obj_sp) { @@ -318,7 +323,7 @@ CommandInterpreter::Initialize () #if defined (__arm__) ProcessAliasOptionsArgs (cmd_obj_sp, "--", alias_arguments_vector_sp); #else - ProcessAliasOptionsArgs (cmd_obj_sp, "--shell=/bin/bash --", alias_arguments_vector_sp); + ProcessAliasOptionsArgs (cmd_obj_sp, "--shell=" LLDB_DEFAULT_SHELL " --", alias_arguments_vector_sp); #endif AddAlias ("r", cmd_obj_sp); AddAlias ("run", cmd_obj_sp); @@ -587,7 +592,7 @@ CommandInterpreter::LoadCommandDictionary () list_regex_cmd_ap(new CommandObjectRegexCommand (*this, "_regexp-list", "Implements the GDB 'list' command in all of its forms except FILE:FUNCTION and maps them to the appropriate 'source list' commands.", - "_regexp-list [<line>]\n_regexp-attach [<file>:<line>]\n_regexp-attach [<file>:<line>]", + "_regexp-list [<line>]\n_regexp-list [<file>:<line>]\n_regexp-list [<file>:<line>]", 2, CommandCompletions::eSourceFileCompletion)); if (list_regex_cmd_ap.get()) @@ -620,6 +625,26 @@ CommandInterpreter::LoadCommandDictionary () } } + std::unique_ptr<CommandObjectRegexCommand> + jump_regex_cmd_ap(new CommandObjectRegexCommand (*this, + "_regexp-jump", + "Sets the program counter to a new address.", + "_regexp-jump [<line>]\n" + "_regexp-jump [<+-lineoffset>]\n" + "_regexp-jump [<file>:<line>]\n" + "_regexp-jump [*<addr>]\n", 2)); + if (jump_regex_cmd_ap.get()) + { + if (jump_regex_cmd_ap->AddRegexCommand("^\\*(.*)$", "thread jump --addr %1") && + jump_regex_cmd_ap->AddRegexCommand("^([0-9]+)$", "thread jump --line %1") && + jump_regex_cmd_ap->AddRegexCommand("^([^:]+):([0-9]+)$", "thread jump --file %1 --line %2") && + jump_regex_cmd_ap->AddRegexCommand("^([+\\-][0-9]+)$", "thread jump --by %1")) + { + CommandObjectSP jump_regex_cmd_sp(jump_regex_cmd_ap.release()); + m_command_dict[jump_regex_cmd_sp->GetCommandName ()] = jump_regex_cmd_sp; + } + } + } int @@ -1326,9 +1351,9 @@ CommandInterpreter::BuildAliasResult (const char *alias_name, else { result_str.Printf (" %s", option.c_str()); - if (value_type != optional_argument) + if (value_type != OptionParser::eOptionalArgument) result_str.Printf (" "); - if (value.compare ("<no_argument>") != 0) + if (value.compare ("<OptionParser::eNoArgument>") != 0) { int index = GetOptionArgumentPosition (value.c_str()); if (index == 0) @@ -2295,7 +2320,7 @@ CommandInterpreter::BuildAliasCommandArgs (CommandObject *alias_cmd_obj, } else { - if (value_type != optional_argument) + if (value_type != OptionParser::eOptionalArgument) new_args.AppendArgument (option.c_str()); if (value.compare ("<no-argument>") != 0) { @@ -2303,7 +2328,7 @@ CommandInterpreter::BuildAliasCommandArgs (CommandObject *alias_cmd_obj, if (index == 0) { // value was NOT a positional argument; must be a real value - if (value_type != optional_argument) + if (value_type != OptionParser::eOptionalArgument) new_args.AppendArgument (value.c_str()); else { @@ -2330,7 +2355,7 @@ CommandInterpreter::BuildAliasCommandArgs (CommandObject *alias_cmd_obj, raw_input_string = raw_input_string.erase (strpos, strlen (cmd_args.GetArgumentAtIndex (index))); } - if (value_type != optional_argument) + if (value_type != OptionParser::eOptionalArgument) new_args.AppendArgument (cmd_args.GetArgumentAtIndex (index)); else { |