X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=Debug%2FTrace.hs;h=742044e4d4c3e1eef013234f23d92500c260a852;hb=487b9d4571a847ee0273b4627aaa135c46a51b8d;hp=accf247e882f234fd4eba7da7df0373d059d4490;hpb=09b9f955bd163776ec5e7f56f9302f55ca1f378c;p=ghc-base.git diff --git a/Debug/Trace.hs b/Debug/Trace.hs index accf247..742044e 100644 --- a/Debug/Trace.hs +++ b/Debug/Trace.hs @@ -13,9 +13,10 @@ ----------------------------------------------------------------------------- module Debug.Trace ( - -- * Tracing - putTraceMsg, -- :: String -> IO () - trace -- :: String -> a -> a + -- * Tracing + putTraceMsg, -- :: String -> IO () + trace, -- :: String -> a -> a + traceShow ) where import Prelude @@ -40,7 +41,9 @@ putTraceMsg msg = do withCString msg $ \cmsg -> debugBelch cfmt cmsg -foreign import ccall unsafe "RtsMessages.h debugBelch" +-- don't use debugBelch() directly, because we cannot call varargs functions +-- using the FFI. +foreign import ccall unsafe "HsBase.h debugBelch2" debugBelch :: CString -> CString -> IO () #endif