dapptools
dapptools copied to clipboard
hevm: breakpoints
Currently using hevm often involves a lot of tedious and repetitive stepping to get to the part of the code that you care about.
It would be awesome to be able to emit some special event (e.g. HEVM_BREAKPOINT) from solidity, that would pause hevm execution once encountered. Users could then just hit one key to jump directly to the next breakpoint.
One could imagine doing this in a new display interface as well, where the user navigates the source code, and asks the evm to execute to that point. The emacs mode has something like this already, but it's pretty arcane knowledge
What is the expected difficulty of implementing something like this?
I think that depends on the approach taken, the fanciest (and imo most flexible / powerful) would be to expand the current UI to allow setting breakpoints, this would probably be quite a lot of work.
Just breaking on a special event would probably be relatively easy, but would probably still involve a fair amount of boilerplate (I think probably introducing a new action type to the meta interpreter language) and it has the disadvantage that you can't set a breakpoint in code you can't modify (e.g. when debugging an on chain contract via rpc).