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.bugs Subject: bug#69952: [PATCH] Support pdumping compiled queries by dumping their source Date: Sat, 15 Jun 2024 10:59:22 +0300 Message-ID: <86zfrmvdph.fsf@gnu.org> References: <86r0g1zaqi.fsf@gnu.org> <86le5hr9oj.fsf@gnu.org> <861q709y5y.fsf@gnu.org> <9B2A2190-AB42-4F1B-9F9D-5623B343CF0A@gmail.com> <86frvf8gf9.fsf@gnu.org> <86eday6j9o.fsf@gnu.org> <868r157wdy.fsf@gnu.org> <868r0phq6e.fsf@gnu.org> <493C3C1B-74F2-405D-830F-213B4D76DDC1@gmail.com> <86wmnrecr0.fsf@gnu.org> <61C9A0EB-D97D-4223-B257-FCA8DB150AA6@gmail.com> <86ikz66m5l.fsf@gnu.org> 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="21263"; mail-complaints-to="usenet@ciao.gmane.io" Cc: serg.foo@gmail.com, acorallo@gnu.org, dancol@dancol.org, 69952@debbugs.gnu.org To: Yuan Fu Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jun 15 10:00:13 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1sIOKb-0005Lr-8f for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 15 Jun 2024 10:00:13 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sIOKS-0005Uo-0J; Sat, 15 Jun 2024 04:00:04 -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 1sIOKQ-0005U6-DX for bug-gnu-emacs@gnu.org; Sat, 15 Jun 2024 04:00:02 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sIOKP-0008RG-VN for bug-gnu-emacs@gnu.org; Sat, 15 Jun 2024 04:00:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sIOKQ-0003CC-Gl for bug-gnu-emacs@gnu.org; Sat, 15 Jun 2024 04:00:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 15 Jun 2024 08:00:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69952 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 69952-submit@debbugs.gnu.org id=B69952.171843837712172 (code B ref 69952); Sat, 15 Jun 2024 08:00:02 +0000 Original-Received: (at 69952) by debbugs.gnu.org; 15 Jun 2024 07:59:37 +0000 Original-Received: from localhost ([127.0.0.1]:51875 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sIOK0-0003AF-Rb for submit@debbugs.gnu.org; Sat, 15 Jun 2024 03:59:37 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:55816) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sIOJz-00039g-12 for 69952@debbugs.gnu.org; Sat, 15 Jun 2024 03:59:35 -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 1sIOJs-0008Kr-HG; Sat, 15 Jun 2024 03:59:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=PNZ9v61AtlQ6Zai0icDpfyNMTVZE7fXvcXMO/vu06RY=; b=auYflsgam3d+NOpaL4wt KOsUqVi8kWtPZAWCzBImg5pW3ePFiibHiWk195bheyrStHuZHNf8kAdtp9IncdYTXYHDG0OA8WCbM mdUN9jAT8dYUB7Ygl4CW0hpgtWzsAq4rDW7OkoPB2YkLYAAJ3QwW9OLvyjpZDmi2VyaHREC0wsyLX LeSzsqz72P25VHMY9SxaHlaWiYUeXTr/wwlDLNjvXmFyLF0U0XG9JmIpwXBlMylBo5vN/rYWuRQeQ OENmtO9bA7XX07JKi2dmkYc+fzNABc23s2ANHR5V6qm7s8npKgdhLMDy52KhNYrmCTLA5SUVQDi2x wzg62oQuEYylag==; In-Reply-To: (message from Yuan Fu on Sat, 1 Jun 2024 10:07:38 -0700) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:287257 Archived-At: Ping! Any progress there? > From: Yuan Fu > Date: Sat, 1 Jun 2024 10:07:38 -0700 > Cc: Eli Zaretskii , > serg.foo@gmail.com, > Daniel Colascione , > 69952@debbugs.gnu.org > > > > > On May 29, 2024, at 9:35 AM, Andrea Corallo wrote: > > > > Eli Zaretskii writes: > > > >>> From: Yuan Fu > >>> Date: Tue, 21 May 2024 23:36:47 -0700 > >>> Cc: serg.foo@gmail.com, > >>> dancol@dancol.org, > >>> 69952@debbugs.gnu.org > >>> > >>>>>>> Yes, most likely a function-undefined signal, since all the > >>>>>> treesit.c functions like treesit-query-capture or > >>>>>> treesit-query-compile will be nonexistent. And usually the Lisp > >>>>>> program trying to use the query would check for tree-sitter > >>>>>> availability with treesit-available-p before trying to use any > >>>>>> tree-sitter functions; so that signal will be usually avoided as > >>>>>> well. > >>>>>> > >>>>>> Can you suggest such an addition to the patch? > >>>>> > >>>>> Let me take a look. > >>>>> > >>>>> Yuan > >>> > >>> Am I missing something? It seems the patch doesn’t include anything about loading a dumped query? > >> > >> Looks like that, yes. > >> > >>> I guess that’s the addition you’re talking about? If I want to add a special loader, where should I start? > >> > >> I guess in dump_do_emacs_relocation and/or dump_do_dump_relocation? > > > > Yes that's correct. > > > >> Alternatively, perhaps it's better to define a hook via > >> pdumper_do_now_and_after_load_impl or > >> pdumper_do_now_and_after_late_load_impl, in which case the hook will > >> be run after loading the dump file. This sounds easier if you can > >> access all the loaded queries one by one, instead of catching them > >> as they are being loaded. > > > > Note also that if one decides to execute code at LATE_RELOCS or > > VERY_LATE_RELOCS time he has the lisp machinery at disposal (including > > allocation), but native code becomes functional only after > > VERY_LATE_RELOCS relocs are done (not sure this can impact you here). > > > > On this might be necessary if Yuan goes for the hook and needs native > > Lisp code to be working, to add > > 'pdumper_do_now_and_after_very_late_load_impl' (which I think I didn't > > bothered at the time). > > > > Andrea > > Thanks to you both! I’ll see what I can come up with. > > Yuan > >