Safe Haskell | None |
---|---|

Language | Haskell2010 |

- lookupLineNumber :: Function -> Int -> Maybe Int
- shallowLineNumberMap :: Function -> Map Int [Int]
- deepLineNumberMap :: Function -> Map Int [(FunId, [Int])]
- lookupLocalName :: Function -> Int -> Reg -> Maybe ByteString
- getRegistersAt :: Function -> Int -> Vector VarInfo
- inferSubFunctionNames :: Function -> [(Int, ByteString)]
- inferFunctionName :: Function -> Int -> Maybe ByteString

# Documentation

shallowLineNumberMap :: Function -> Map Int [Int] Source #

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.

lookupLocalName :: Function -> Int -> Reg -> Maybe ByteString Source #

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

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.

inferSubFunctionNames :: Function -> [(Int, ByteString)] Source #

Compute the names for the functions defined withing the given function.
The `Int`

is the index of the sub-function's prototype.

inferFunctionName :: Function -> Int -> Maybe ByteString Source #

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.