From bc8cfbac59c98062fad7549703f7aa51ab907e3f Mon Sep 17 00:00:00 2001 From: Black-Hole <158blackhole@gmail.com> Date: Wed, 1 Dec 2021 05:40:58 +0800 Subject: [PATCH] docs: add debug build (#31979) * docs: add debug build * docs: move debug config document to debugging.md * fix: debug.gn import failed * docs: modify debug.gn folder on doc * docs: imporve gn import path --- docs/development/debugging.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/docs/development/debugging.md b/docs/development/debugging.md index 4c6cc27b065f..775a31199b95 100644 --- a/docs/development/debugging.md +++ b/docs/development/debugging.md @@ -35,6 +35,28 @@ base::debug::StackTrace().Print(); This will allow you to observe call chains and identify potential issue areas. +## Breakpoint Debugging + +> Note that this will increase the size of the build significantly, taking up around 50G of disk space + +Write the following file to `electron/.git/info/exclude/debug.gn` + +```gn +import("//electron/build/args/testing.gn") +is_debug = true +symbol_level = 2 +forbid_non_component_debug_builds = false +``` + +Then execute: + +```sh +$ gn gen out/Debug --args="import(\"//electron/.git/info/exclude/debug.gn\") $GN_EXTRA_ARGS" +$ ninja -C out/Debug electron +``` + +Now you can use `LLDB` for breakpoint debugging. + ## Platform-Specific Debugging