I don't mean to keep plugging PC, but well, this is what it's for so...
Reminder: Project Cuisinart does just what Charles is suggesting,
automatically. I don't think I'd want to try to retro-fit a large
program that way by hand. ;-)
PC displays the traces in a global floater (which you can hide if you
like), can save the trace to file as it goes, and indents at each call
level to increase readability. It's currently the best way available to
track down failed assertions and hard crashes. If you don't mind taking
a speed hit, you can make it log every single line in one or all code
blocks too. It can also be useful if you have a flow-control or
event-order bug you're trying to nail down.
- Nathan
On Tuesday, July 30, 2002, at 08:02 PM, REALbasic Developer Releases
wrote:
Subject: Re: Failure Assertion Exception
From: "Charles Yeomans" <yeomans at desuetude dot com>
Date: Tue, 30 Jul 2002 12:54:42 -0400
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.
Charles Yeomans
|