This is the mail archive of the cygwin@cygwin.com 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: Need tips debugging a crash porting an app to cygwin caused by sth overwriting a function


On Wed, Dec 17, 2003 at 11:40:39PM +0100, Dalibor Topic wrote:
>I was thinking about defining a gdb command along the lines of
>
>define my-stepi-watch
>while (*(long *) findJarFiles == original_value)
>stepi
>end
>
>though I've never done that before, so I'm not sure if that would work ;)

It might work but I think you'd probably end up tracking the heat death
of the universe before you'd see a result.  :-)

>I'm not sure about using binary search, as there might be some threading 
>involved, so I assume it's safer to just check on each stepi and let the 
>machine run overnight.

Ah, threading.  That complicates matters a lot.

Another way to catch this is to call VirtualProtect on the regions in
question and make them read-only.  Then when something trashes the
location it will die immediately.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/memory/base/virtualprotect.asp

cgf

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


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