Attaching sources to a binary dylib in Xcode Attaching sources to a binary dylib in Xcode xcode xcode

Attaching sources to a binary dylib in Xcode


To debug code built on one machine but debugged on another you have to build a dSYM and have that available on the machine on which you are debugging. If you haven't done that, nothing is going to work.

Next thing to check is that lldb is picking up the dSYM. This page has some description of how this process works:

http://lldb.llvm.org/symbols.html

but if all else fails, you can use the add-dsym command to add it by hand.

If that still hasn't fixed your problem, then pick some symbol in your dylib, and do:

(lldb) image lookup -vn <SYMBOL_NAME>

or alternately find some address in the loaded dylib and do:

(lldb) image lookup -va <ADDRESS>

If lldb found the dSYM and the debug info is correct, one of the lines of output should be the entry for the "Compile Unit". That is what the debug info says the path to the source file is. The appropriate base of that path is what you should use in target.source-map. If you don't see that entry, then the debug information for that compilation unit is getting lost somehow.

If all those things look good and lldb still isn't seeing the source files, then you are likely hitting a bug, in which case please file a bug with http://bugreporter.apple.com.