reursion debugging

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

reursion debugging

Gorazd Brumen
Dear all,

I have written a program, which is deeply recursive. There are around
4 functions with each calling some others recursively.

Can somebody suggest me a good way to debug this, or more generally
a good debugger for octave?


Regards,
GOrazd


--
Gorazd Brumen
Mail: [hidden email]
WWW: http://valjhun.fmf.uni-lj.si/~brumen
PGP: Key at http://pgp.mit.edu, ID BCC93240



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------

Reply | Threaded
Open this post in threaded view
|

Re: reursion debugging

Robert A. Macy
Not understanding debuggers, I always write my own.

insert judicious code that writes important benchmark
values to a file for later review. Or display on the screen
and watch it go by

           - Robert -


On Thu, 23 Feb 2006 15:43:42 +0100
 Gorazd Brumen <[hidden email]> wrote:

> Dear all,
>
> I have written a program, which is deeply recursive.
> There are around
> 4 functions with each calling some others recursively.
>
> Can somebody suggest me a good way to debug this, or more
> generally
> a good debugger for octave?
>
>
> Regards,
> GOrazd
>
>
> --
> Gorazd Brumen
> Mail: [hidden email]
> WWW: http://valjhun.fmf.uni-lj.si/~brumen
> PGP: Key at http://pgp.mit.edu, ID BCC93240
>



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------

Reply | Threaded
Open this post in threaded view
|

Re: reursion debugging

Joe Koski
on 2/23/06 9:07 AM, Robert A. Macy at [hidden email] wrote:

> Not understanding debuggers, I always write my own.
>
> insert judicious code that writes important benchmark
> values to a file for later review. Or display on the screen
> and watch it go by
>
>            - Robert -
>
Robert

I agree with your philosophy of adding output when debugging octave code,
but there is one additional point:  Octave is usually very good about
telling you where it quit and why. From that point of view, octave already
has a built-in interactive debugger.

Joe

>
> On Thu, 23 Feb 2006 15:43:42 +0100
>  Gorazd Brumen <[hidden email]> wrote:
>> Dear all,
>>
>> I have written a program, which is deeply recursive.
>> There are around
>> 4 functions with each calling some others recursively.
>>
>> Can somebody suggest me a good way to debug this, or more
>> generally
>> a good debugger for octave?
>>
>>
>> Regards,
>> GOrazd
>>
>>
>> --
>> Gorazd Brumen
>> Mail: [hidden email]
>> WWW: http://valjhun.fmf.uni-lj.si/~brumen
>> PGP: Key at http://pgp.mit.edu, ID BCC93240
>>
>
>
>
> -------------------------------------------------------------
> Octave is freely available under the terms of the GNU GPL.
>
> Octave's home on the web:  http://www.octave.org
> How to fund new projects:  http://www.octave.org/funding.html
> Subscription information:  http://www.octave.org/archive.html
> -------------------------------------------------------------
>




-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------

Reply | Threaded
Open this post in threaded view
|

Re: reursion debugging

Gorazd Brumen
hi guys,

yes, that is ok if you have linear code, but not when you have
recursion. then you usually get thousands of output messages,
when the recursion stack unfolds.
is there really nothing sensible?

g.

Joe Koski wrote:

> on 2/23/06 9:07 AM, Robert A. Macy at [hidden email] wrote:
>
>
>>Not understanding debuggers, I always write my own.
>>
>>insert judicious code that writes important benchmark
>>values to a file for later review. Or display on the screen
>>and watch it go by
>>
>>           - Robert -
>>
>
> Robert
>
> I agree with your philosophy of adding output when debugging octave code,
> but there is one additional point:  Octave is usually very good about
> telling you where it quit and why. From that point of view, octave already
> has a built-in interactive debugger.
>
> Joe
>
>
>>On Thu, 23 Feb 2006 15:43:42 +0100
>> Gorazd Brumen <[hidden email]> wrote:
>>
>>>Dear all,
>>>
>>>I have written a program, which is deeply recursive.
>>>There are around
>>>4 functions with each calling some others recursively.
>>>
>>>Can somebody suggest me a good way to debug this, or more
>>>generally
>>>a good debugger for octave?
>>>
>>>
>>>Regards,
>>>GOrazd
>>>
>>>
>>>--
>>>Gorazd Brumen
>>>Mail: [hidden email]
>>>WWW: http://valjhun.fmf.uni-lj.si/~brumen
>>>PGP: Key at http://pgp.mit.edu, ID BCC93240
>>>
>>
>>
>>
>>-------------------------------------------------------------
>>Octave is freely available under the terms of the GNU GPL.
>>
>>Octave's home on the web:  http://www.octave.org
>>How to fund new projects:  http://www.octave.org/funding.html
>>Subscription information:  http://www.octave.org/archive.html
>>-------------------------------------------------------------
>>
>
>
>
>
>
> -------------------------------------------------------------
> Octave is freely available under the terms of the GNU GPL.
>
> Octave's home on the web:  http://www.octave.org
> How to fund new projects:  http://www.octave.org/funding.html
> Subscription information:  http://www.octave.org/archive.html
> -------------------------------------------------------------
>
>

--
Gorazd Brumen
Mail: [hidden email]
WWW: http://valjhun.fmf.uni-lj.si/~brumen
PGP: Key at http://pgp.mit.edu, ID BCC93240



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------

Reply | Threaded
Open this post in threaded view
|

Re: reursion debugging

Robert A. Macy
Uh,...write the code so every 1000th state gets put out.  

Or, everytime something significant happens, like the error
reduced by a factor of 1/2, or,...

Be sure to include a state of the variables for perusal.
 Then you get "snapshots" as the process (hopefully)
converges.  

Be careful of the 'sampling' approach, with oscillatory
convergence, you can get aliasing and some weird cycling.
 Sometimes a 'maximum' within a window works best.  Like
the sampling scopes do to catch wild peak bursts.  

        - Robert -

On Thu, 23 Feb 2006 18:18:41 +0100
 Gorazd Brumen <[hidden email]> wrote:

> hi guys,
>
> yes, that is ok if you have linear code, but not when you
> have
> recursion. then you usually get thousands of output
> messages,
> when the recursion stack unfolds.
> is there really nothing sensible?
>
> g.
>
> Joe Koski wrote:
> > on 2/23/06 9:07 AM, Robert A. Macy at
> [hidden email] wrote:
> >
> >
> >>Not understanding debuggers, I always write my own.
> >>
> >>insert judicious code that writes important benchmark
> >>values to a file for later review. Or display on the
> screen
> >>and watch it go by
> >>
> >>           - Robert -
> >>
> >
> > Robert
> >
> > I agree with your philosophy of adding output when
> debugging octave code,
> > but there is one additional point:  Octave is usually
> very good about
> > telling you where it quit and why. From that point of
> view, octave already
> > has a built-in interactive debugger.
> >
> > Joe
> >
> >
> >>On Thu, 23 Feb 2006 15:43:42 +0100
> >> Gorazd Brumen <[hidden email]> wrote:
> >>
> >>>Dear all,
> >>>
> >>>I have written a program, which is deeply recursive.
> >>>There are around
> >>>4 functions with each calling some others recursively.
> >>>
> >>>Can somebody suggest me a good way to debug this, or
> more
> >>>generally
> >>>a good debugger for octave?
> >>>
> >>>
> >>>Regards,
> >>>GOrazd
> >>>
> >>>
> >>>--
> >>>Gorazd Brumen
> >>>Mail: [hidden email]
> >>>WWW: http://valjhun.fmf.uni-lj.si/~brumen
> >>>PGP: Key at http://pgp.mit.edu, ID BCC93240



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------

Reply | Threaded
Open this post in threaded view
|

Re: reursion debugging

Robert A. Macy
In reply to this post by Joe Koski
I agree that octave is some of the best behaved software
I've run on several windows platforms.  

But, alas, I use the old binary 2.1.50a and it often does
not exit well when a calamity occurs.  Translates to not a
single file left around, not even the history of the
statements up to the failure as they're being typed in
shows up.  Often no idea what happened.

But, it's a little like the doctor's advice, "Don't do
that."  So, I just avoid calamities.  <g>

                  - Robert -

On Thu, 23 Feb 2006 09:37:06 -0700
 Joe Koski <[hidden email]> wrote:

> on 2/23/06 9:07 AM, Robert A. Macy at [hidden email]
> wrote:
>
> > Not understanding debuggers, I always write my own.
> >
> > insert judicious code that writes important benchmark
> > values to a file for later review. Or display on the
> screen
> > and watch it go by
> >
> >            - Robert -
> >
> Robert
>
> I agree with your philosophy of adding output when
> debugging octave code,
> but there is one additional point:  Octave is usually
> very good about
> telling you where it quit and why. From that point of
> view, octave already
> has a built-in interactive debugger.
>
> Joe
>
> >
> > On Thu, 23 Feb 2006 15:43:42 +0100
> >  Gorazd Brumen <[hidden email]> wrote:
> >> Dear all,
> >>
> >> I have written a program, which is deeply recursive.
> >> There are around
> >> 4 functions with each calling some others recursively.
> >>
> >> Can somebody suggest me a good way to debug this, or
> more
> >> generally
> >> a good debugger for octave?
> >>
> >>
> >> Regards,
> >> GOrazd
> >>
> >>
> >> --
> >> Gorazd Brumen
> >> Mail: [hidden email]
> >> WWW: http://valjhun.fmf.uni-lj.si/~brumen
> >> PGP: Key at http://pgp.mit.edu, ID BCC93240
> >>
> >
> >
> >
> >
>
-------------------------------------------------------------

> > Octave is freely available under the terms of the GNU
> GPL.
> >
> > Octave's home on the web:  http://www.octave.org
> > How to fund new projects:
>  http://www.octave.org/funding.html
> > Subscription information:
>  http://www.octave.org/archive.html
> >
>
-------------------------------------------------------------
> >
>
>
>
>
>
-------------------------------------------------------------
> Octave is freely available under the terms of the GNU
> GPL.
>
> Octave's home on the web:  http://www.octave.org
> How to fund new projects:
>  http://www.octave.org/funding.html
> Subscription information:
>  http://www.octave.org/archive.html
>
-------------------------------------------------------------
>



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------