Skip to content

Instantly share code, notes, and snippets.

@bos

bos/DebugRTS.hs

Created Nov 27, 2010
Embed
What would you like to do?
A quick hack for debugging the GHC RTS
import Foreign.C.String
import Foreign.Ptr
import System.Posix.Internals
debug :: String -> IO ()
debug s = do
withCStringLen (s++"\n") $ \(ptr,len) ->
c_safe_write 2 (castPtr ptr) (fromIntegral len)
return ()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment