diff options
Diffstat (limited to 'lldb/source/Interpreter/CommandInterpreter.cpp')
-rw-r--r-- | lldb/source/Interpreter/CommandInterpreter.cpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/lldb/source/Interpreter/CommandInterpreter.cpp b/lldb/source/Interpreter/CommandInterpreter.cpp index 16243f9c626..67ca12f4c23 100644 --- a/lldb/source/Interpreter/CommandInterpreter.cpp +++ b/lldb/source/Interpreter/CommandInterpreter.cpp @@ -228,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) { @@ -618,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 |