[Git][ghc/ghc][wip/24327] GHCi: Lookup breakpoint CCs in the correct module

Zubin (@wz1000) gitlab at gitlab.haskell.org
Thu Jan 11 11:03:26 UTC 2024



Zubin pushed to branch wip/24327 at Glasgow Haskell Compiler / GHC


Commits:
b58753ef by Zubin Duggal at 2024-01-11T16:33:19+05:30
GHCi: Lookup breakpoint CCs in the correct module

We need to look up breakpoint CCs in the module that the breakpoint
points to, and not the current module.

Fixes #24327

- - - - -


1 changed file:

- compiler/GHC/StgToByteCode.hs


Changes:

=====================================
compiler/GHC/StgToByteCode.hs
=====================================
@@ -391,8 +391,7 @@ schemeER_wrk d p (StgTick (Breakpoint tick_ty tick_no fvs mod) rhs) = do
   current_mod_breaks <- getCurrentModBreaks
   case break_info hsc_env mod current_mod current_mod_breaks of
     Nothing -> pure code
-    Just ModBreaks {modBreaks_flags = breaks, modBreaks_module = mod_ptr} -> do
-      cc_arr <- getCCArray
+    Just ModBreaks {modBreaks_flags = breaks, modBreaks_module = mod_ptr, modBreaks_ccs = cc_arr} -> do
       platform <- profilePlatform <$> getProfile
       let idOffSets = getVarOffSets platform d p fvs
           ty_vars   = tyCoVarsOfTypesWellScoped (tick_ty:map idType fvs)
@@ -2260,12 +2259,6 @@ getLabelsBc n
   = BcM $ \st -> let ctr = nextlabel st
                  in return (st{nextlabel = ctr+n}, coerce [ctr .. ctr+n-1])
 
-getCCArray :: BcM (Array BreakIndex (RemotePtr CostCentre))
-getCCArray = BcM $ \st ->
-  let breaks = expectJust "GHC.StgToByteCode.getCCArray" $ modBreaks st in
-  return (st, modBreaks_ccs breaks)
-
-
 newBreakInfo :: BreakIndex -> CgBreakInfo -> BcM ()
 newBreakInfo ix info = BcM $ \st ->
   return (st{breakInfo = IntMap.insert ix info (breakInfo st)}, ())



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/b58753effb08bd1b135a23b849437227bf6e97a2

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/b58753effb08bd1b135a23b849437227bf6e97a2
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20240111/ebed1f6a/attachment-0001.html>


More information about the ghc-commits mailing list