lua-users home
lua-l archive

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


Luiz Henrique de Figueiredo writes:
> most if not all of what you propose can be implemented in Lua using
> my bytecode inspector library, lbci.

All, actually.  A reimplementation of the modified debug.getinfo using lbci is
now on the DetectingUndefinedVariables page.  The code uses
inspector.getinstruction, inspector.getconstant, and inspector.getfunction
functions, and if checkglobals(f, env) is called with f as a stack number
(default f = 1), it still needs to call debug.getinfo(f, 'f').func.  lbci has
somewhat more than one needs here, at a lower level and as a separate C library,
but it works fairly well.

(BTW, I'm not really sure what else lbci could be used for, but if it allowed
modification of bytecodes, such as an assembler, then things could get more
interesting.)