Skip to content

Commit c47f537

Browse files
committed
Add Tips and Tricks section to README
1 parent 7cdcfa3 commit c47f537

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

README.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,3 +81,38 @@ Periodically the translations are pulled from Transifex and merged into the git
8181

8282
**Important**: We do not accept translation changes as github pull request because the next
8383
pull from Transifex would automatically overwrite them again.
84+
85+
Development tips and tricks
86+
---------------------------
87+
88+
**compiling for debugging**
89+
90+
Run configure with the --enable-debug option, then make. Or run configure with
91+
CXXFLAGS="-g -ggdb -O0" or whatever debug flags you need.
92+
93+
**debug.log**
94+
95+
If the code is behaving strangely, take a look in the debug.log file in the data directory;
96+
error and debugging message are written there.
97+
98+
The -debug=... command-line option controls debugging; running with just -debug will turn
99+
on all categories (and give you a very large debug.log file).
100+
101+
The Qt code routes qDebug() output to debug.log under category "qt": run with -debug=qt
102+
to see it.
103+
104+
**testnet and regtest modes**
105+
106+
Run with the -testnet option to run with "play bitcoins" on the test network, if you
107+
are testing multi-machine code that needs to operate across the internet.
108+
109+
If you are testing something that can run on one machine, run with the -regtest option.
110+
In regression test mode blocks can be created on-demand; see qa/rpc-tests/ for tests
111+
that run in -regest mode.
112+
113+
**DEBUG_LOCKORDER**
114+
115+
Bitcoin Core is a multithreaded application, and deadlocks or other multithreading bugs
116+
can be very difficult to track down. Compiling with -DDEBUG_LOCKORDER (configure
117+
CXXFLAGS="-DDEBUG_LOCKORDER -g") inserts run-time checks to keep track of what locks
118+
are held, and adds warning to the debug.log file if inconsistencies are detected.

0 commit comments

Comments
 (0)