This is the mail archive of the mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: How to set breakpoints before mainCRTStartup?

Dalibor Topic wrote:

Dalibor Topic wrote:

Hi all,

in my attempts to fix an ugly bug in kaffe on Cygwin, the bug I'm trying to squish turned out to be triggered by something that happens *before* main is called.


Since I'd like to know what modifes that opcode, I hope to be able to set a breakpoint in gdb on the code that is executed before main in Cygwin.

Try running gdb with the "-command=<file name>" option and put a line in it like "br myfunc". I have not tried this with cygwin gdb but it works for me on several other OS's i use.

Any idea how to do that, i.e. where to put the breakpoint? Are there some docs on what happends before main() on cygwin that I could look up for reference while trying to hunt down this bug?

It turns out that the bug happens even before mainCRTStartup.

Has anyone seen something like that before?

I have seen something like this before. If it is a C++ app then it may be a constructor in a statically or golbally declared object instance. The compiler should generate code to call all the global object constructors for initializing these objects *before* calling main().

Hope this helps.


-- Unsubscribe info: Problem reports: Documentation: FAQ:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]