delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/12/22/10:16:15

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Date: Mon, 22 Dec 2003 10:15:38 -0500
From: Steve Coleman <Steve DOT Coleman AT jhuapl DOT edu>
Subject: Re: How to set breakpoints before mainCRTStartup?
In-reply-to: <3FE49F02.2010904@kaffe.org>
To: cygwin AT cygwin DOT com
Message-id: <3FE70A9A.6070005@jhuapl.edu>
MIME-version: 1.0
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.5) Gecko/20031007
References: <3FE341DF DOT 90800 AT kaffe DOT org> <3FE49F02 DOT 2010904 AT kaffe DOT org>
X-IsSubscribed: yes

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.
>
<snip>

>> 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.

Steve.




--
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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019