[Lldb-commits] [PATCH] D61469: [Alias] Add 're' alias for register
Jonas Devlieghere via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Thu May 2 14:42:25 PDT 2019
JDevlieghere created this revision.
JDevlieghere added a reviewer: jingham.
Herald added a project: LLDB.
This patch makes `re` an alias for `register`. Currently `re<TAB>` gives you the choice between `register` and `reproducer`. Given that you use `register` a lot more often, `register` should win for the common substring.
Repository:
rLLDB LLDB
https://reviews.llvm.org/D61469
Files:
lldb/packages/Python/lldbsuite/test/functionalities/register/register_command/TestRegisters.py
lldb/source/Interpreter/CommandInterpreter.cpp
Index: lldb/source/Interpreter/CommandInterpreter.cpp
===================================================================
--- lldb/source/Interpreter/CommandInterpreter.cpp
+++ lldb/source/Interpreter/CommandInterpreter.cpp
@@ -429,6 +429,11 @@
AddAlias("var", cmd_obj_sp);
AddAlias("vo", cmd_obj_sp, "--object-description");
}
+
+ cmd_obj_sp = GetCommandSPExact("register", false);
+ if (cmd_obj_sp) {
+ AddAlias("re", cmd_obj_sp);
+ }
}
void CommandInterpreter::Clear() {
Index: lldb/packages/Python/lldbsuite/test/functionalities/register/register_command/TestRegisters.py
===================================================================
--- lldb/packages/Python/lldbsuite/test/functionalities/register/register_command/TestRegisters.py
+++ lldb/packages/Python/lldbsuite/test/functionalities/register/register_command/TestRegisters.py
@@ -187,7 +187,8 @@
elif not value.IsValid():
return # If register doesn't exist, skip this test
- self.runCmd("register write " + register + " \'" + new_value + "\'")
+ # Also test the 're' alias.
+ self.runCmd("re write " + register + " \'" + new_value + "\'")
self.expect(
"register read " +
register,
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D61469.197872.patch
Type: text/x-patch
Size: 1251 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20190502/259ea09a/attachment.bin>
More information about the lldb-commits
mailing list