I have a file ~/.lldbinit with a single alias:
command alias pi print (int)
But when I run my app from Xcode, the alias does not work. However, if I manually enter the alias, then the alias does work:
(lldb) pi 6
error: 'pi' is not a valid command.
(lldb) command alias pi print (int)
(lldb) pi 6
(int) $3 = 6
(lldb)
This leads me to suspect that my .lldbinit file is not getting read. Or is there a different problem that I am missing? Can anyone help?
Loading a Program into lldb First we need to set the program to debug. As with gdb, you can start lldb and specify the file you wish to debug on the command line: $ lldb /Projects/Sketch/build/Debug/Sketch. app Current executable set to '/Projects/Sketch/build/Debug/Sketch.
lldbinit file located in the home directory. Note that it is a hidden file, if you can't see the file, you can use the following shortcut to show the hidden files in your finder: shift + command + .
Xcode uses the LLDB as the default debugging tool. The full form of LLDB is Low-level debugger. Breakpoints help a developer to stop the execution of the program at any point. Stopping the execution of the program at any point helps to know the current state of that program and its properties.
I had a similar problem. It turned out, that I had a syntax error in my .lldbinit file which leads to lldb silently ignoring the file. You can try manually loading the file with
command source ~/.lldbinit
which will show syntax errors.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With