我在用GNU octave 3.6.4。根据变化率g(v3.2)
使用dbup和dbdown上下移动调用堆栈,现在可以工作了。
但是,当我处于调试模式下,然后是dbup,然后是dbnext,下一帧中的下一行将被执行。为何会这样,又如何避免呢?
octave -q
octave:1> myfunc_base(2,3)
stopped in /home/seb/octave/myfunc.m at line 5
5: keyboard
debug> dbstack
stopped in:
--> myfunc at line 5 [/home/seb/octave/myfunc.m]
myfunc_base at line 4 [/home/seb/octave/myfunc_base.m]
debug> dbup
stopped in myfunc_base at line 4 % <-- looks good!
debug> dbnext
stopped in /home/seb/octave/myfunc.m at line 6 % <-- damn this is the old frame!
6: sp = a + temp;
debug> 这两个测试功能:
myfunc.m
function sp = myfunc (a, b, c)
temp = b+c;
keyboard
sp = a + temp;
end myfunc_base.m
function sp = myfunc_base (aa, bb)
temp = myfunc(aa, aa, bb);
sp = aa + temp;
end 发布于 2013-11-13 11:36:42
要想走出困境,您必须使用dbstep out。这与matlab的行为相匹配,其他的一切都会非常奇怪。如果出现异常,则不能跳转到堆栈任何级别上的下一行。
https://stackoverflow.com/questions/19952024
复制相似问题