vmcli: set breakpoint before the instruction

Breakpoint should occur before actual instruction execution.
This commit is contained in:
Evgenii Stratonikov 2020-12-01 16:53:38 +03:00
parent 2f39701d76
commit d7ffa89811
3 changed files with 29 additions and 11 deletions

View file

@ -241,7 +241,7 @@ func (v *VM) AddBreakPoint(n int) {
// instruction pointer.
func (v *VM) AddBreakPointRel(n int) {
ctx := v.Context()
v.AddBreakPoint(ctx.ip + n)
v.AddBreakPoint(ctx.nextip + n)
}
// LoadFile loads a program in NEF format from the given path, ready to execute it.