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)?

Thanks!
Adrian

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
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g0")
into the root llvm CMakeLists.txt
and then add
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g")
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.

pl

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.

Jim