From: cgf AT cygnus DOT com (Christopher Faylor) Subject: Re: debugging cygwin DLL loaded by LoadLibrary?? 28 Oct 1998 15:04:48 -0800 Message-ID: <19981028173648.A17873.cygnus.cygwin32.developers@cygnus.com> References: <19981028145228 DOT A16302 AT cygnus DOT com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii To: Mumit Khan Cc: cygwin32-developers AT cygnus DOT com On Wed, Oct 28, 1998 at 04:26:12PM -0600, Mumit Khan wrote: >Christopher Faylor writes: >> >> Don't know if this will work, but: >> >> gdb /wherever/cygwin1.dll >> exec-file prog >> b whatever >> r > >Nope. Actually, I don't think this is even meant to work because gdb has >no way of mapping the address of the symbol before the DLL is loaded. > >Wonder if gdb should somehow load a DLL so that it's mapped and ready to >be stepped into ... > >Thanks for the suggestion though ... I've made do with small_printf in >the meantime, but it makes for some very tedious debugging job. One thing you could do that might work is to debug the program after it has started running. I have some patches to gdb which will allow attach to work, and Sergey has a binary (which was independently developed) on his web site. If you insert a Sleep in something like dll_crt0_1 then quickly attach to the running process, it's possible that the Windows debug API will detect the fact that the cygwin DLL is loaded and "do the right thing". -- cgf AT cygnus DOT com http://www.cygnus.com/