lua-users home
lua-l archive

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


I would like to see inspection and modification of functions
(instructions, constants, prototypes, etc.) moved in the debug
library. This would potentially open the door to 'edit and continue'
debuggers. Combined with a new "call to debug hook" bytecode, it would
make implementing breakpoints easier and more efficient.

I would also like to see syntax extensions through post-compilation
opcode modification. So, as an example, a function might contain lines
like:
label "loop_reentry"
...
goto "loop_reentry"
Then after loading, it would be possible to run through the opcodes,
identify the getglobal/loadk/call of these label and goto constructs,
and replace them with "move r0 := r0" and "jump offset" respectively.

On 25/03/2008, Luiz Henrique de Figueiredo <lhf@tecgraf.puc-rio.br> wrote:
> > All, actually.
>
>  Nice!
>
>
>  > (BTW, I'm not really sure what else lbci could be used for
>
>
> It does allow you to produce bytecode listings without luac -l, for instance.
>
>
>  > but if it allowed modification of bytecodes, such as an assembler,
>  > then things could get more interesting.)
>
>
> Sure! One caveat is that this would change all closures of the modified
>  function... But it would be fun anyway. And not hard to implement. But
>  would there be any interest in such a low-level assembler?
>