Not sure if this issue is a bug or the if the the change made in the commit e507acb expects different debugging configuration than the one described below.
Expected behavior
If I clone Bitcoin Core from the repository and switch to the commit 2bce932 (the commit prior to e507acb), the debugging (gdb src/qt/bitcoin-qt or gdb src/bitcoind) will work as expected.
0git clone https://github.com/bitcoin/bitcoin.git
1cd bitcoin
2git checkout -b test_commit 2bce932
3./autogen.sh
4./configure BDB_LIBS="-L${BDB_PREFIX}/lib -ldb_cxx-4.8" BDB_CFLAGS="-I${BDB_PREFIX}/include" --enable-debug
5make -j "$(($(nproc)+1))"
6gdb src/bitcoind
7b init.cpp:1193
8(gdb) run -testnet
Actual behavior
But If I clone the project and debug from e507acb or from any subsequent commit ( such as the current top one 9313c4e6 ) , the gbd will not be able to find the files. Shows the message below for any file (in the example, the file is init.cpp). The message says that the file does not exist.
0[Thread debugging using libthread_db enabled]
1Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
2
3Breakpoint 1, AppInitMain (node=..., tip_info=0x0) at init.cpp:1193
41193 init.cpp: No such file or directory.
To reproduce
0git clone https://github.com/bitcoin/bitcoin.git
1cd bitcoin
2git checkout -b test_commit e507acb
3./autogen.sh
4./configure BDB_LIBS="-L${BDB_PREFIX}/lib -ldb_cxx-4.8" BDB_CFLAGS="-I${BDB_PREFIX}/include" --enable-debug
5make -j "$(($(nproc)+1))"
6gdb src/bitcoind
7b init.cpp:1193
8(gdb) run -testnet
System information
Tested on Ubuntu 20.04 and macOS Big Sur 11.3.
If the change made in the commit e507acb is undone on the local machine, the debugging of the master branch will work normally.
