poke-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: GDB integration and lexical cuckholding


From: Jose E. Marchesi
Subject: Re: GDB integration and lexical cuckholding
Date: Wed, 25 Sep 2024 09:54:38 +0200
User-agent: Gnus/5.13 (Gnus v5.13)

> Hi Jose.
>
> On Tue, Sep 24, 2024 at 12:02:03PM GMT, Jose E. Marchesi wrote:
>> 
>> Hi Mohammad.
>> 
>> Among my notes I found this:
>> 
>> ** TODO poke: gdb: disable lexical cuckolding in case of error in 
>> compile-buffer!
>>   [2023-05-12 Fri]
>> 
>> It may be still relevant in the current code.  Can you please take a
>> look?
>
>
> Can you elaborate a little?
> Lexical cuckolding continues to work after giving invalid code to Poke 
> compiler.

I don't remember exactly what prompted me to write down that note.

But I think it was the fact that in the poke application lexical
cuckolding is enabled only when code is executed from the prompt.
Therefore, if you have this in a foo.pk:

  $<foo>;

And then do:

  $ poke -l foo.pk
  foo.pk:1:1: error: syntax error: unexpected token

i.e. the token is not recognized.  But if you load it from the prompt:

  (p0:big:poke) load foo
  foo.pk:1:1: error: invalid IO space
  $<foo>;
  ^~~~~~

i.e. now the token is recognized.

I know think I wrote that note about poke, not the GDB integration,
because I see pk-cmd.c:pk_cmd_exec doesn't properly disable the lexical
cuckolding in case on error.  I am pushing a patch to fix that.

As for the GDB integration, if it makes sense to never turn off lexical
cuckolding then this is not an issue.  But it is difficult to reason
about it without seeing the code.  Can you please push it into a
personal branch in binutils-gdb.git?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]