vm: fix debugger and add tests

1. `Run()` must be able to continue execution after a breakpoint.
2. VM must stop right before the breakpoint, not after.
3. Initial vm state is NONE, not HALT.
This commit is contained in:
Evgenii Stratonikov 2020-08-18 11:13:09 +03:00
parent 8659fd79e5
commit a080d24cf5
3 changed files with 52 additions and 11 deletions

View file

@ -221,7 +221,7 @@ func (c *Context) Equals(s stackitem.Item) bool {
func (c *Context) atBreakPoint() bool {
for _, n := range c.breakPoints {
if n == c.ip {
if n == c.nextip {
return true
}
}