How is the octave debugger used?

后端 未结 2 1082
梦毁少年i
梦毁少年i 2021-01-02 23:07

So I\'m trying to use the octave debugger to detect where division by zero happens. For that it seems logical to use \"debug_on_warning ()\". However I\'m just not understan

2条回答
  •  星月不相逢
    2021-01-02 23:50

    Solution for setting a breakpoint in octave

    Set breakpoint in file myOctaveCode.m in line 18

    dbstop myOctaveCode 18
    

    Call function

    myOctaveCode
    

    Debugger stops

    stopped in /.../myOctaveCode.m at line 18
    ...
    

    Now I can use the debugger

    debug> who
    
    Variables in the current scope:
    ... 
    

    When calling dbstep I will jump to the next line

    debug> dbstep
    

    Documentation: https://octave.org/doc/v4.4.1/Debug-Mode.html#Debug-Mode

    Remark

    My answer just fits to the question's title. It's not an exact answer for the question. But I hope it might help others who stumble upon that question while searching for general octave debugging hints. So please do not vote me down.

提交回复
热议问题