building only lldb with debug symbols

Hi Everyone,

I'm writing a gdb-server for a new architecture and need to be able to debug lldb to track down issues. Unfortunately disk space is tight here and the llvm debug build consumes north of 40Gb with debug symbols. Is there any way to build *only* lldb with debug symbols (and no optimization)?


Hi Adrian,

This is a somewhat non-standard configuration, but there are a couple
of ways you could achieve that. A couple which come to mind are:
- If you're fine with hacking the cmake files then you could just
insert something like
into the root llvm CMakeLists.txt
and then add
to lldb's CMakeLists.txt

- If you want a solution which does not involve modifying the cmake
files, you could build llvm and lldb separately. The llvm could be
built with -g0 (or even in release mode if you really want) and then
the stanalone lldb build would be -g.

- You can also try building with -gsplit-dwarf
(LLVM_USE_SPLIT_DWARF=On) to see if that saves enough space for things
to work for you.


If you are on macOS, then the Xcode build has a "Debug" configuration which builds clang/llvm Release+asserts with no debug info, and lldb at -O0 with debug info.