提交 5c9b2009 编写于 作者: A aarzilli 提交者: Derek Parker

proc: change next to skip deferred functions

Make 'next' skip deferred functions unless they are called via a panic.
Call to a deferred function through 'return' are predictable, if the
user wants to step into them 'step' can be used but without this change
there is no way to avoid stepping into them.

Implements #956
上级 2c0e3116
......@@ -590,18 +590,12 @@ func TestNextFunctionReturnDefer(t *testing.T) {
{5, 6},
{6, 9},
{9, 10},
{10, 6},
{6, 7},
{7, 8},
}
} else {
testcases = []nextTest{
{5, 8},
{8, 9},
{9, 10},
{10, 6},
{6, 7},
{7, 8},
}
}
protest.AllowRecording(t)
......@@ -2132,10 +2126,6 @@ func TestNextDeferReturnAndDirectCall(t *testing.T) {
{10, 11},
{11, 12},
{12, 13},
{13, 5},
{5, 6},
{6, 7},
{7, 13},
{13, 28}}, "main.callAndDeferReturn", t)
}
......
......@@ -196,7 +196,7 @@ func next(dbp Process, stepInto bool) error {
return err
}
}
if bp != nil {
if bp != nil && stepInto {
bp.DeferReturns = deferreturns
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册