lua-bc-0.1.1: Lua bytecode parser

Language.Lua.Bytecode.Debug

Synopsis

Documentation

Arguments

 :: Function -> Int program counter -> Maybe Int

Given a function, compute a map from line numbers to op-codes in the function. This is useful for adding break-points identified by line number. Does not consider nested functions.

deepLineNumberMap :: Function -> Map Int [(FunId, [Int])] Source #

Given a function, compute a map from line numbers to op-codes in this function or a nested function. For each line number we return a list of pairs (typically just 1). The first element in the pair is the path to the nested function---empty if not nested---and the second one are the PC locations associated with that function.

Compute the locals at a specific program counter. This function is memoized, so it is fast to lookup things many times.

Arguments

 :: Function -> Int PC -> Vector VarInfo

Get what registers are in scope at a particular op-code. R1 is at entry 0, R2 is entry 1, etc. NOTE that there might be multiple registers with the same named thing. The one currently in scope is the last one.

Compute the names for the functions defined withing the given function. The Int is the index of the sub-function's prototype.

Figure out a name for the function defined at the given program counter in a function. Note that this operation could be fairly expensive, so probably a good idea to cache the results.