From 59c862cab928287ab4bfc6ec1432a5239b4f77cb Mon Sep 17 00:00:00 2001 From: Sebastian Zaha Date: Thu, 6 Jul 2023 12:42:24 +0200 Subject: [PATCH] Documentation: Debugging Ladybird in CLion --- Documentation/BuildInstructionsLadybird.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Documentation/BuildInstructionsLadybird.md b/Documentation/BuildInstructionsLadybird.md index c972868039..9457de9f64 100644 --- a/Documentation/BuildInstructionsLadybird.md +++ b/Documentation/BuildInstructionsLadybird.md @@ -124,6 +124,14 @@ export SERENITY_SOURCE_DIR=$(realpath ../) ./Build/ladybird/ladybird # or, in macOS: open ./Build/ladybird/ladybird.app ``` +### Debugging with CLion + +Ladybird should be built with debug symbols first. In `Meta/CMake/lagom_compile_options.cmake` remove the optimizations by changing `-O2` to `-O0`. For macOS also change the debug option from `-g1` to `-g` so that lldb is happy with the emitted symbols. In linux `-g1` can be changed to `-ggdb3` for maximum debug info. + +After running Ladybird as suggested above with `./Meta/serenity.sh run lagom ladybird`, you can now in CLion use Run -> Attach to Process to connect. If debugging layouting and rendering issues, filter the listing that opens for `WebContent` and attach to that. + +Now breakpoints, stepping and variable inspection will work. + ### Debugging with Xcode on macOS The `serenity.sh` build script does not know how to generate Xcode projects, so creating the project must be done manually.