help-octave
[Top][All Lists]
Advanced

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

Re: keyboard or dbstop


From: Philip Nienhuis
Subject: Re: keyboard or dbstop
Date: Tue, 04 Feb 2014 18:54:50 +0100
User-agent: Mozilla/5.0 (Windows NT 5.1; rv:25.0) Gecko/20100101 Firefox/25.0 SeaMonkey/2.22.1

Helios de Rosario wrote:
(It was Re: showtrainprogress: invalid conversion from NaN to logical)

On 30/01/2014 at 23:24, Philip Nienhuis <address@hidden>
wrote:

[... snip the error report of the OP, which I think is not crucial for
my question ...]

You can safely assume that Octave doesn't complain about the if
statement in
L. 304 for nothing. So the question is how to find out what is wrong
there.

Well, insert a keyboard statement in empty line 302 and run your
code.

I would have set a breakpoint with
dbstop("/home/syedk/OCT/nnet/tests/MLP/__trainlm.m", 302) instead. I
always felt that debugging with "keyboard" is quite uncomfortable,
because you must edit the file once and again. But I also wondered if
there is some reason that I'm missing, why it could be more
recommendable in some cases. Do you have such reason for recommending
inserting the keyboard statement in this case? Or it is just a matter of
taste?

Both.

For one, dbstop didn't always work for me (execution would just ignore the dbstop breakpoint); especially not with function in "private" subdirs. (Auto-) Saving the function/script file (which I regularly do while debugging problems - don't you?) might also wipe breakpoints. In this respect your "edit file once and again" point is a bit lost on me :-)

So I use a keyboard statement as a guaranteed interruption.

Philip


reply via email to

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