Re: what happens before main()?
Ivan Ostres <[email protected]>
| Newsgroups | gmane.comp.macosx.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi! To every C/C++ program, startup file is added - like /usr/lib/crt1.o which does initializations. Since it was not compiled with -g, you can't really step through it but you could find source for it (if available) and compile it yourself and add it to your program instead of standard crt*.o. In that case you could step through it. Regards, Ivan P.S. You can check gcc/ld documentation which exact startup file is linked to your program to be sure On Apr 27, 2010, at 11:59 AM, Aya Koshigaya wrote: > Hi, > > I have a big library written in C++, in this lib there are several > static-things that get initialised at the start of the Programm, > even before the main() function is called. > > So far so good, but the problem is - the program takes some time to > start, and when I did some time-trackings to see where the time > goes, I found out it takes already up to 3 seconds until my main() > function is called. > > But, since there are about 300-400 Files it would take forever to > find the "bad" statics.. so, is there any way in Xcode to step > trough the initialisation process? Like as if I'd put a breakpoint > in the main() function and step forward.. but in the main method > it's already to late :( > > Aya~_______________________________________________ > MacOSX-dev mailing list > [email protected] > http://www.omnigroup.com/mailman/listinfo/macosx-dev >