Rodrigo Mesquita pushed to branch wip/romes/step-out-11 at Glasgow Haskell Compiler / GHC Commits: 5da18c23 by Rodrigo Mesquita at 2025-07-18T18:33:54+01:00 Revert "Working on making BRK_FUNs for case cont. BCO [skip ci]" This reverts commit 02e468b0e73618f7789e965c939279e4902194dd. - - - - - 12 changed files: - compiler/GHC/ByteCode/Asm.hs - compiler/GHC/ByteCode/Breakpoints.hs - compiler/GHC/ByteCode/Instr.hs - compiler/GHC/CoreToIface.hs - compiler/GHC/Linker/Loader.hs - compiler/GHC/Runtime/Debugger/Breakpoints.hs - compiler/GHC/Runtime/Eval.hs - compiler/GHC/StgToByteCode.hs - ghc/GHCi/UI.hs - rts/Disassembler.c - rts/Interpreter.c - testsuite/tests/ghci.debugger/scripts/all.T Changes: ===================================== compiler/GHC/ByteCode/Asm.hs ===================================== @@ -841,7 +841,7 @@ assembleI platform i = case i of W8 -> emit_ bci_OP_INDEX_ADDR_08 [] _ -> unsupported_width - BRK_FUN ibi@(InternalBreakpointId info_mod infox) byteOff -> do + BRK_FUN ibi@(InternalBreakpointId info_mod infox) -> do p1 <- ptr $ BCOPtrBreakArray info_mod let -- cast that checks that round-tripping through Word16 doesn't change the value toW16 x = let r = fromIntegral x :: Word16 @@ -852,7 +852,7 @@ assembleI platform i = case i of info_unitid_addr <- lit1 $ BCONPtrFS $ unitIdFS $ moduleUnitId info_mod np <- lit1 $ BCONPtrCostCentre ibi emit_ bci_BRK_FUN [ Op p1, Op info_addr, Op info_unitid_addr - , SmallOp (toW16 infox), SmallOp (toW16 byteOff), Op np ] + , SmallOp (toW16 infox), Op np ] BRK_ALTS active -> emit_ bci_BRK_ALTS [SmallOp (if active then 1 else 0)] ===================================== compiler/GHC/ByteCode/Breakpoints.hs ===================================== @@ -1,5 +1,4 @@ {-# LANGUAGE RecordWildCards #-} -{-# LANGUAGE DerivingStrategies #-} -- | Breakpoint information constructed during ByteCode generation. -- @@ -16,7 +15,6 @@ module GHC.ByteCode.Breakpoints -- ** Internal breakpoint identifier , InternalBreakpointId(..), BreakInfoIndex - , InternalBreakLoc(..) -- * Operations @@ -25,7 +23,7 @@ module GHC.ByteCode.Breakpoints -- ** Source-level information operations , getBreakLoc, getBreakVars, getBreakDecls, getBreakCCS - , getBreakSourceId, getBreakSourceMod + , getBreakSourceId -- * Utils , seqInternalModBreaks @@ -167,7 +165,7 @@ data CgBreakInfo { cgb_tyvars :: ![IfaceTvBndr] -- ^ Type variables in scope at the breakpoint , cgb_vars :: ![Maybe (IfaceIdBndr, Word)] , cgb_resty :: !IfaceType - , cgb_tick_id :: !(Either InternalBreakLoc BreakpointId) + , cgb_tick_id :: !BreakpointId -- ^ This field records the original breakpoint tick identifier for this -- internal breakpoint info. It is used to convert a breakpoint -- *occurrence* index ('InternalBreakpointId') into a *definition* index @@ -175,19 +173,9 @@ data CgBreakInfo -- -- The modules of breakpoint occurrence and breakpoint definition are not -- necessarily the same: See Note [Breakpoint identifiers]. - -- - -- If there is no original tick identifier (that is, the breakpoint was - -- created during code generation), instead refer directly to the SrcSpan - -- we want to use for it. See Note [Internal Breakpoint Locations] } -- See Note [Syncing breakpoint info] in GHC.Runtime.Eval --- | Breakpoints created during code generation don't have a source-level tick --- location. Instead, we come up with one ourselves. --- See Note [Internal Breakpoint Locations] -newtype InternalBreakLoc = InternalBreakLoc SrcSpan - deriving newtype (Eq, Show, NFData, Outputable) - -- | Get an internal breakpoint info by 'InternalBreakpointId' getInternalBreak :: InternalBreakpointId -> InternalModBreaks -> CgBreakInfo getInternalBreak (InternalBreakpointId mod ix) imbs = @@ -208,36 +196,27 @@ assert_modules_match ibi_mod imbs_mod = -- | Get the source module and tick index for this breakpoint -- (as opposed to the module where this breakpoint occurs, which is in 'InternalBreakpointId') -getBreakSourceId :: InternalBreakpointId -> InternalModBreaks -> Either InternalBreakLoc BreakpointId +getBreakSourceId :: InternalBreakpointId -> InternalModBreaks -> BreakpointId getBreakSourceId (InternalBreakpointId ibi_mod ibi_ix) imbs = assert_modules_match ibi_mod (imodBreaks_module imbs) $ let cgb = imodBreaks_breakInfo imbs IM.! ibi_ix in cgb_tick_id cgb --- | Get the source module for this breakpoint (where the breakpoint is defined) -getBreakSourceMod :: InternalBreakpointId -> InternalModBreaks -> Module -getBreakSourceMod (InternalBreakpointId ibi_mod ibi_ix) imbs = - assert_modules_match ibi_mod (imodBreaks_module imbs) $ - let cgb = imodBreaks_breakInfo imbs IM.! ibi_ix - in case cgb_tick_id cgb of - Left InternalBreakLoc{} -> imodBreaks_module imbs - Right BreakpointId{bi_tick_mod} -> bi_tick_mod - -- | Get the source span for this breakpoint getBreakLoc :: (Module -> IO ModBreaks) -> InternalBreakpointId -> InternalModBreaks -> IO SrcSpan -getBreakLoc = getBreakXXX modBreaks_locs (\(InternalBreakLoc x) -> x) +getBreakLoc = getBreakXXX modBreaks_locs -- | Get the vars for this breakpoint getBreakVars :: (Module -> IO ModBreaks) -> InternalBreakpointId -> InternalModBreaks -> IO [OccName] -getBreakVars = getBreakXXX modBreaks_vars (const []) +getBreakVars = getBreakXXX modBreaks_vars -- | Get the decls for this breakpoint getBreakDecls :: (Module -> IO ModBreaks) -> InternalBreakpointId -> InternalModBreaks -> IO [String] -getBreakDecls = getBreakXXX modBreaks_decls (const []) +getBreakDecls = getBreakXXX modBreaks_decls -- | Get the decls for this breakpoint -getBreakCCS :: (Module -> IO ModBreaks) -> InternalBreakpointId -> InternalModBreaks -> IO (Maybe (String, String)) -getBreakCCS = getBreakXXX (fmap Just . modBreaks_ccs) (const Nothing) +getBreakCCS :: (Module -> IO ModBreaks) -> InternalBreakpointId -> InternalModBreaks -> IO (String, String) +getBreakCCS = getBreakXXX modBreaks_ccs -- | Internal utility to access a ModBreaks field at a particular breakpoint index -- @@ -249,17 +228,14 @@ getBreakCCS = getBreakXXX (fmap Just . modBreaks_ccs) (const Nothing) -- 'ModBreaks'. When the tick module is different, we need to look up the -- 'ModBreaks' in the HUG for that other module. -- --- When there is no tick module (the breakpoint was generated at codegen), use --- the function on internal mod breaks. --- -- To avoid cyclic dependencies, we instead receive a function that looks up -- the 'ModBreaks' given a 'Module' -getBreakXXX :: (ModBreaks -> Array BreakTickIndex a) -> (InternalBreakLoc -> a) -> (Module -> IO ModBreaks) -> InternalBreakpointId -> InternalModBreaks -> IO a -getBreakXXX view viewInternal lookupModule (InternalBreakpointId ibi_mod ibi_ix) imbs = +getBreakXXX :: (ModBreaks -> Array BreakTickIndex a) -> (Module -> IO ModBreaks) -> InternalBreakpointId -> InternalModBreaks -> IO a +getBreakXXX view lookupModule (InternalBreakpointId ibi_mod ibi_ix) imbs = assert_modules_match ibi_mod (imodBreaks_module imbs) $ do let cgb = imodBreaks_breakInfo imbs IM.! ibi_ix case cgb_tick_id cgb of - Right BreakpointId{bi_tick_mod, bi_tick_index} + BreakpointId{bi_tick_mod, bi_tick_index} | bi_tick_mod == ibi_mod -> do let these_mbs = imodBreaks_modBreaks imbs @@ -268,8 +244,6 @@ getBreakXXX view viewInternal lookupModule (InternalBreakpointId ibi_mod ibi_ix) -> do other_mbs <- lookupModule bi_tick_mod return $ view other_mbs ! bi_tick_index - Left l -> - return $ viewInternal l -------------------------------------------------------------------------------- -- Instances ===================================== compiler/GHC/ByteCode/Instr.hs ===================================== @@ -258,7 +258,7 @@ data BCInstr -- Note [unboxed tuple bytecodes and tuple_BCO] in GHC.StgToByteCode -- Breakpoints - | BRK_FUN !InternalBreakpointId !ByteOff + | BRK_FUN !InternalBreakpointId -- An internal breakpoint for triggering a break on any case alternative -- See Note [Debugger: BRK_ALTS] @@ -454,10 +454,9 @@ instance Outputable BCInstr where ppr ENTER = text "ENTER" ppr (RETURN pk) = text "RETURN " <+> ppr pk ppr (RETURN_TUPLE) = text "RETURN_TUPLE" - ppr (BRK_FUN (InternalBreakpointId info_mod infox) bo) + ppr (BRK_FUN (InternalBreakpointId info_mod infox)) = text "BRK_FUN" <+> text "<breakarray>" <+> ppr info_mod <+> ppr infox - <+> ppr bo <+> text "<cc>" ppr (BRK_ALTS active) = text "BRK_ALTS" <+> ppr active #if MIN_VERSION_rts(1,0,3) ===================================== compiler/GHC/CoreToIface.hs ===================================== @@ -50,6 +50,8 @@ import GHC.Prelude import GHC.StgToCmm.Types +import GHC.ByteCode.Types + import GHC.Core import GHC.Core.TyCon hiding ( pprPromotionQuote ) import GHC.Core.Coercion.Axiom ===================================== compiler/GHC/Linker/Loader.hs ===================================== @@ -58,7 +58,6 @@ import GHCi.RemoteTypes import GHC.Iface.Load import GHCi.Message (ConInfoTable(..), LoadedDLL) -import GHC.ByteCode.Breakpoints import GHC.ByteCode.Linker import GHC.ByteCode.Asm import GHC.ByteCode.Types @@ -1712,10 +1711,8 @@ allocateCCS interp ce mbss let count = 1 + (maybe 0 fst $ IM.lookupMax imodBreaks_breakInfo) let ccs = IM.map (\info -> - case cgb_tick_id info of - Right bi -> fromMaybe (toRemotePtr nullPtr) - (M.lookup bi ccss) - Left InternalBreakLoc{} -> toRemotePtr nullPtr + fromMaybe (toRemotePtr nullPtr) + (M.lookup (cgb_tick_id info) ccss) ) imodBreaks_breakInfo assertPpr (count == length ccs) ===================================== compiler/GHC/Runtime/Debugger/Breakpoints.hs ===================================== @@ -253,11 +253,8 @@ mkBreakpointOccurrences = do let imod = modBreaks_module $ imodBreaks_modBreaks ibrks IntMap.foldrWithKey (\info_ix cgi bmp -> do let ibi = InternalBreakpointId imod info_ix - case cgb_tick_id cgi of - Right (BreakpointId tick_mod tick_ix) - -> extendModuleEnvWith (IntMap.unionWith (S.<>)) bmp tick_mod (IntMap.singleton tick_ix [ibi]) - Left _ - -> bmp + let BreakpointId tick_mod tick_ix = cgb_tick_id cgi + extendModuleEnvWith (IntMap.unionWith (S.<>)) bmp tick_mod (IntMap.singleton tick_ix [ibi]) ) bmp0 (imodBreaks_breakInfo ibrks) -------------------------------------------------------------------------------- @@ -290,7 +287,7 @@ getCurrentBreakModule = do Nothing -> pure Nothing Just ibi -> do brks <- readIModBreaks hug ibi - return $ Just $ getBreakSourceMod ibi brks + return $ Just $ bi_tick_mod $ getBreakSourceId ibi brks ix -> Just <$> getHistoryModule hug (resumeHistory r !! (ix-1)) ===================================== compiler/GHC/Runtime/Eval.hs ===================================== @@ -151,7 +151,7 @@ getHistoryModule :: HUG.HomeUnitGraph -> History -> IO Module getHistoryModule hug hist = do let ibi = historyBreakpointId hist brks <- readIModBreaks hug ibi - return $ getBreakSourceMod ibi brks + return $ bi_tick_mod $ getBreakSourceId ibi brks getHistorySpan :: HUG.HomeUnitGraph -> History -> IO SrcSpan getHistorySpan hug hist = do ===================================== compiler/GHC/StgToByteCode.hs ===================================== @@ -63,7 +63,7 @@ import GHC.StgToCmm.Closure ( NonVoid(..), fromNonVoid, idPrimRepU, assertNonVoidIds, assertNonVoidStgArgs ) import GHC.StgToCmm.Layout import GHC.Runtime.Heap.Layout hiding (WordOff, ByteOff, wordsToBytes) -import GHC.Runtime.Interpreter ( interpreterProfiled, readIModModBreaks ) +import GHC.Runtime.Interpreter ( interpreterProfiled ) import GHC.Data.Bitmap import GHC.Data.FlatBag as FlatBag import GHC.Data.OrdList @@ -99,7 +99,6 @@ import GHC.CoreToIface import Control.Monad.IO.Class import Control.Monad.Trans.Reader (ReaderT(..)) import Control.Monad.Trans.State (StateT(..)) -import Data.Array ((!)) -- ----------------------------------------------------------------------------- -- Generating byte code for a complete module @@ -394,30 +393,26 @@ schemeR_wrk fvs nm original_body (args, body) -- | Introduce break instructions for ticked expressions. -- If no breakpoint information is available, the instruction is omitted. schemeER_wrk :: StackDepth -> BCEnv -> CgStgExpr -> BcM BCInstrList -schemeER_wrk d p (StgTick bp@(Breakpoint tick_ty tick_id fvs) rhs) = do - platform <- profilePlatform <$> getProfile - - code <- case rhs of - -- When we find a tick surrounding a case expression we introduce a new BRK_FUN - -- instruction at the start of the case *continuation*, in addition to the - -- usual BRK_FUN surrounding the StgCase) - -- See Note [TODO] - StgCase scrut bndr _ alts - -> doCase d 0 p (Just bp) scrut bndr alts - _ -> schemeE d 0 p rhs - - let idOffSets = getVarOffSets platform d p fvs - ty_vars = tyCoVarsOfTypesWellScoped (tick_ty:map idType fvs) - toWord :: Maybe (Id, WordOff) -> Maybe (Id, Word) - toWord = fmap (\(i, wo) -> (i, fromIntegral wo)) - breakInfo = dehydrateCgBreakInfo ty_vars (map toWord idOffSets) tick_ty (Right tick_id) - - mibi <- newBreakInfo breakInfo - - return $ case mibi of - Nothing -> code - Just ibi -> BRK_FUN ibi 0 `consOL` code +schemeER_wrk d p (StgTick (Breakpoint tick_ty tick_id fvs) rhs) = do + code <- schemeE d 0 p rhs + mb_current_mod_breaks <- getCurrentModBreaks + case mb_current_mod_breaks of + -- if we're not generating ModBreaks for this module for some reason, we + -- can't store breakpoint occurrence information. + Nothing -> pure code + Just current_mod_breaks -> do + platform <- profilePlatform <$> getProfile + let idOffSets = getVarOffSets platform d p fvs + ty_vars = tyCoVarsOfTypesWellScoped (tick_ty:map idType fvs) + toWord :: Maybe (Id, WordOff) -> Maybe (Id, Word) + toWord = fmap (\(i, wo) -> (i, fromIntegral wo)) + breakInfo = dehydrateCgBreakInfo ty_vars (map toWord idOffSets) tick_ty tick_id + + let info_mod = modBreaks_module current_mod_breaks + infox <- newBreakInfo breakInfo + let breakInstr = BRK_FUN (InternalBreakpointId info_mod infox) + return $ breakInstr `consOL` code schemeER_wrk d p rhs = schemeE d 0 p rhs getVarOffSets :: Platform -> StackDepth -> BCEnv -> [Id] -> [Maybe (Id, WordOff)] @@ -619,7 +614,7 @@ schemeE d s p (StgTick _ rhs) = schemeE d s p rhs schemeE d s p (StgCase scrut _ _ []) = schemeE d s p scrut schemeE d s p (StgCase scrut bndr _ alts) - = doCase d s p Nothing scrut bndr alts + = doCase d s p scrut bndr alts {- @@ -1111,15 +1106,11 @@ doCase :: StackDepth -> Sequel -> BCEnv - -> Maybe StgTickish - -- ^ The breakpoint surrounding the full case expression, if any (only - -- source-level cases get breakpoint ticks, and those are the only we care - -- about). See Note [TODO] -> CgStgExpr -> Id -> [CgStgAlt] -> BcM BCInstrList -doCase d s p m_bid scrut bndr alts +doCase d s p scrut bndr alts = do profile <- getProfile hsc_env <- getHscEnv @@ -1336,28 +1327,11 @@ doCase d s p m_bid scrut bndr alts let alt_final1 | ubx_tuple_frame = SLIDE 0 2 `consOL` alt_final0 | otherwise = alt_final0 - - alt_final <- case m_bid of - Just (Breakpoint tick_ty tick_id fvs) - | gopt Opt_InsertBreakpoints (hsc_dflags hsc_env) - -- Construct an internal breakpoint to put at the start of this case - -- continuation BCO. - -- See Note [TODO] - -> do - internal_tick_loc <- makeCaseInternalBreakLoc tick_id - - -- same fvs available in the case expression are available in the case continuation - let idOffSets = getVarOffSets platform d p fvs - ty_vars = tyCoVarsOfTypesWellScoped (tick_ty:map idType fvs) - toWord :: Maybe (Id, WordOff) -> Maybe (Id, Word) - toWord = fmap (\(i, wo) -> (i, fromIntegral wo)) - breakInfo = dehydrateCgBreakInfo ty_vars (map toWord idOffSets) tick_ty (Left internal_tick_loc) - - mibi <- newBreakInfo breakInfo - return $ case mibi of - Nothing -> alt_final1 - Just ibi -> {- BRK_FUN ibi (d_alts - d) `consOL` -} alt_final1 - _ -> pure alt_final1 + alt_final + | gopt Opt_InsertBreakpoints (hsc_dflags hsc_env) + -- See Note [Debugger: BRK_ALTS] + = BRK_ALTS False `consOL` alt_final1 + | otherwise = alt_final1 add_bco_name <- shouldAddBcoName let @@ -1377,24 +1351,6 @@ doCase d s p m_bid scrut bndr alts _ -> panic "schemeE(StgCase).push_alts" in return (PUSH_ALTS alt_bco scrut_rep `consOL` scrut_code) -makeCaseInternalBreakLoc :: BreakpointId -> BcM InternalBreakLoc -makeCaseInternalBreakLoc bid = do - hug <- hsc_HUG <$> getHscEnv - curr_mod <- getCurrentModule - mb_mod_brks <- getCurrentModBreaks - - -- TODO: Subtract the scrutinee loc from the case loc to get continuation loc - InternalBreakLoc <$> case bid of - BreakpointId{bi_tick_mod, bi_tick_index} - | bi_tick_mod == curr_mod - , Just these_mbs <- mb_mod_brks - -> do - return $ modBreaks_locs these_mbs ! bi_tick_index - | otherwise - -> do - other_mbs <- liftIO $ readIModModBreaks hug bi_tick_mod - return $ modBreaks_locs other_mbs ! bi_tick_index - {- Note [Debugger: BRK_ALTS] ~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -2715,19 +2671,14 @@ getLabelsBc n = BcM $ \_ st -> let ctr = nextlabel st in return (coerce [ctr .. ctr+n-1], st{nextlabel = ctr+n}) -newBreakInfo :: CgBreakInfo -> BcM (Maybe InternalBreakpointId) -newBreakInfo info = BcM $ \env st -> do - -- if we're not generating ModBreaks for this module for some reason, we - -- can't store breakpoint occurrence information. - case modBreaks env of - Nothing -> pure (Nothing, st) - Just modBreaks -> do - let ix = breakInfoIdx st - st' = st - { breakInfo = IntMap.insert ix info (breakInfo st) - , breakInfoIdx = ix + 1 - } - return (Just $ InternalBreakpointId (modBreaks_module modBreaks) ix, st') +newBreakInfo :: CgBreakInfo -> BcM Int +newBreakInfo info = BcM $ \_ st -> + let ix = breakInfoIdx st + st' = st + { breakInfo = IntMap.insert ix info (breakInfo st) + , breakInfoIdx = ix + 1 + } + in return (ix, st') getCurrentModule :: BcM Module getCurrentModule = BcM $ \env st -> return (bcm_module env, st) @@ -2740,7 +2691,7 @@ tickFS = fsLit "ticked" -- Dehydrating CgBreakInfo -dehydrateCgBreakInfo :: [TyVar] -> [Maybe (Id, Word)] -> Type -> Either InternalBreakLoc BreakpointId -> CgBreakInfo +dehydrateCgBreakInfo :: [TyVar] -> [Maybe (Id, Word)] -> Type -> BreakpointId -> CgBreakInfo dehydrateCgBreakInfo ty_vars idOffSets tick_ty bid = CgBreakInfo { cgb_tyvars = map toIfaceTvBndr ty_vars ===================================== ghc/GHCi/UI.hs ===================================== @@ -45,7 +45,7 @@ import GHC.Runtime.Eval (mkTopLevEnv) import GHC.Runtime.Eval.Utils -- The GHC interface -import GHC.ByteCode.Breakpoints (imodBreaks_modBreaks, InternalBreakpointId(..), getBreakSourceId, getBreakSourceMod) +import GHC.ByteCode.Breakpoints (imodBreaks_modBreaks, InternalBreakpointId(..), getBreakSourceId) import GHC.Runtime.Interpreter import GHCi.RemoteTypes import GHCi.BreakArray( breakOn, breakOff ) @@ -1621,7 +1621,7 @@ toBreakIdAndLocation (Just inf) = do brks <- liftIO $ readIModBreaks hug inf let bi = getBreakSourceId inf brks return $ listToMaybe [ id_loc | id_loc@(_,loc) <- IntMap.assocs (breaks st), - Right (breakId loc) == bi ] + breakId loc == bi ] printStoppedAtBreakInfo :: GHC.GhcMonad m => Resume -> [Name] -> m () printStoppedAtBreakInfo res names = do @@ -3825,7 +3825,7 @@ pprStopped res = do hug <- hsc_HUG <$> GHC.getSession brks <- liftIO $ readIModBreaks hug ibi return $ Just $ moduleName $ - getBreakSourceMod ibi brks + bi_tick_mod $ getBreakSourceId ibi brks return $ text "Stopped in" <+> ((case mb_mod_name of ===================================== rts/Disassembler.c ===================================== @@ -85,18 +85,16 @@ disInstr ( StgBCO *bco, int pc ) switch (instr & 0xff) { case bci_BRK_FUN: { - W_ p1, info_mod, info_unit_id, info_wix, byte_off, np; + W_ p1, info_mod, info_unit_id, info_wix, np; p1 = BCO_GET_LARGE_ARG; info_mod = BCO_GET_LARGE_ARG; info_unit_id = BCO_GET_LARGE_ARG; info_wix = BCO_NEXT; - byte_off = BCO_NEXT; np = BCO_GET_LARGE_ARG; debugBelch ("BRK_FUN " ); printPtr( ptrs[p1] ); debugBelch(" %" FMT_Word, literals[info_mod] ); debugBelch(" %" FMT_Word, literals[info_unit_id] ); debugBelch(" %" FMT_Word, info_wix ); - debugBelch(" %" FMT_Word, byte_off ); CostCentre* cc = (CostCentre*)literals[np]; if (cc) { debugBelch(" %s", cc->label); ===================================== rts/Interpreter.c ===================================== @@ -747,7 +747,6 @@ interpretBCO (Capability* cap) /* info_mod_name = */ BCO_GET_LARGE_ARG; /* info_mod_id = */ BCO_GET_LARGE_ARG; arg4_info_index = BCO_NEXT; - /* byte_off = BCO_NEXT; */ StgPtr* ptrs = (StgPtr*)(&bco->ptrs->payload[0]); StgArrBytes* breakPoints = (StgArrBytes *) BCO_PTR(arg1_brk_array); @@ -1573,9 +1572,9 @@ run_BCO: /* check for a breakpoint on the beginning of a let binding */ case bci_BRK_FUN: { - W_ arg1_brk_array, arg2_info_mod_name, arg3_info_mod_id, arg4_info_index, arg5_byte_off; + W_ arg1_brk_array, arg2_info_mod_name, arg3_info_mod_id, arg4_info_index; #if defined(PROFILING) - W_ arg6_cc; + W_ arg5_cc; #endif StgArrBytes *breakPoints; int returning_from_break, stop_next_breakpoint; @@ -1593,9 +1592,8 @@ run_BCO: arg2_info_mod_name = BCO_GET_LARGE_ARG; arg3_info_mod_id = BCO_GET_LARGE_ARG; arg4_info_index = BCO_NEXT; - arg5_byte_off = BCO_NEXT; #if defined(PROFILING) - arg6_cc = BCO_GET_LARGE_ARG; + arg5_cc = BCO_GET_LARGE_ARG; #else BCO_GET_LARGE_ARG; #endif @@ -1615,7 +1613,7 @@ run_BCO: #if defined(PROFILING) cap->r.rCCCS = pushCostCentre(cap->r.rCCCS, - (CostCentre*)BCO_LIT(arg6_cc)); + (CostCentre*)BCO_LIT(arg5_cc)); #endif // if we are returning from a break then skip this section @@ -1655,12 +1653,7 @@ run_BCO: // copy the contents of the top stack frame into the AP_STACK for (i = 2; i < size_words; i++) { - // BAD ASSUMPTION: BITMAP Vars are on top of the stack. - // THEY ARE NOT FOR PUSH_ALTS: - // THE FIRST THING ON THE STACK IS GOING TO BE - // ctoi_*** - //TODO UPDATE DOCUMENTATION EXPLANING ARG5_BYTE_OFF - new_aps->payload[i] = (StgClosure *)ReadSpB(((ptrdiff_t)(i-2) * (ptrdiff_t)sizeof(W_)) + arg5_byte_off); + new_aps->payload[i] = (StgClosure *)ReadSpW(i-2); } // No write barrier is needed here as this is a new allocation ===================================== testsuite/tests/ghci.debugger/scripts/all.T ===================================== @@ -147,7 +147,7 @@ test('T25932', extra_files(['T25932.hs']), ghci_script, ['T25932.script']) # Step out tests test('T26042b', [extra_hc_opts('-O -fno-unoptimized-core-for-interpreter'), extra_files(['T26042b.hs'])], ghci_script, ['T26042b.script']) -test('T26042c', [extra_hc_opts('-O -fno-unoptimized-core-for-interpreter'), extra_files(['T26042c.hs'])], ghci_script, ['T26042c.script']) +test('T26042c', [expect_broken(26042),extra_hc_opts('-O -fno-unoptimized-core-for-interpreter'), extra_files(['T26042c.hs'])], ghci_script, ['T26042c.script']) test('T26042d', [extra_hc_opts('-O -fno-unoptimized-core-for-interpreter'), extra_files(['T26042d.hs'])], ghci_script, ['T26042d.script']) test('T26042e', extra_files(['T26042e.hs']), ghci_script, ['T26042e.script']) test('T26042f1', extra_files(['T26042f.hs', 'T26042f.script']), ghci_script, ['T26042f.script']) # >> is not inlined, so stepout has nowhere to stop View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/5da18c2307b56e032a14577806e163c1... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/5da18c2307b56e032a14577806e163c1... You're receiving this email because of your account on gitlab.haskell.org.