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 18:20:18 +0300 Message-ID: <86cyqd1nbh.fsf@gnu.org> References: <86wmor6owq.fsf@gnu.org> <861q6u2ex2.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24131"; 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 17:21:31 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 1s00ug-00066N-1v for ged-emacs-devel@m.gmane-mx.org; Thu, 25 Apr 2024 17:21:30 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s00ty-0001mJ-N7; Thu, 25 Apr 2024 11:20:46 -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 1s00tw-0001lV-LZ for emacs-devel@gnu.org; Thu, 25 Apr 2024 11:20:44 -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 1s00tv-0005BB-RD; Thu, 25 Apr 2024 11:20:44 -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=hsiybC0kwG2zV9eFfSyQjC6Txtk3cAsJ0YET/keusYU=; b=MN1KemceYeS1 6ZmqqAUFIecRfQPe2gFrIHUc6U6Zg5m/x2j/t1bFCKWbeVlz5bBhWcr2MgU2z1OqPiICjKyKP9Yd0 vx2ik5olYAagKJBdlHqQl/tNcxEuAA502P9Pi0YsMCgHPnRkk+RbdBp5hHaw/rXKZ/afbJgX0GOQL Uf9XHt56tNaVxTqnkoERR9eeGEU1oJ7/DVYeFjjBz0/UZrrqA1XiI07bQ6seK5ixWtpOTHZjclwmI XoyEqoAK7ns6V8PVINUSq7R9IAs6GmTPjyftMGg1XX67p/SqtdPq8+pI79jch+XSiD/pTyyExc2ad 5LjJ41C5oYFGnvo5H2WFRQ==; In-Reply-To: (message from Andrea Corallo on Thu, 25 Apr 2024 01:48:43 -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:318087 Archived-At: > From: Andrea Corallo > Cc: gerd.moellmann@gmail.com, emacs-devel@gnu.org > Date: Thu, 25 Apr 2024 01:48:43 -0400 > > Eli Zaretskii writes: > > >> 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. > > Correct, on GNU/Linux gdb does that by default, no idea on other > systems. It does it also on Windows, if the version of the OS is new enough to support that.