How to improve LLDB debugging startup time in Linux

Viewed 223

I have a mid size cross-platform application that I can start debugging in 2 to 3 seconds from click "Start Debugging" to hitting a breakpoint at the top of the main() method. This is when built with MSVC2019 toolset in Visual Studio.

The same application is also compiled under Ubuntu 20.04 and MacOS using clang-10 and debugged with LLDB. However, either in VSCode or Qt Creator it takes about 15 seconds from click "Start debugging" to hitting the same breakpoint. It looks like the majority of the time is spent loading symbols from the shared objects. On MacOS, despite being developed with a MacBook and not having a powerful desktop CPU, it loads in about 6 seconds, i.e. faster.

Compiler args being used:

clang -x c++ -std=c++17 -O0 -g -fPIC -fmessage-length=0 -fstrict-aliasing -stdlib=libc++ -isystem "/usr/lib/llvm-10/include/c++/v1/" -isystem "/usr/include" -MMD -MF $out.d -o $out -c $in

Linker args being used:

clang -O0 -fPIC -fmessage-length=0 -fstrict-aliasing -stdlib=libc++ -g -fvisibility=hidden -pedantic-errors -fobjc-arc -z noexecstack -z relro -z now -lc++ -lc++abi -lm -lrt -shared -Wl,-rpath,'$$ORIGIN',-z,origin -o $out @$out.rsp

My question is, is there a well known combination of clang compiler/linker flags or lldb settings that can be tweaked to improve debugger startup time when developing on Linux?

I've tried settings set target.preload-symbols false on lldb init commands, but it didn't help much.

0 Answers
Related