Debugging Octave: Difference between revisions

From Octave
Jump to navigation Jump to search
Line 12: Line 12:
= Tools for debugging =
= Tools for debugging =
== GBD ==
== GBD ==
To start Octave under gdb use the script <code> run-octave </code> at the top level of the source tree and run it with the command-line option <code> -g </code>like this
<code>
cd /octave/source/tree
./run-octave -g
</code>
=== Most used commands ===
=== Most used commands ===
[http://www.gnu.org/software/gdb/documentation gdb documentation]
[http://www.gnu.org/software/gdb/documentation gdb documentation]

Revision as of 10:44, 18 July 2012

Preliminaries

Since compilation of all the source from scratch can take long it is good to have a source folder where most of the source has been compiled. To do this ...

Workflow

  1. Clone the repository
  2. Regenerate the scripts
  3. Configure

Basic debugging processes

Error & trace the stack

Tools for debugging

GBD

To start Octave under gdb use the script run-octave at the top level of the source tree and run it with the command-line option -g like this

cd /octave/source/tree ./run-octave -g


Most used commands

gdb documentation

Emacs

In short:

To start Octave in debug mode within emacs type

M-x gud-gdb

then change the command in the minibuffer to

Run gud-gdb (like this): /path/to/octave/source/tree/run-octave -gud

For more info use this link to the emacs manual section on debuggers operation

ddd

gui for gdb