Editing Debugging Octave

Jump to navigation Jump to search
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.

Latest revision Your text
Line 108: Line 108:
[http://www.gnu.org/software/gdb/documentation gdb documentation]
[http://www.gnu.org/software/gdb/documentation gdb documentation]


The following command shows the back trace of all threads belonging to the Octave process:
For debugging octave_value variables (e.g. <code>my_octave_value</code>) to find out what the variable actually is (instead of just it's base class):
 
<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
(gdb) thread apply all bt
(gdb) print *(my_octave_value.rep)
</syntaxhighlight>
</syntaxhighlight>


For debugging octave_value variables (e.g. <code>my_octave_value</code>) to find out what the variable actually is (instead of just it's base class):
The following command shows the back trace of all threads belonging to the Octave process:
<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
(gdb) print *(my_octave_value.rep)
(gdb) thread apply all bt
</syntaxhighlight>
</syntaxhighlight>
The file <code>etc/gdbinit</code> in the Octave repository contains some macros that can be helpful:
* <code>display-dims DIM_VECTOR</code>: Display the contents of an Octave dimension vector.
* <code>display-dense-array ARRAY</code>: Display the contents of an ordinary, i.e., dense Octave array.
* <code>display-sparse-array SPARSE_ARRAY</code>: Display the contents of a sparse Octave array.
* <code>show-octave-dbstack</code>: Display the contents of the current Octave debugging stack.


== ddd ==
== ddd ==
Please note that all contributions to Octave may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see Octave:Copyrights for details). Do not submit copyrighted work without permission!

To edit this page, please answer the question that appears below (more info):

Cancel Editing help (opens in new window)