Debugging Octave: Difference between revisions

67 bytes removed ,  4 April 2014
Line 54: Line 54:
== Producing a stack trace ==
== Producing a stack trace ==


Sometimes Octave will crash, meaning, it terminates abruptly and returns control to the operating system shell. In these cases, it is very helpful to produce a stack trace to diagnose the problem. To do so, you need to (re)compile Octave with debugging symbols and run the debugger, as explained above. Then, run Octave:
Sometimes Octave will crash, meaning, it terminates abruptly and returns control to the operating system shell. In these cases, it is very helpful to produce a stack trace to diagnose the problem. To do so, you need to (re)compile Octave with debugging symbols and run the debugger, as explained above. Then execute whatever commands are necessary to cause Octave to crash. At that point, you will be back in a gdb session. Type <code>where</code> at the gdb prompt to obtain a stack trace.
 
<syntaxhighlight lang="bash">
gdb> run
</syntaxhighlight>
 
execute whatever commands you think are necessary to produce the crash. When Octave crashes, you will be back in a gdb session. Type <code>bt</code> here to obtain a stack trace.


=== Most used commands ===
=== Most used commands ===