+
+-- Nothing case: we stopped when an exception was raised, not at a
+-- breakpoint. We have no location information or local variables to
+-- bind, all we can do is bind a local variable to the exception
+-- value.
+bindLocalsAtBreakpoint hsc_env apStack Nothing = do
+ let exn_fs = FSLIT("_exception")
+ exn_name = mkInternalName (getUnique exn_fs) (mkVarOccFS exn_fs) span
+ e_fs = FSLIT("e")
+ e_name = mkInternalName (getUnique e_fs) (mkTyVarOcc e_fs) span
+ e_tyvar = mkTcTyVar e_name liftedTypeKind (SkolemTv RuntimeUnkSkol)
+ exn_id = Id.mkGlobalId VanillaGlobal exn_name (mkTyVarTy e_tyvar)
+ vanillaIdInfo
+ new_tyvars = unitVarSet e_tyvar
+
+ ictxt0 = hsc_IC hsc_env
+ ictxt1 = extendInteractiveContext ictxt0 [exn_id] new_tyvars
+
+ span = mkGeneralSrcSpan FSLIT("<exception thrown>")
+ --
+ Linker.extendLinkEnv [(exn_name, unsafeCoerce# apStack)]
+ return (hsc_env{ hsc_IC = ictxt1 }, [exn_name], span)
+
+-- Just case: we stopped at a breakpoint, we have information about the location
+-- of the breakpoint and the free variables of the expression.
+bindLocalsAtBreakpoint hsc_env apStack (Just info) = do