In Xcode 4.6, the alias lldb l is a simple shortcut to the source list .
At the top of the source tree, it is improved to behave like gdb. If you look at source/Interpreter/CommandInterpreter.cpp at http://lldb.llvm.org/ , you will see that l now an alias of the regex command with these cases
if (list_regex_cmd_ap->AddRegexCommand("^([0-9]+)[[:space:]]*$", "source list --line %1") && list_regex_cmd_ap->AddRegexCommand("^(.*[^[:space:]])[[:space:]]*:[[:space:]]*([[:digit:]]+)[[:space:]]*$", "source list --file '%1' --line %2") && list_regex_cmd_ap->AddRegexCommand("^\\*?(0x[[:xdigit:]]+)[[:space:]]*$", "source list --address %1") && list_regex_cmd_ap->AddRegexCommand("^-[[:space:]]*$", "source list --reverse") && list_regex_cmd_ap->AddRegexCommand("^-([[:digit:]]+)[[:space:]]*$", "source list --reverse --count %1") && list_regex_cmd_ap->AddRegexCommand("^(.+)$", "source list --name \"%1\"") && list_regex_cmd_ap->AddRegexCommand("^$", "source list"))
In these cases, you will receive the following:
Show current frame:
(lldb) f #0: 0x0000000100000f2b a.out`main + 27 at ac:15 12 13 14 -> 15 puts ("hi");
show the previous ten lines:
(lldb) l - 5 6 7 8 9 puts ("hi");
You can also use the stop-line-count-after and stop-line-count-before settings to control how much the source context is displayed when the frame stops.
Note that you can create your own regular expression command alias in the ~/.lldbinit with the same behavior as the top of the lldb l tree. See help command regex for syntax and example.
Jason molenda
source share