Created
November 27, 2010 03:39
-
-
Save bos/717542 to your computer and use it in GitHub Desktop.
A quick hack for debugging the GHC RTS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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