Search code examples
c++visual-studio-codebitcoinlldb

How do I keep the debugger alive using lldb and VSCode to use it along with bitcoind & bitcoin-cli?


All this is on Mac OS Mojave. There are two relevant executables in bitcoin: bitcoind and bitcoin-cli. bitcoind runs the bitcoin server.bitcoin-cli is used to execute transactions and other activities. I would like trace the transaction which is initiated by bitcoin-cli

I have already been able to trace the path of bitcoind using lldb. I am trying to trace the path of execution of transaction made using bitcoin-cli. When I run bitcoind using lldb and Visual Studio code the "debugger panel" disappears if I dont put in a break point. I cant put a break point when I make the transaction using bitcoin-cli because the debugger panel disappears. You can see the debugger panel on the top left image here which disappears immediately

Here is the launch file of VS Code:

        {
            "name": "(lldb) Launch",
            "type": "cppdbg",
            "request": "launch",
            "program": "/Users/ravi/zagg/micro-tests/bitcoin/src/bitcoind",
            "args": ["-datadir=/Users/ravi/zagg/micro-tests/bitcoin/datadir"],
            "stopAtEntry": false,
            "cwd": "${workspaceFolder}",
            "environment": [],
            "externalConsole": false,
            "MIMode": "lldb"
        }

How can I keep the debuggger alive so that I can trace an transactions i make using bitcoin-cli?


Solution

  • It is not an issue with VScode or lldb. You are running bitcoin in daemon mode. You should change the configuration of bitcoin in bitcoin.conf from daemon=1 to daemon=0. This will keep the debugger running. There should not be any more issues after that.