Skip to content

Commit f6298a8

Browse files
committed
Merge bitcoin/bitcoin#30840: docs: Updated debug build instructions for cmake
0b003e1 docs: Updated debug build instructions for cmake (ion-) Pull request description: In the [developer notes](https://github.com/bitcoin/bitcoin/blob/master/doc/developer-notes.md) the section on [compiling for debug](https://github.com/bitcoin/bitcoin/blob/master/doc/developer-notes.md#compiling-for-debugging) displays outdated instructions that were applicable before the move to cmake build system. This PR just gives instructions on how to build for debugging in the context of cmake. ACKs for top commit: kevkevinpal: ACK [0b003e1](bitcoin/bitcoin@0b003e1) achow101: ACK 0b003e1 tdb3: ACK 0b003e1 Tree-SHA512: fc8b4824d68e47b3e64320b4ce728df4242d00c2e8c75dcf5daa60af3050c62d94fa9741e447c7d81e72194470ed68a4e19bbee8cf6a1412d6566c7b699cf242
2 parents a8809ae + 0b003e1 commit f6298a8

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

doc/developer-notes.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -354,8 +354,14 @@ Development tips and tricks
354354

355355
### Compiling for debugging
356356

357-
Run configure with `--enable-debug` to add additional compiler flags that
358-
produce better debugging builds.
357+
When using the default build configuration by running `cmake -B build`, the
358+
`-DCMAKE_BUILD_TYPE` is set to `RelWithDebInfo`. This option adds debug symbols
359+
but also performs some compiler optimizations that may make debugging trickier
360+
as the code may not correspond directly to the source.
361+
362+
If you need to build exclusively for debugging, set the `-DCMAKE_BUILD_TYPE`
363+
to `Debug` (i.e. `-DCMAKE_BUILD_TYPE=Debug`). You can always check the cmake
364+
build options of an existing build with `ccmake build`.
359365

360366
### Show sources in debugging
361367

0 commit comments

Comments
 (0)