emacs-devel
[Top][All Lists]
Advanced

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

Re: Native compilation on MPS branch


From: Andrea Corallo
Subject: Re: Native compilation on MPS branch
Date: Thu, 25 Apr 2024 01:48:43 -0400
User-agent: Gnus/5.13 (Gnus v5.13)

Eli Zaretskii <eliz@gnu.org> writes:

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

Correct, on GNU/Linux gdb does that by default, no idea on other
systems.

  Andrea



reply via email to

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