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, so that breakpoints during process init can be debugged.
Example usage
- Generate build files with
-DWAIT_FOR_DEBUGGER=ON
& build. - Set breakpoints in editor/IDE.
- Start Python test with debugger command:
$ ./build/test/functional/feature_abortnode.py --debug_runs 1 --debug_cmd "kgx -- $(which lldb) -o continue -p \$PID\$"
(LLDB inside a Gnome Console window) or$ ./build/test/functional/feature_abortnode.py --debug_runs 1 --debug_cmd "subl --command \"debugger {\\\"action\\\": \\\"start\\\", \\\"configuration\\\": {\\\"name\\\": \\\"foo\\\", \\\"type\\\": \\\"lldb\\\", \\\"request\\\": \\\"attach\\\", \\\"program\\\": \\\"dummyprogram\\\", \\\"pid\\\": \\\"\$PID\$\\\"}}\""
(Sublime Text Debugger) - Experience how debugger hits breakpoints.
Needed before merge
- Testing on Mac to confirm -waitfordebugger on the C++ side behaves as expected.