From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Native compilation on MPS branch Date: Thu, 25 Apr 2024 08:24:09 +0300 Message-ID: <861q6u2ex2.fsf@gnu.org> References: <86wmor6owq.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24123"; mail-complaints-to="usenet@ciao.gmane.io" Cc: gerd.moellmann@gmail.com, emacs-devel@gnu.org To: Andrea Corallo Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Apr 25 07:24:55 2024 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rzrbK-00066Y-Vz for ged-emacs-devel@m.gmane-mx.org; Thu, 25 Apr 2024 07:24:55 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rzrag-0005Xk-Dj; Thu, 25 Apr 2024 01:24:14 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rzrae-0005XJ-EP for emacs-devel@gnu.org; Thu, 25 Apr 2024 01:24:12 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rzrae-0006hg-2b; Thu, 25 Apr 2024 01:24:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=jGWnOnK0jmkd2UpcxV5FWnG57VCFSnVanK2qbOWpobQ=; b=XGsLS90cTMAR cra5fc1GB00ldIY+Lxi4Gy5zeY8uByqaayj4AaRxjxMILdEifBqR1Xttm17iPZJkoZOEV85BvbAIq ZlClUtwS0GhmlC9Lj5MwD1c5LXd5VfiWkHgEXcUP8pulivE4wbSBd10XQqmH5VvoiGG7H+BfR9Pja 0sl+exvokgdBcs2DsPzl4H9pq2cTUm6epoUTXDl/jg4h7MO3ek0L8WJJdULE9nbXM1RkwUNtd94mR TDxHy2OM96cFbi9InS++2N1JHbljaJ4fo5Kzybx+rVuEeCKnFple0sucO3pOjikcf2+MsVPvo9i/o 67Bt+Dbn0Yxo5QEPTJBF3Q==; In-Reply-To: (message from Andrea Corallo on Wed, 24 Apr 2024 16:54:30 -0400) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:318054 Archived-At: > From: Andrea Corallo > Cc: Eli Zaretskii , 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.