View unanswered posts | View active topics It is currently Tue Sep 02, 2014 8:08 am






Reply to topic  [ 3 posts ] 
1.40 debugger: stop runtime? view of local vars? exceptions? 
Author Message
Guru
User avatar

Joined: Sat Mar 01, 2008 12:52 pm
Posts: 1030
Post 1.40 debugger: stop runtime? view of local vars? exceptions?
hello,
in case of runtime errors caused by invalid math operations
- e. g. caused by division by zero, or square root of a negative number
- other operations that lead to nan's ,

1. the debugger should stop the execution at the faulty line automatically, and
2. there should be a way to check all corresponding local and temporary variables at this moment to find out the reason of the wrong calculation.
3. In case one even expects that an error might happen, there could be sort of exception handling; in JAVA there is a
try... throw exception
construct, but I unfortunately don't know the corresponding C commands.

Are there already such chances?

_________________
regards,
HaWe aka Ford
#define S sqrt(t+2*i*i)<2
#define F(a,b) for(a=0;a<b;++a)
float x,y,r,i,s,j,t,n;task main(){F(y,64){F(x,99){r=i=t=0;s=x/33-2;j=y/32-1;F(n,50&S){t=r*r-i*i;i=2*r*i+j;r=t+s;}if(S){PutPixel(x,y);}}}while(1)}


Tue Aug 05, 2008 6:11 am
Profile
Creator
Creator

Joined: Fri Feb 09, 2007 9:21 am
Posts: 615
Post Re: 1.40 debugger: stop runtime? view of local vars? exceptions?
C++ has a "TRY and CATCH" mechanism similar to the JAVA method. There is not a corresponding capability in the C language.

ROBOTC does catch many run-time exceptions and suspends your program. You can then manually examine program variables and the PC to determine the cause of the bug.


Fri Aug 15, 2008 3:58 am
Profile
Guru
User avatar

Joined: Sat Mar 01, 2008 12:52 pm
Posts: 1030
Post Re: 1.40 debugger: stop runtime? view of local vars? exceptions?
hello,
thx for the reply.
As I recently wrote even in the bug tracker, the debugger doesn't stop the program execution in time, so that it's not possible to check the related variables in different tasks just when e.g. a nan error occurs (just like it does in case of wrong array bounds).
In the bug tracker, I sent you a program source and above that a variable file "memory.dat", which contains the saved structure variable data just 1 step before the "-nan" errors occur.
Maybe you can check this and then tell us how this happens and/or how to search for the related bug(s) or malfunction(s).

_________________
regards,
HaWe aka Ford
#define S sqrt(t+2*i*i)<2
#define F(a,b) for(a=0;a<b;++a)
float x,y,r,i,s,j,t,n;task main(){F(y,64){F(x,99){r=i=t=0;s=x/33-2;j=y/32-1;F(n,50&S){t=r*r-i*i;i=2*r*i+j;r=t+s;}if(S){PutPixel(x,y);}}}while(1)}


Fri Aug 15, 2008 4:15 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 3 posts ] 

Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  



Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.