From 958843c32b7a29741f2e45996b5b3e89f9e108b0 Mon Sep 17 00:00:00 2001 From: emaste Date: Wed, 19 Mar 2014 13:11:35 +0000 Subject: 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 --- .../lldb/source/Interpreter/CommandInterpreter.cpp | 43 +++++++++++++++++----- 1 file changed, 34 insertions(+), 9 deletions(-) (limited to 'contrib/llvm/tools/lldb/source/Interpreter/CommandInterpreter.cpp') 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 #include - -#include #include #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 []\n_regexp-attach [:]\n_regexp-attach [:]", + "_regexp-list []\n_regexp-list [:]\n_regexp-list [:]", 2, CommandCompletions::eSourceFileCompletion)); if (list_regex_cmd_ap.get()) @@ -620,6 +625,26 @@ CommandInterpreter::LoadCommandDictionary () } } + std::unique_ptr + jump_regex_cmd_ap(new CommandObjectRegexCommand (*this, + "_regexp-jump", + "Sets the program counter to a new address.", + "_regexp-jump []\n" + "_regexp-jump [<+-lineoffset>]\n" + "_regexp-jump [:]\n" + "_regexp-jump [*]\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 ("") != 0) + if (value.compare ("") != 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 ("") != 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 { -- cgit v1.1