[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Native compilation on MPS branch

From: Eli Zaretskii
Subject: Re: Native compilation on MPS branch
Date: Thu, 25 Apr 2024 08:24:09 +0300

> From: Andrea Corallo <acorallo@gnu.org>
> Cc: Eli Zaretskii <eliz@gnu.org>,  emacs-devel@gnu.org
> Date: Wed, 24 Apr 2024 16:54:30 -0400
> IME rr is invaluable for debugging GC bugs, one can do things like
> placing watch-points while doing reverse execution and discover
> immediately where something was modified the last time.  You did a very
> good job reaching this point of the development without rr.

We have the last_marked[] array to facilitate debugging of GC without
rr.  I hope we will be able to do something similar with MPS, because
rr is not universally available (e.g., not on Windows).

> Anyway I'll mention a trick I find extremely usefull to discover where
> something was modified last time before a certain event without rr, I
> apologize if you know it already but in case it might help some other
> reader :)
> 1 When we crash we set a watch point on the memory we see got
> unexpectedly modified
> 2 We set the ignore number of the watch-point to a very large number
> 3 We restart the execution of the program
> 4 When the program crashes again we can see how many time the watch point
> was actually ignored
> 5 We subtract 1 to this number and we set it again as the ignore number
> of the watch-point
> 6 We restart again and tada!! We are where that piece of memory was
> modified for the last time :)

This only works if you disable ASLR, AFAIU.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]