When I step through my code in lldb, there will be an indication of the source file name:
(lldb) s
Process 23824 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = step in
frame #0: 0x00000001000073b2 clang`llvm::SmallVector<std::__1::pair<void*, unsigned long>, 0u>::SmallVector(this=0x00007ffeefbff080) at SmallVector.h:843
So I can see here we are at line 843 on SmallVector.h.
However, I do not know what's the full file path of this file and I am forced to use Terminal's find to find it. And it becomes a problem if there's more than one file with the same name.
Is there a setting I can change so lldb will dump the full file path?
If you only want one-time printing of this information, you can use the source info command to dump info about a source file. For instance:
(lldb) source info -a $pc
will dump the full path to the source file at the current pc (among other things).
If you want to see full paths in backtraces all the time, you can adjust the lldb setting frame-format which controls the frame printing in backtraces. See:
https://lldb.llvm.org/use/formatting.html
for more details. In your case you want:
settings set frame-format frame #${frame.index}: ${frame.pc}{ ${module.file.basename}{\`${function.name}}}{ at ${line.file.fullpath}:${line.number}}\n
Use settings show frame-format to see the default setting.
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