From cb7c5ca824e2b0636518e921890b498b6fc12dfa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C5=91rinc?= Date: Sun, 18 Aug 2024 12:19:32 +0200 Subject: [PATCH 1/2] Add gdb and lldb links to debugging troubleshooting --- doc/developer-notes.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/developer-notes.md b/doc/developer-notes.md index 952dbc77a0d..4b508f2b503 100644 --- a/doc/developer-notes.md +++ b/doc/developer-notes.md @@ -375,12 +375,12 @@ There are a few possible fixes: 1. Configure source file mapping. -For `gdb` create or append to `.gdbinit` file: +For `gdb` create or append to [`.gdbinit` file](https://sourceware.org/gdb/current/onlinedocs/gdb#gdbinit-man): ``` set substitute-path ./src /path/to/project/root/src ``` -For `lldb` create or append to `.lldbinit` file: +For `lldb` create or append to [`.lldbinit` file](https://lldb.llvm.org/man/lldb.html#configuration-files): ``` settings set target.source-map ./src /path/to/project/root/src ``` From 1b0b9b4c7873ff0c6323de0c7f439466eed06049 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C5=91rinc?= Date: Sun, 18 Aug 2024 12:21:24 +0200 Subject: [PATCH 2/2] Extend possible debugging fixes with file-name-only --- doc/developer-notes.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/developer-notes.md b/doc/developer-notes.md index 4b508f2b503..a6e149929db 100644 --- a/doc/developer-notes.md +++ b/doc/developer-notes.md @@ -369,7 +369,7 @@ If you have ccache enabled, absolute paths are stripped from debug information with the `-fdebug-prefix-map` and `-fmacro-prefix-map` options (if supported by the compiler). This might break source file detection in case you move binaries after compilation, debug from the directory other than the project root or use -an IDE that only supports absolute paths for debugging. +an IDE that only supports absolute paths for debugging (e.g. it won't stop at breakpoints). There are a few possible fixes: @@ -392,6 +392,8 @@ ln -s /path/to/project/root/src src 3. Use `debugedit` to modify debug information in the binary. +4. If your IDE has an option for this, change your breakpoints to use the file name only. + ### `debug.log` If the code is behaving strangely, take a look in the `debug.log` file in the data directory;