dapptools icon indicating copy to clipboard operation
dapptools copied to clipboard

hevm: breakpoints

Open d-xo opened this issue 5 years ago • 3 comments

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.

d-xo avatar Sep 18 '20 08:09 d-xo

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

MrChico avatar Sep 25 '20 14:09 MrChico

What is the expected difficulty of implementing something like this?

riordant avatar Jan 07 '22 03:01 riordant

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).

d-xo avatar Jan 08 '22 12:01 d-xo