help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Debugger in Octave


From: Neil Ghosh
Subject: Re: Debugger in Octave
Date: Sat, 6 Nov 2010 00:41:29 +0530



On Sat, Nov 6, 2010 at 12:23 AM, Martin Helm <address@hidden> wrote:
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.



Thanks for the explanation.
This is what I wanted to know.

--
Thanks and Regards
Neil
http://neilghosh.com




reply via email to

[Prev in Thread] Current Thread [Next in Thread]