

So helpful tips about execution (this uses the Boost library). These are executed by a seperate executable that is also compiled with You are running unit tests which are located at src/test/ and use the BOOST library Process like you normally would using your bitcoin-cli. The bitcoind process using the run command. Within the lldb console you can set breakpoints before actually running starting You can start your bitcoind using a debugging tool like lldb in order to debug Recommend you use a debugger in that context instead. You can make this work, of course, but I would Then you will errors from missing header files and when you have added those If you would like to log from inside files that validate consensus rules To change this if you are logging from testnet or another environment. can then grep for the result in your debug.log file: $ cat ~/Library/Application\ Support/Bitcoin/regtest/debug.log | grep example shows the path of the regtest environment debug.log file. It is rather recommended to use LogPrintf. In general you can use to your std::out but this will not appear in any logs.
#BITCOIN CORE DIRECTORY CODE#
These are examples where you are interacting with the code yourself and don't rely

Feature tests log to temp files which get cleaned up unless your test fails or.Mainnet/Testnet/Regtest all have their own debug.log files.Guide should still work for you, as the tools are very similar. configure CXXFLAGS="-O0 -g" CFLAGS="-O0 -g"Īlso note this guide is using lldb instead of gdb because I am running MacOS.įor Linux users gdb seems to be the standard and even if you are using gdb the
#BITCOIN CORE DIRECTORY INSTALL#
The bitcoin core docs and install ccache and optimize your configuration.Īlso do not forget the disable optimizations using the -O0 flag, otherwiseĭebugging will be impossible as symbol names will not be recognizable.Īn example of configure flags. I recommend looking at the general productivity notes in

Table of contentsįirst of all, debugging involves a lot of compiling, so you definitely want to Issues as well as giving hints where issues may trip you up. To the bitcoin core code base an overview of the tools available for debugging This guide is designed to give beginners of C++ development and/or people new Me add Linux equivalent commands, please let me know. This document is currently optimized for MacOS. Moved to to allow for better collaboration.
