| |||
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
On 2-Aug-06, at 12:27 PM, Scott Ribe wrote:
Sigh... I'm smashing the stack, leaving things where XCode doesn't show any useful info when it breaks.
Suggestions:
1) Look carefully at what is on the stack. Try to figure out what those hex bytes might represent - that could give you a clue. If there is a common pattern of hex bytes on the stack when the problem occurs, maybe installing a conditional break point in gdb will allow you to determine where the problem occurs.
2) Scan your code for functions whose return values are larger than what would fit in a register - e.g. functions that return a struct or object by value. Look carefully at those functions. I've some times seen cases where the return statement was missing and, for some reason that I don't understand, the compiler wasn't complaining.
3) Turn on all warnings in gcc. Also try running 'lint' on your code.
4) Try divide & conquer techniques like commenting out half of your code and seeing if the problem occurs.
-- Cameron Hayne email@hidden
David _______________________________________________ Do not post admin requests to the list. They will be ignored. Xcode-users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/xcode-users/email@hidden
| References: | |
| >Tips for debugging stack smash? (From: Scott Ribe <email@hidden>) | |
| >Re: Tips for debugging stack smash? (From: Cameron Hayne <email@hidden>) |
| Home | Archives | FAQ | Terms/Conditions | Contact | RSS | Lists | About |
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE
Contact Apple | Terms of Use | Privacy Policy
Copyright © 2007 Apple Inc. All rights reserved.