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

 채택된 답변

Walter Roberson
Walter Roberson 2013년 3월 25일

3 개 추천

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

dav
dav 2013년 3월 25일
편집: dav 2013년 3월 25일
thanks. does the program slow down when I use dbstop, dbcont ....
and should I use dbcont with dbstop?
Walter Roberson
Walter Roberson 2013년 3월 25일
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 2013년 3월 25일
should I use dbstop with dbcont?
Walter Roberson
Walter Roberson 2013년 3월 25일
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 2013년 3월 25일
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?
Walter Roberson
Walter Roberson 2013년 3월 25일
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 2013년 3월 25일
편집: dav 2013년 3월 25일
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 2013년 3월 25일
편집: dav 2013년 3월 25일
thanks.. can I use this after the program is run?
Thanks again for all the help!
Walter Roberson
Walter Roberson 2013년 3월 25일
Yes, you can use dbstack any time the program is at the K> prompt.
dav
dav 2013년 3월 26일
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 2013년 3월 26일
thanks Walter.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Debugging and Analysis에 대해 자세히 알아보기

질문:

dav
2013년 3월 25일

Community Treasure Hunt

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

Start Hunting!

Translated by