[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Debugger in Octave
From: |
Martin Helm |
Subject: |
Re: Debugger in Octave |
Date: |
Fri, 5 Nov 2010 19:53:24 +0100 |
User-agent: |
KMail/1.13.5 (Linux/2.6.34.7-0.5-desktop; KDE/4.5.3; x86_64; ; ) |
Am Freitag, 5. November 2010, 19:33:41 schrieb Neil Ghosh:
> On Mon, Nov 1, 2010 at 5:22 PM, Martin Helm <address@hidden> wrote:
> > Am Montag, 1. November 2010, 11:48:40 schrieb Neil Ghosh:
> > > Is there any debugger Octave ? For line by line debugging and watching
> > > variables ?
> >
> > In the manual (you should have a pdf or html version with your octave
> > installation) there is a chapter about debugging (in the current version
> > it is
> > ch 13, but not sure if that was the same in older versions).
> >
> > Some important functions are
> > dbstop, dbclear: to set and clear breakpoints
> > dbcont, dbstep: to continue exectution
> >
> > look at them with the help command to get the details.
>
> I saw the doc
> http://www.gnu.org/software/octave/doc/interpreter/Debugging.html#Debugging
> Could not figure out how to debug my function in a file myFunc.m
>
> It will be great if you could give me small example how to use these
> debugging function
I am not completely sure what to show you. I assume you have a script
schrott.m with the content
1
printf("%s", program_invocation_name)
in octave I do
octave:1> dbstop("schrott", 1)
ans = 1
octave:2> dbstatus
breakpoint in schrott at line(s) 1.
octave:3> schrott
stopped in /home/martinh/Projekte/octave/schrott.m at line 1
1: 1
debug> dbcont
ans = 1
octaveoctave:4>
(the first octave in the previous line is what the script printed)
>From the debug prompt you can also inspect variables or do single steps with
dbstep.