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: Mohammad-Reza Nabipoor
Subject: Re: GDB integration and lexical cuckholding
Date: Wed, 25 Sep 2024 11:50:40 +0200

Hi Jose.

On Wed, Sep 25, 2024 at 09:54:38AM GMT, Jose E. Marchesi wrote:
> 
> > 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.
> 


Thanks for the explanation.


> 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?
> 

Pushed to users/mnabipoor/poke-gdb branch.



reply via email to

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