Closes #31204
To reproduce:
- build bitcoin with
-DCMAKE_BUILD_TYPE=Debug
- run with lldb, add a breakpoint and trigger it (with a second local bitcoind peer, for example):
lldb buld/bin/bitcoind
(lldb) b ProcessMessage
(lldb) r -regtest
Output will probably look like this:
0Process 6764 stopped
1* thread [#34](/bitcoin-bitcoin/34/), name = 'b-msghand', stop reason = breakpoint 1.1
2 frame [#0](/bitcoin-bitcoin/0/): 0x00000001003380c0 bitcoind`(anonymous namespace)::PeerManagerImpl::ProcessMessages(this=0x000000013e80e400, pfrom=0x000000013c70a830, interruptMsgProc=0x000000013d009d40) at net_processing.cpp:4933:5
To fix (following the doc in this PR)
Create or append to ~/.lldbinit
in your $HOME directory, using absolute paths. (My example)
0settings set target.source-map /Users/matthewzipkin/Desktop/work/bitcoin/build/src /Users/matthewzipkin/Desktop/work/bitcoin/src
Improved output:
0Process 6811 stopped
1* thread [#34](/bitcoin-bitcoin/34/), name = 'b-msghand', stop reason = breakpoint 1.1
2 frame [#0](/bitcoin-bitcoin/0/): 0x00000001003380c0 bitcoind`(anonymous namespace)::PeerManagerImpl::ProcessMessages(this=0x000000011c808800, pfrom=0x0000000104004080, interruptMsgProc=0x000000011d009140) at net_processing.cpp:4933:5
3 4930
4 4931 bool PeerManagerImpl::ProcessMessages(CNode* pfrom, std::atomic<bool>& interruptMsgProc)
5 4932 {
6-> 4933 AssertLockNotHeld(m_tx_download_mutex);
7 4934 AssertLockHeld(g_msgproc_mutex);
8 4935
9 4936 PeerRef peer = GetPeerRef(pfrom->GetId());