Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC Commits: 89898ce6 by echoumcp1 at 2026-02-09T17:30:01-05:00 Replace putstrln with logMsg in handleSeqHValueStatus Fixes #26549 - - - - - 2 changed files: - compiler/GHC/Runtime/Heap/Inspect.hs - compiler/GHC/Runtime/Interpreter.hs Changes: ===================================== compiler/GHC/Runtime/Heap/Inspect.hs ===================================== @@ -788,6 +788,7 @@ cvObtainTerm hsc_env max_depth force old_ty hval = runTR hsc_env $ do where interp = hscInterp hsc_env unit_env = hsc_unit_env hsc_env + logger = hsc_logger hsc_env go :: Int -> Type -> Type -> ForeignHValue -> TcM Term -- [SPJ May 11] I don't understand the difference between my_ty and old_ty @@ -812,7 +813,7 @@ cvObtainTerm hsc_env max_depth force old_ty hval = runTR hsc_env $ do -- Thunks we may want to force t | isThunk t && force -> do traceTR (text "Forcing a " <> text (show (fmap (const ()) t))) - evalRslt <- liftIO $ GHCi.seqHValue interp unit_env a + evalRslt <- liftIO $ GHCi.seqHValue interp unit_env logger a case evalRslt of -- #2950 EvalSuccess _ -> go (pred max_depth) my_ty old_ty a EvalException ex -> do ===================================== compiler/GHC/Runtime/Interpreter.hs ===================================== @@ -85,11 +85,13 @@ import GHC.Data.FastString import GHC.Types.SrcLoc import GHC.Types.Basic +import GHC.Types.Error import GHC.Utils.Panic import GHC.Utils.Exception as Ex -import GHC.Utils.Outputable(brackets, ppr, showSDocUnsafe) +import GHC.Utils.Outputable import GHC.Utils.Fingerprint +import GHC.Utils.Logger (Logger, logMsg) import GHC.Unit.Module import GHC.Unit.Home.ModInfo @@ -401,11 +403,11 @@ whereFrom interp ref = interpCmd interp (WhereFrom hval) -- | Send a Seq message to the iserv process to force a value #2950 -seqHValue :: Interp -> UnitEnv -> ForeignHValue -> IO (EvalResult ()) -seqHValue interp unit_env ref = +seqHValue :: Interp -> UnitEnv -> Logger -> ForeignHValue -> IO (EvalResult ()) +seqHValue interp unit_env logger ref = withForeignRef ref $ \hval -> do status <- interpCmd interp (Seq hval) - handleSeqHValueStatus interp unit_env status + handleSeqHValueStatus interp unit_env logger status evalBreakpointToId :: EvalBreakpoint -> InternalBreakpointId evalBreakpointToId eval_break = @@ -419,16 +421,15 @@ evalBreakpointToId eval_break = } -- | Process the result of a Seq or ResumeSeq message. #2950 -handleSeqHValueStatus :: Interp -> UnitEnv -> EvalStatus () -> IO (EvalResult ()) -handleSeqHValueStatus interp unit_env eval_status = +handleSeqHValueStatus :: Interp -> UnitEnv -> Logger -> EvalStatus () -> IO (EvalResult ()) +handleSeqHValueStatus interp unit_env logger eval_status = case eval_status of (EvalBreak _ maybe_break resume_ctxt _) -> do -- A breakpoint was hit; inform the user and tell them -- which breakpoint was hit. resume_ctxt_fhv <- liftIO $ mkFinalizedHValue interp resume_ctxt - - let put x = putStrLn ("*** Ignoring breakpoint " ++ (showSDocUnsafe x)) - let nothing_case = put $ brackets . ppr $ mkGeneralSrcSpan (fsLit "<unknown>") + let put loc = logMsg logger MCOutput loc ("*** Ignoring breakpoint" <+> brackets (ppr loc)) + let nothing_case = put noSrcSpan case maybe_break of Nothing -> nothing_case -- Nothing case - should not occur! @@ -445,13 +446,12 @@ handleSeqHValueStatus interp unit_env eval_status = -- Nothing case - should not occur! We should have the appropriate -- breakpoint information Nothing -> nothing_case - Just modbreaks -> put . brackets . ppr =<< - getBreakLoc (readIModModBreaks hug) ibi modbreaks + Just modbreaks -> put =<< getBreakLoc (readIModModBreaks hug) ibi modbreaks -- resume the seq (:force) processing in the iserv process withForeignRef resume_ctxt_fhv $ \hval -> do status <- interpCmd interp (ResumeSeq hval) - handleSeqHValueStatus interp unit_env status + handleSeqHValueStatus interp unit_env logger status (EvalComplete _ r) -> return r View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/89898ce6706e5a5e92081cea60f3eeab... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/89898ce6706e5a5e92081cea60f3eeab... You're receiving this email because of your account on gitlab.haskell.org.