(r:rs) -> do
let ix = GHC.resumeHistoryIx r
if ix == 0
- then return (GHC.breakInfo_module `fmap` GHC.resumeBreakInfo r)
+ then return (GHC.breakInfo_module `liftM` GHC.resumeBreakInfo r)
else do
let hist = GHC.resumeHistory r !! (ix-1)
return $ Just $ GHC.getHistoryModule hist
historyApStack :: HValue,
historyBreakInfo :: BreakInfo,
historyEnclosingDecl :: Name
- -- ^^ A cache of the enclosing declaration, for convenience
+ -- ^^ A cache of the enclosing top level declaration, for convenience
}
mkHistory :: HscEnv -> HValue -> BreakInfo -> History
Just hmi -> modBreaks_locs (md_modBreaks (hm_details hmi)) ! num
_ -> panic "getHistorySpan"
+-- | Finds the enclosing top level function name
findEnclosingDecl :: HscEnv -> Module -> SrcSpan -> Name
findEnclosingDecl hsc_env mod span =
- case lookupUFM (hsc_HPT hsc_env) (moduleName mod) of
+ case lookupUFM (hsc_HPT hsc_env) (moduleName mod) of
Nothing -> panic "findEnclosingDecl"
Just hmi -> let
globals = typeEnvIds (md_types (hm_details hmi))