Debugging does not work after commit e507acb (PR #20353) #21885

issue leonardojobim openend this issue on May 8, 2021
  1. leonardojobim commented at 10:31 pm on May 8, 2021: none

    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.

  2. leonardojobim added the label Bug on May 8, 2021
  3. adamjonas commented at 4:13 pm on May 11, 2021: member
  4. adamjonas deleted a comment on May 11, 2021
  5. ajtowns commented at 5:08 am on May 17, 2021: member

    cd src; gdb ./bitcoind should work.

    If you’ve got debugedit available (possible for ubuntu, probably not for macos), you might be able to run debugedit -b. -d"$PWD/src" src/bitcoind to make gdb src/bitcoind and cd src; gdb ./bitcoind both work.

  6. MarcoFalke commented at 11:37 am on August 26, 2021: member
    Tested that setting the working dir to src/ also fixes the debugger in Clion
  7. MarcoFalke commented at 8:13 am on August 30, 2021: member

    Uploading a screenshot because someone asked how to set the working dir in Clion.

    Screenshot from 2021-08-30 10-09-15

  8. fanquake closed this on Oct 11, 2021

  9. sidhujag referenced this in commit 553b7e7dfa on Oct 11, 2021
  10. PastaPastaPasta referenced this in commit 87caa91a99 on Apr 3, 2022
  11. gades referenced this in commit 3c7c32baf4 on May 9, 2022
  12. DrahtBot locked this on Oct 30, 2022

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2025-12-17 06:13 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me