Darwin/x86_64 linker support
[ghc-hetmet.git] / compiler / ghci / Linker.lhs
index 37fe289..2c1b668 100644 (file)
@@ -68,13 +68,6 @@ import System.Directory
 
 import Control.Exception
 import Data.Maybe
-
-#if __GLASGOW_HASKELL__ >= 503
-import GHC.IOBase      ( IO(..) )
-#else
-import PrelIOBase      ( IO(..) )
-#endif
-
 \end{code}
 
 
@@ -213,13 +206,15 @@ recoverDataCon x = do
 
    getConDescAddress :: Ptr StgInfoTable -> IO (Ptr CChar)
    getConDescAddress ptr = do
-       peek $ intPtrToPtr $ (ptrToIntPtr ptr) + offset
 #ifdef GHCI_TABLES_NEXT_TO_CODE
+       offsetToString <- peek $ intPtrToPtr $ (ptrToIntPtr ptr) + offset
+       return $ ptr `plusPtr` offsetToString
        where
        -- subtract a word number of bytes 
        offset = negate (fromIntegral SIZEOF_VOID_P)
 #endif
 #ifndef GHCI_TABLES_NEXT_TO_CODE
+        peek $ intPtrToPtr $ (ptrToIntPtr ptr) + offset
       where 
       -- add the standard info table size in bytes 
       infoTableSizeBytes = sTD_ITBL_SIZE * wORD_SIZE