LocalDebugger
a neo-cli plugin for debugging historical Neo smart contract executions
Compile
git clone https://github.com/hal0x2328/LocalDebugger
cd LocalDebugger
dotnet restore
dotnet publish -c Release
Install
Usage in neo-cli prompt:
debug {on|off} - enable debugger
bp {script hash} {offset} - set a breakpoint on a smart contract
tbp {tx hash} - set a breakpoint on a transaction
bbp {height} - set a breakpoint on a block
br {script hash} {offset} - remove a breakpoint on a smart contract
tbr {tx hash} - remove a breakpoint on a transaction
bbr {height} - remove a breakpoint on a block
bl - list all breakpoints
si - step into
s - step over
so - step out
c - continue
estack - examine the EvaluationStack
astack - examine the AltStack
dis {offset} - disassemble the currently running contract
Settings
LocalDebugger/config.json
contains the following settings to allow for preloading breakpoints non-interactively:
PreloadBlockBreakPoints
- a list of block heights to set a breakpoint onPreloadTxBreakPoints
- a list of transaction hashes to set a breakpoint onPreloadScriptBreakPoints
- list of smart contract script hashes:offsets to set a breakpoint onActivateOnStart
- enter debug mode immediately on loading the plugin
A block or transaction breakpoint will break at the first instruction of the first invocation in the block or transaction. If there is no invocation in the block or transaction, the breakpoint will not hit and the chain will continue to advance, looking for the next breakpoint.