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: Any way of dumping strings? Date: Wed, 02 Jun 2021 21:16:24 +0300 Message-ID: <83czt4xhc7.fsf@gnu.org> References: <87zgw8b3n9.fsf@telefonica.net> <83fsy0xjrd.fsf@gnu.org> <87v96wb19v.fsf@telefonica.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="25493"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: =?utf-8?Q?=C3=93scar?= Fuentes Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Jun 02 20:17:16 2021 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 1loVQY-0006Ms-Ki for ged-emacs-devel@m.gmane-mx.org; Wed, 02 Jun 2021 20:17:14 +0200 Original-Received: from localhost ([::1]:46538 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1loVQX-0006o4-H1 for ged-emacs-devel@m.gmane-mx.org; Wed, 02 Jun 2021 14:17:13 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:54238) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1loVPz-00067X-LP for emacs-devel@gnu.org; Wed, 02 Jun 2021 14:16:40 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:58980) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1loVPy-0008R2-Uh; Wed, 02 Jun 2021 14:16:38 -0400 Original-Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:3219 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1loVPx-00080o-ER; Wed, 02 Jun 2021 14:16:38 -0400 In-Reply-To: <87v96wb19v.fsf@telefonica.net> (message from =?utf-8?Q?=C3=93scar?= Fuentes on Wed, 02 Jun 2021 19:54:20 +0200) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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" Xref: news.gmane.io gmane.emacs.devel:270316 Archived-At: > From: Óscar Fuentes > Date: Wed, 02 Jun 2021 19:54:20 +0200 > > > Set a GDB breakpoint in mark_vectorlike, with commands that dump each > > vector, then trigger GC? > > I was hoping for something that could show at least thousands of > instances. Going one by one would be extremely time-consuming and > potentially deceptive. That's not what I had in mind. You can set up breakpoint commands that dump the contents of the vector being marked, then continue without stopping. Then say "set logging on", so that the output goes to a file, and let Emacs run. Once GC finishes, you will have a file with all the vectors in it; then you can examine them at your leisure. > Does Emacs zero-initialize memory when it is garbage-collected? You mean, those objects it recycles? it doesn't zero them, but why would you be interested in the objects that get GCed -- those are not your problem. Your problem is those which aren't GCed, and mark_vector marks each one of them. > Even if it doesn't, maybe it is enough to dump the whole image to a > file. Some part would be gc-ed data, but a comparatively small part > among all the rest of hundreds of MB. How would you tell the one from the other?