X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fghci%2FByteCodeLink.lhs;h=c58ae870dfbb475377fde16d8cda37bf0010954d;hb=84923cc7de2a93c22a2f72daf9ac863959efae13;hp=fd6654579cad10a1c65666a5178ebe3eebe1ca72;hpb=ab22f4e6456820c1b5169d75f5975a94e61f54ce;p=ghc-hetmet.git diff --git a/compiler/ghci/ByteCodeLink.lhs b/compiler/ghci/ByteCodeLink.lhs index fd66545..c58ae87 100644 --- a/compiler/ghci/ByteCodeLink.lhs +++ b/compiler/ghci/ByteCodeLink.lhs @@ -10,6 +10,7 @@ module ByteCodeLink ( HValue, ClosureEnv, emptyClosureEnv, extendClosureEnv, linkBCO, lookupStaticPtr + ,lookupIE ) where #include "HsVersions.h" @@ -26,6 +27,7 @@ import Module import PackageConfig import FastString import Panic +import Breakpoints #ifdef DEBUG import Outputable @@ -46,7 +48,7 @@ import GHC.Exts ( BCO#, newBCO#, unsafeCoerce#, Int#, import GHC.Arr ( Array(..) ) import GHC.IOBase ( IO(..) ) -import GHC.Ptr ( Ptr(..) ) +import GHC.Ptr ( Ptr(..), castPtr ) import GHC.Base ( writeArray#, RealWorld, Int(..) ) \end{code} @@ -124,7 +126,7 @@ linkBCO' ie ce (UnlinkedBCO nm arity insns_barr bitmap literalsSS ptrsSS itblsSS ptrs_parr = case ptrs_arr of Array lo hi parr -> parr itbls_arr = listArray (0, n_itbls-1) linked_itbls - :: UArray Int ItblPtr + itbls_barr = case itbls_arr of UArray lo hi barr -> barr literals_arr = listArray (0, n_literals-1) linked_literals @@ -210,6 +212,8 @@ lookupName :: ClosureEnv -> Name -> IO HValue lookupName ce nm = case lookupNameEnv ce nm of Just (_,aa) -> return aa + Nothing | Just bk <- lookupBogusBreakpointVal nm + -> return bk Nothing -> ASSERT2(isExternalName nm, ppr nm) do let sym_to_find = nameToCLabel nm "closure" @@ -222,7 +226,7 @@ lookupName ce nm lookupIE :: ItblEnv -> Name -> IO (Ptr a) lookupIE ie con_nm = case lookupNameEnv ie con_nm of - Just (_, Ptr a) -> return (Ptr a) + Just (_, a) -> return (castPtr (itblCode a)) Nothing -> do -- try looking up in the object files. let sym_to_find1 = nameToCLabel con_nm "con_info"