lua-users home
lua-l archive

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



On 1-Mar-07, at 11:04 AM, Eike Decker wrote:

== Different Idea:
In between I thought about this: How complicated would it be and how much performance would it drain to mask the compiled bytecode? Setting a bit would mark that this command should call the hook function. This would be really usefull - the bits could be activated and deactivated with a special function. It would allow full support for line/file breakpoints without too much overhead
I think.

It should be pretty simple. There are no spare bits in the VM
Instructions, but you could use the vector of line numbers (lineinfo);
that associates an int with each VM instruction, and one would
expect that few source files would require a full int to store
the line number.

The main problem, I think, would be identifying which VM instruction
to mark; there's no indication in the byte code as to which
lines actually correspond to statements, and you might end up
with some odd semantics. On the other hand, gdb suffers from
this problem, and people seem to learn to live with it.