Merge bitcoin/bitcoin#34413: doc: Remove outdated -fdebug-prefix-map section in dev notes

fa2e1b85dd6b263a77294566bd361d7873731045 build: Remove outdated comment about -ffile-prefix-map (MarcoFalke)
fa06cd4ba7303bd3036467cf00d12f36c94bcaff doc: Remove outdated -fdebug-prefix-map section in dev notes (MarcoFalke)

Pull request description:

  This removes some docs. See the commit messages for an explanation.

ACKs for top commit:
  l0rinc:
    ACK fa2e1b85dd6b263a77294566bd361d7873731045
  sedited:
    ACK fa2e1b85dd6b263a77294566bd361d7873731045

Tree-SHA512: 6be33bdf9365be5fb75d39a48fd1295b193649775a00e8344123dc0f588da22f7efe80b1490dde2c74aea3d7fec6a3fa75785791296f3fb248ddf45e40b95eb7
This commit is contained in:
merge-script 2026-01-27 18:32:37 +01:00
commit c0e6556e4f
No known key found for this signature in database
GPG Key ID: 9B79B45691DB4173
2 changed files with 0 additions and 36 deletions

View File

@ -483,11 +483,6 @@ configure_file(contrib/filter-lcov.py filter-lcov.py USE_SOURCE_PERMISSIONS COPY
# Don't allow extended (non-ASCII) symbols in identifiers. This is easier for code review.
try_append_cxx_flags("-fno-extended-identifiers" TARGET core_interface SKIP_LINK)
# Avoiding the `-ffile-prefix-map` compiler option because it implies
# `-fcoverage-prefix-map` on Clang or `-fprofile-prefix-map` on GCC,
# which can cause issues with coverage builds, particularly when using
# Clang in the OSS-Fuzz environment due to its use of other options
# and a third party script, or with GCC.
# Set `-fmacro-prefix-map`, so that source file names are expanded without the
# src prefix.
try_append_cxx_flags("-fmacro-prefix-map=A=B" TARGET core_interface SKIP_LINK

View File

@ -305,37 +305,6 @@ If you need to build exclusively for debugging, set the `-DCMAKE_BUILD_TYPE`
to `Debug` (i.e. `-DCMAKE_BUILD_TYPE=Debug`). You can always check the cmake
build options of an existing build with `ccmake build`.
### Show sources in debugging
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 (e.g. it won't stop at breakpoints).
There are a few possible fixes:
1. Configure source file mapping.
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](https://lldb.llvm.org/man/lldb.html#configuration-files):
```
settings set target.source-map ./src /path/to/project/root/src
```
2. Add a symlink to the `./src` directory:
```
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;