0

If I clone Bitcoin Core from the repository and switch to version v0.21 (git checkout tags/v0.21.0), the debugging (gdb src/qt/bitcoin-qt or gdb src/bitcoind) will work as expected.

But If I clone the project and simply debug from master, the gbd will not be able to find the files. Shows the message below for any file (in the example, the file is net_processing.cpp). The message says that the file does not exist.

Thread 22 "b-msghand" hit Breakpoint 1, (anonymous namespace)::PeerManagerImpl::MaybeSendAddr (this=0x555556721b50, node=..., current_time=...)
    at net_processing.cpp:4156
4156    net_processing.cpp: No such file or directory.

To reproduce the issue in Bitcoin Core v0.21 (will succeed)

git clone https://github.com/bitcoin/bitcoin.git && cd bitcoin
git checkout tags/v0.21.0
./autogen.sh 
./configure BDB_LIBS="-L${BDB_PREFIX}/lib -ldb_cxx-4.8" BDB_CFLAGS="-I${BDB_PREFIX}/include" --enable-debug
ccache make -j "$(($(nproc)+1))" check
gdb src/bitcoind
b net_processing.cpp:2278
(gdb) run -testnet

To reproduce the issue in Bitcoin Core master branch (will fail)

git clone https://github.com/bitcoin/bitcoin.git && cd bitcoin
./autogen.sh 
./configure BDB_LIBS="-L${BDB_PREFIX}/lib -ldb_cxx-4.8" BDB_CFLAGS="-I${BDB_PREFIX}/include" --enable-debug
ccache make -j "$(($(nproc)+1))" check
gdb src/bitcoind
b net_processing.cpp:2341
(gdb) run -testnet

It was tested on Ubuntu 20.04.

What has changed since version 0.21 that affects debugging and how to set up debugging correctly for master branch?


EDIT: The debugging error is caused by the change made in the PR #20353. If the change to this PR is undone in the local machine, the debugging of the master branch will work normally.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.