Skip to content

Commit b934954

Browse files
committed
Merge bitcoin/bitcoin#30670: doc: Extend developer-notes with file-name-only debugging fix
1b0b9b4 Extend possible debugging fixes with file-name-only (Lőrinc) cb7c5ca Add gdb and lldb links to debugging troubleshooting (Lőrinc) Pull request description: Split out of bitcoin/bitcoin#30454 (comment) While testing the new `cmake` build with [CLion](https://youtrack.jetbrains.com/issue/CPP-15850/Debugger-doesnt-stop-on-breakpoints-in-case-of-fdebug-prefix-map#focus=Comments-27-4926356.0-0), I noticed that the tests don't always stop at the set breakpoints, so I've updated the `developer-notes.md`, hoping it will be useful for others experiencing the same. Added links to gdb and lldb documentations. Assumed a default directory (similarly to https://github.com/hebasto/bitcoin/pull/328/files#diff-4d2a64ce14cb8b971dbba9455421b04ae7ed0c489c66d983664be5632b0de4a3R19) to make the commands more realistic. Extended the possible debugging fixes with `file-name-only` option. ACKs for top commit: achow101: ACK 1b0b9b4 laanwj: ACK 1b0b9b4 Tree-SHA512: 11d2fa69074d6301ee0ca94bc7adb4f251e270624b733c03abc0b91ddb4c9e810d31bd8cbebaebf893974cd85aa14fff94504b93d9c1c46ace64349a84041b41
2 parents 05aebe3 + 1b0b9b4 commit b934954

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

doc/developer-notes.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -369,18 +369,18 @@ If you have ccache enabled, absolute paths are stripped from debug information
369369
with the `-fdebug-prefix-map` and `-fmacro-prefix-map` options (if supported by the
370370
compiler). This might break source file detection in case you move binaries
371371
after compilation, debug from the directory other than the project root or use
372-
an IDE that only supports absolute paths for debugging.
372+
an IDE that only supports absolute paths for debugging (e.g. it won't stop at breakpoints).
373373

374374
There are a few possible fixes:
375375

376376
1. Configure source file mapping.
377377

378-
For `gdb` create or append to `.gdbinit` file:
378+
For `gdb` create or append to [`.gdbinit` file](https://sourceware.org/gdb/current/onlinedocs/gdb#gdbinit-man):
379379
```
380380
set substitute-path ./src /path/to/project/root/src
381381
```
382382

383-
For `lldb` create or append to `.lldbinit` file:
383+
For `lldb` create or append to [`.lldbinit` file](https://lldb.llvm.org/man/lldb.html#configuration-files):
384384
```
385385
settings set target.source-map ./src /path/to/project/root/src
386386
```
@@ -392,6 +392,8 @@ ln -s /path/to/project/root/src src
392392

393393
3. Use `debugedit` to modify debug information in the binary.
394394

395+
4. If your IDE has an option for this, change your breakpoints to use the file name only.
396+
395397
### `debug.log`
396398

397399
If the code is behaving strangely, take a look in the `debug.log` file in the data directory;

0 commit comments

Comments
 (0)