To specify a different path for dSYM you can do the following steps:
First generate the UUID for the executable using the following command:
xcrun dwarfdump --uuid path-to-executable
Then make the directory by splitting the first 20 hex digits into 4 character chunks and creating a tree of directories: each subsequent directory is created inside the previous one. Then create a symlink whose name is the last 12 hex digits in the deepest directory.
For example if the UUID generated is:
23516BE4-29BE-350C-91C9-F36E7999F0F1
then make the Folders: 2351/6BE4/29BE/350C/91C9/
and the Symlink:
F36E7999F0F1
The symlinks value is a full path to the mach-o files inside the dSYM bundle which contains the DWARF.
If the dSYM is in source/foo.dSYM/Contents/Resources/DWARF/foo,
then the link must be the full path to source/foo.dSYM/Contents/Resources/DWARF/foo (see the example below).
The last part is to tell DebugSymbols to check this UUID file map cache using:
% defaults write com.apple.DebugSymbols DBGFileMappedPaths path-to-your uuids tree
For example you can put the directories you have created under ~/Library/SymbolCache/dsyms/uuids/ (or wherever you want) so that the complete path to your final link will be: ~/Library/SymbolCache/dsyms/uuids/2351/6BE4/29BE/350C/91C9/F36E7999F0F1
And the command:
% defaults write com.apple.DebugSymbols DBGFileMappedPaths ~/Library/SymbolCache/dsyms/uuids/
Then check it with:
defaults read com.apple.DebugSymbols DBGFileMappedPaths
source: http://lldb.llvm.org/symbols.html, LLDB: add symbols file?
I tried it on my MAC OS X:
xcrun dwarfdump --uuid ./a.out
UUID: 7C9D0D55-3882-3F1B-99CA-446AFF4B5D0E (x86_64) ./a.out
mkdir PAPERINO
mv a.out.dSYM/ PAPERINO/
mkdir -p ~/Library/SymbolCache/dsyms/uuids/
mkdir -p ~/Library/SymbolCache/dsyms/uuids/7C9D0/0D55/3882/3F1B/99CA
cd ~/Library/SymbolCache/dsyms/uuids/7C9D0/0D55/3882/3F1B/99CA/
ln -s ../../../<my path>/PAPERINO/a.out.dSYM/Contents/Resources/DWARF/a.out 446AFF4B5D0E
And finally I was able to list the source in lldb:
lldb ./a.out
(lldb) target create "./a.out"
Current executable set to './a.out' (x86_64).
(lldb) source list
6 {
7 char input[40] = {'\0'};
8 int count = 0;