mirror of
https://github.com/go-delve/delve.git
synced 2025-10-28 04:35:19 +08:00
proc: Continue should always work after CallFunction
Continue did not resume execution after a call to CallFunction if the point where the process was stopped, before the call CallFunction, was a breakpoint. Fixes #1374
This commit is contained in:
@ -4084,3 +4084,20 @@ func TestReadDeferArgs(t *testing.T) {
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
func TestIssue1374(t *testing.T) {
|
||||
// Continue did not work when stopped at a breakpoint immediately after calling CallFunction.
|
||||
protest.MustSupportFunctionCalls(t, testBackend)
|
||||
withTestProcess("issue1374", t, func(p proc.Process, fixture protest.Fixture) {
|
||||
setFileBreakpoint(p, t, fixture, 7)
|
||||
assertNoError(proc.Continue(p), t, "First Continue")
|
||||
assertLineNumber(p, t, 7, "Did not continue to correct location (first continue),")
|
||||
assertNoError(proc.CallFunction(p, "getNum()", &normalLoadConfig, true), t, "Call")
|
||||
err := proc.Continue(p)
|
||||
if _, isexited := err.(proc.ErrProcessExited); !isexited {
|
||||
regs, _ := p.CurrentThread().Registers(false)
|
||||
f, l, _ := p.BinInfo().PCToLine(regs.PC())
|
||||
t.Fatalf("expected process exited error got %v at %s:%d", err, f, l)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user