Skip to content

qa debug: Add --debug_runs/-waitfordebugger [DRAFT]

Facilitates debugging specific instances of bitcoind in the context of Python tests, inside of an editor/IDE.

Makes bitcoind spin during startup, waiting for a debugger to be attached.

Example usage

  1. Generate build files with -DWAIT_FOR_DEBUGGER=ON & build.
  2. Set breakpoints in editor/IDE.
  3. Start Python test:
₿ build/test/functional/feature_config_args.py --debug_runs 0
2025-01-23T13:51:09.143000Z TestFramework (INFO): PRNG seed is: 1495347861660308752
2025-01-23T13:51:09.143000Z TestFramework (INFO): Initializing test directory /tmp/bitcoin_func_test_hx8vd5bv
2025-01-23T13:51:09.144000Z TestFramework.node0 (INFO): bitcoind started (run #0, node #0), waiting for debugger, PID: 1382744
  1. Navigate in editor/IDE and attach to process 1382744, which will now continue executing under the context of the test.
  2. Experience how debugger hits breakpoints.

Reasons for draft status

  • Untested on Mac.

Merge request reports

Loading