Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Date: Wed, 17 Dec 2003 17:50:50 -0500
From: Christopher Faylor <cgf-no-personal-reply-please@cygwin.com>
To: cygwin@cygwin.com
Subject: Re: Need tips debugging a crash porting an app to cygwin caused by sth overwriting a function
Message-ID: <20031217225050.GA8372@redhat.com>
Mail-Followup-To: cygwin@cygwin.com
References: <3FE0A59A.6060802@kaffe.org> <20031217213508.GE6296@redhat.com> <3FE0D154.4050205@kaffe.org> <20031217221440.GA7817@redhat.com> <3FE0DB67.8090009@kaffe.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <3FE0DB67.8090009@kaffe.org>
User-Agent: Mutt/1.4.1i
X-IsSubscribed: yes
Reply-To: cygwin@cygwin.com

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/

