– what we have:
catch# :: (State# RealWorld -> (# State# RealWorld, a #) ) -> (b -> ByteArray# -> State# RealWorld -> (# State# RealWorld, a #) ) -> State# RealWorld -> (# State# RealWorld, a #)
dumpStack :: ByteArray# -> State# RealWorld -> State# RealWorld
– what we want (high level) – See also: GHC.Stack (a similar API for cost-centre stacks)
getStack :: IO Stack
stackContents :: Stack -> [ [StackItem] ]
data StackItem = StackItem { { fileName :: String , functionName :: String , startLint :: Int , startColumn :: Int , endLine :: Int , endColumn :: Int }
prettyPrintStack :: Stack -> [String]
errorWithStackTrace :: String -> a
throw :: Exception e => e -> a
– what we want (low level)
data Stack = Stack ByteArray#
getStack# :: State# RealWorld -> (# State# RealWorld, ByteArray# #)
stackItemElems :: Addr# -> Int# – gets the number of ticks for this address – the first tick should always be the one that was chosen to appear – in the DWARF info, according to the heuristic that chooses the – “best” tick.
inspectStackItem# :: Addr# -> Int# -> (# ByteArray# , ByteArray# , Int# , Int# , Int# , Int# #)