Re: Disappointed with XCode debugging
Re: Disappointed with XCode debugging
- Subject: Re: Disappointed with XCode debugging
- From: Ricky Sharp <email@hidden>
- Date: Sun, 18 Apr 2004 08:54:19 -0500
On Apr 18, 2004, at 3:03 AM, Jens Miltner wrote:
Am 18.04.2004 um 07:41 schrieb Eric Albert:
Not directly, but I'll toss out a few guesses:
-Try turning ZeroLink off. With it on, the load order of various
modules in your executable may be different from what you'd typically
expect, and your variables might not be getting initialized
correctly.
-Double-check the way your static arrays get initialized. The order
of static variable initialization across modules in a Mach-O
executable may be different from what you expect in CFM.
Furthermore, having two different sections of global initialization
depend on each other is bound to lead to trouble, as the order of
global/static initialization is explicitly not guaranteed. In fact,
I've been hit by this before without even changing compiler vendors
due to either some rearrangement of link order or due to a change in
Metrowerk's compiler/linker technology.
If you have interdependent static objects, even the rule "a static
object is guaranteed to be intialized when the module where it's
defined is first entered" may not hold true...
The lesson I've learned is that if you need your variables/objects to
be initialized at a specifc point, don't rely on global "pre-main"
allocation/initialization!
Hmm. It wouldn't be too difficult to create an "initializer" object
whose sole purpose in life is to initialize all my static data. I
could then just call that as the first order of business in main.
Or, I extend the logic in my various Initialize methods to include all
class data.
Thanks!
___________________________________________________________
Ricky A. Sharp mailto:email@hidden
Founder & President
Instant Interactive(tm) http://www.instantinteractive.com
_______________________________________________
xcode-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/xcode-users
Do not post admin requests to the list. They will be ignored.