lua-users home
lua-l archive

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


Has anyone written code where you can set the program counter of a lua_State?  Or does anyone have any hints or guesses on how to do this?

I'm working on a Lua debugger and am trying to figure out the feasibility of making a feature where the user can select a line, and set the Lua program counter to that line.  The scope may be restricted to allowing this only within the same function or possibly only within the same block.

In luaV_execute () it updates the program counter, so maybe I can search back or forward from the current pc for a pc with its line data populated and check that against the line that the user requested the program counter to be positioned at.

Any thoughts?

Thanks,
-Scott

key words: set pc to cursor, set program counter to cursor, Lua debugger