stopped in debugger question

Hi,
I was running a program with a dbstop if NAN/inf line.
The program ran and gave results. however, at the bottom where it normally says 'busy' when a program is i progress, it said stopped at debugger. There was no error displayed and the result I got were good.
Should I worry about it?
Thanks

 Risposta accettata

You could give the command
dbcont
and see what happened. Or you could give the command
dbstack
to see where it thought it was stopped.

13 Commenti

dav
dav il 25 Mar 2013
Modificato: dav il 25 Mar 2013
thanks. does the program slow down when I use dbstop, dbcont ....
and should I use dbcont with dbstop?
The program will probably run slower when you use that form of dbstop.
dbcont can be used to resume execution. There is also a menu button to resume execution.
dav
dav il 25 Mar 2013
should I use dbstop with dbcont?
It doesn't matter. You can create breakpoints from the command line with dbstop, or you can create them through menus. The effect is the same. Likewise, if you are stopped at the debugger prompt and you wish to continue, you can use dbcont or you can use the menus to continue.
dbcont will give you an error if you are not stopped at the debugger prompt. If you have just issued a "dbstop" command in preparation for running something, but you are not at the debugger prompt, then do not use dbcont: start the program the normal way.
dav
dav il 25 Mar 2013
thanks. could you please explain why I got results at the end of the program when it said 'stopped at debugger'?
to my understanding if it stops at debugger the program stops there.. am I right?
No, stopped in debugger means the program is paused. You can interact with the program variables and continue running further.
If you stopped in the debugger because of an error caught with "dbstop if error" then it will stop before the error has been sent upwards to containing routines. In such as situation, continuing running might not do you any good. (But "dbstop if caught error" is meaningful and continuing from that situation is useful.)
dav
dav il 25 Mar 2013
Modificato: dav il 25 Mar 2013
So that means if the results I get are believable even if it says stopped at debugger, I don't have to worry about it?
the reason why I asked this was:
I ran a large simulation program last night and when I checked it this morning I had gotten the results however it said stopped at debugger at the bottom and the command prompt was 'K >>'
It means you should use the command
dbstack
to find out why it was stopped.
dav
dav il 25 Mar 2013
Modificato: dav il 25 Mar 2013
thanks.. can I use this after the program is run?
Thanks again for all the help!
Yes, you can use dbstack any time the program is at the K> prompt.
I did what you had suggested and got the following.
K>> dbstack
> In fminseasonal at 710
BUT, fminseasonal is not the program I was running. fminseasonal was a program I use before and I used fmincon to do estimation in it.
However, I did not use fmincon in this program. I used lsqlin..
I think it's in matlab memory. Is there a way to clear all saved command before running a new program? I am using clc and clear in my code. but it doesn't seem to clear well.
thanks
dbquit
and keep doing that until you are no longer at the debugger prompt.
The good news is that your newer program likely ended fine.
dav
dav il 26 Mar 2013
thanks Walter.

Accedi per commentare.

Più risposte (0)

Categorie

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by