Errors when building lldb on a Mac

I am trying to build LLDB on Mac. Successfully followed the signing steps. However, when attempting to build via Xcode or getting command line, I am getting (fatal error: 'llvm/ADT/StringRef.h' file not found or similar build errors. Do I need to build LLVM first?

Only Xcode 6.1 (on Yosemite) and command line tools installed. No other compiler or build tool exists.

I would appreciate your urgent help.


No, just cd into the top level directory and type:

xcodebuild -configuration Debug -target desktop


xcodebuild -configuration Release -target desktop

It should download llvm/clang for you as part of a shell script build phase.

So you'll need a network connection during your build so it can download llvm/clang from SVN.

I have successfully built LLDB on a linux x86_64 (following exact steps from the LLVM and LLDB web build pages).

Cd to llvm/tools/lldb/examples/lookup/ and running make gives me the following error:

main.cpp:17:10: fatal error: 'LLDB/SBBlock.h' file not found

So it turns out this file exists in ../include/lldb/API/SBBlock.h

I changed all includes in the example to point to 'lldb/API/..' (Which I believe should not be necessary in the first place)

Now I am getting:

..SharingPtr.h:13:10: fatal error: 'algorithm' file not found

I will appreciate if you can help me out on this.


<algorithm> belongs to the c++ library. On Windows Visual Studio 2013, it's
c:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\algorithm .
On my Ubuntu 12 machine, for gcc 4.8 it's /usr/include/c++/4.8/algorithm .
In my libc++ installation, it's <libc++>/include/c++/v1/algorithm .

What compiler are you using? What c++ library?


Thanks Ted,

Updated libc++ and pointed gcc to the correct paths. That is sorted and compiled successfully.

However, when I try to run lookup on an iOS app dsym I am getting an error as in the following:

error: ‘{myDSYM}’ doesn’t contain architecture arm64

The command I use is :

$ lldb-lookup -arch=arm64 {myDSYM} {address}

I verified that the dsym contains the arm64 slice. Any thoughts? Do I have to add a flag when compiling to include any additional functionality?


You shouldn't have to do anything. dSYM files are bundles (directory that contains other directories and files), so you will need to specify the file inside the bundle:

% lldb-lookup -arch=arm64 foo.dSYM/Contents/Resources/DWARF/foo {address}

This will probably fix your issue.