[Lldb-commits] [lldb] r128066 - /lldb/trunk/source/Interpreter/CommandInterpreter.cpp

Jim Ingham jingham at apple.com
Mon Mar 21 19:29:32 PDT 2011


Author: jingham
Date: Mon Mar 21 21:29:32 2011
New Revision: 128066

URL: http://llvm.org/viewvc/llvm-project?rev=128066&view=rev
Log:
Add "up" and "down" aliases.

Modified:
    lldb/trunk/source/Interpreter/CommandInterpreter.cpp

Modified: lldb/trunk/source/Interpreter/CommandInterpreter.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/CommandInterpreter.cpp?rev=128066&r1=128065&r2=128066&view=diff
==============================================================================
--- lldb/trunk/source/Interpreter/CommandInterpreter.cpp (original)
+++ lldb/trunk/source/Interpreter/CommandInterpreter.cpp Mon Mar 21 21:29:32 2011
@@ -114,6 +114,9 @@
     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 @@
             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





More information about the lldb-commits mailing list