diff options
author | Jim Ingham <jingham@apple.com> | 2011-03-22 02:29:32 +0000 |
---|---|---|
committer | Jim Ingham <jingham@apple.com> | 2011-03-22 02:29:32 +0000 |
commit | ffba229d61e0fd71075483115c47e7163fa7d8f1 (patch) | |
tree | e6f05d7605c251a0f92eec73472fc6d7396a2798 /lldb/source/Interpreter/CommandInterpreter.cpp | |
parent | 9931652775281e0f5ff26e61a534decbea2f038c (diff) | |
download | bcm5719-llvm-ffba229d61e0fd71075483115c47e7163fa7d8f1.tar.gz bcm5719-llvm-ffba229d61e0fd71075483115c47e7163fa7d8f1.zip |
Add "up" and "down" aliases.
llvm-svn: 128066
Diffstat (limited to 'lldb/source/Interpreter/CommandInterpreter.cpp')
-rw-r--r-- | lldb/source/Interpreter/CommandInterpreter.cpp | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/lldb/source/Interpreter/CommandInterpreter.cpp b/lldb/source/Interpreter/CommandInterpreter.cpp index 6f1c74fde9e..31a10142ca8 100644 --- a/lldb/source/Interpreter/CommandInterpreter.cpp +++ b/lldb/source/Interpreter/CommandInterpreter.cpp @@ -114,6 +114,9 @@ CommandInterpreter::Initialize () HandleCommand ("command alias p frame variable", false, result); HandleCommand ("command alias print frame variable", false, result); HandleCommand ("command alias po expression -o --", false, result); + HandleCommand ("command alias up regexp-up", false, result); + HandleCommand ("command alias down regexp-down", false, result); + } const char * @@ -197,6 +200,36 @@ CommandInterpreter::LoadCommandDictionary () m_command_dict[break_regex_cmd_sp->GetCommandName ()] = break_regex_cmd_sp; } } + + std::auto_ptr<CommandObjectRegexCommand> + down_regex_cmd_ap(new CommandObjectRegexCommand (*this, + "regexp-down", + "Go down \"n\" frames in the stack (1 frame by default).", + "down [n]", 2)); + if (down_regex_cmd_ap.get()) + { + if (down_regex_cmd_ap->AddRegexCommand("^$", "frame select -r -1") && + down_regex_cmd_ap->AddRegexCommand("^([0-9]+)$", "frame select -r -%1")) + { + CommandObjectSP down_regex_cmd_sp(down_regex_cmd_ap.release()); + m_command_dict[down_regex_cmd_sp->GetCommandName ()] = down_regex_cmd_sp; + } + } + + std::auto_ptr<CommandObjectRegexCommand> + up_regex_cmd_ap(new CommandObjectRegexCommand (*this, + "regexp-up", + "Go up \"n\" frames in the stack (1 frame by default).", + "up [n]", 2)); + if (up_regex_cmd_ap.get()) + { + if (up_regex_cmd_ap->AddRegexCommand("^$", "frame select -r 1") && + up_regex_cmd_ap->AddRegexCommand("^([0-9]+)$", "frame select -r %1")) + { + CommandObjectSP up_regex_cmd_sp(up_regex_cmd_ap.release()); + m_command_dict[up_regex_cmd_sp->GetCommandName ()] = up_regex_cmd_sp; + } + } } int |