GNU bug report logs -
#69952
[PATCH] Support pdumping compiled queries by dumping their source
Previous Next
Full log
Message #65 received at 69952 <at> debbugs.gnu.org (full text, mbox):
> On May 29, 2024, at 9:35 AM, Andrea Corallo <acorallo <at> gnu.org> wrote:
>
> Eli Zaretskii <eliz <at> gnu.org> writes:
>
>>> From: Yuan Fu <casouri <at> gmail.com>
>>> Date: Tue, 21 May 2024 23:36:47 -0700
>>> Cc: serg.foo <at> gmail.com,
>>> dancol <at> dancol.org,
>>> 69952 <at> 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
This bug report was last modified 302 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.