Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Message-ID: <3FE87A1C.1020405@kaffe.org> Date: Tue, 23 Dec 2003 18:23:40 +0100 From: Dalibor Topic User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3) Gecko/20030312 MIME-Version: 1.0 To: Steve Coleman CC: cygwin AT cygwin DOT com Subject: Re: How to set breakpoints before mainCRTStartup? References: <3FE341DF DOT 90800 AT kaffe DOT org> <3FE49F02 DOT 2010904 AT kaffe DOT org> <3FE70A9A DOT 6070005 AT jhuapl DOT edu> In-Reply-To: <3FE70A9A.6070005@jhuapl.edu> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by AMaViS perl-11 X-IsSubscribed: yes Steve Coleman wrote: > 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=" 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(). Thanks, but kaffe is written in C, so global constructors can't be a problem here. OTOH, maybe some part of Cygwin is written in C++ and may be responsible for the damage? cheers, dalibor topic -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/