realbasic-betas.mbox
[Top] [All Lists]

Re: Failure Assertion Exception

To: REALbasic Betas <realbasic-betas at lists dot realsoftware dot com>
Subject: Re: Failure Assertion Exception
From: Lo Saeteurn <realbasiclist at mac dot com>
Date: Tue, 30 Jul 2002 11:50:51 -0700
on 7/30/02 9:54 AM, Charles Yeomans at yeomans at desuetude dot com wrote:

> Have you tried the following?  Add a global constant debugMode as
> Boolean.  Then add the code below to every method, event handler, and
> menu handler.
> 
> 
> //all other declarations
> Const methodName = "ClassName.MethodName"
> 
> #if debugMode
> WriteMessage methodName + "..."
> #endif
> 
> //your code
> 
> #if debugMode
> WriteMessage methodName + "complete"
> #endif
> //return statement here for functions
> 
> WriteMessage would send the message to the Console in OS X; in OS 9, I
> suppose you could send it to Macsbug (I'm not sure about this), or a
> text file.  A log window in the app might work as well.
> 
> Compile your project with debugMode = true.  Play with your app until it
> spits up an RB assertion failure.  You now know in which method the
> assertion failure occurred.  Once you know this, you can play the same
> game until you've pinned down the precise line at which the assertion
> failure occurs.  Now you have something useful to tell RS.

I tried something similar to this but using a modal dialog telling which
method it is currently in. I put it in the methods that would have something
to do with the failure assertion.

The problem is that the methods are long and runs other methods many times.
It is the methods (same ones may be executed many times) within a method
that are the problem. It is very time consuming on pinning the actual line
of code, even if you find the method that is the cause because then you have
to duplicate the failed assertion (that happens average at every 30min-1
hour) line by line. If you have like over a hundred lines (like me) that
would take a few days of continuous work (and patience) that many of us
(like me) don't have.

Sure I can eventually fix failure assertions (I have like 8 different known
ones, 5 (mostly) fixed), but why do we need to spend so much time debugging
when it is not really necessary if we just have an exception raised. We then
can spend much more time on improving the program rather than fixing bugs.



<Prev in Thread] Current Thread [Next in Thread>