X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=compiler%2Fmain%2FInteractiveEval.hs;h=c80f2933f793167f9d34738b8dd906878c3717eb;hp=f7e910135eb12851df2dac875378135e90365fe4;hb=ede84b2aad85b55c616d91e8863f8c8ce8bc17a9;hpb=54fd57cdd7c974f81dee81e8edc53e78de82db04 diff --git a/compiler/main/InteractiveEval.hs b/compiler/main/InteractiveEval.hs index f7e9101..c80f293 100644 --- a/compiler/main/InteractiveEval.hs +++ b/compiler/main/InteractiveEval.hs @@ -268,10 +268,18 @@ foreign import ccall "&rts_breakpoint_io_action" sandboxIO :: MVar Status -> IO [HValue] -> IO Status sandboxIO statusMVar thing = withInterruptsSentTo - (forkIO (do res <- Exception.try thing + (forkIO (do res <- Exception.try (rethrow thing) putMVar statusMVar (Complete res))) (takeMVar statusMVar) +-- | this just re-throws any exceptions received. The point of this +-- is that if -fbreak-on-excepsions is on, we only get a chance to break +-- for synchronous exceptions, and this turns an async exception into +-- a sync exception, so for instance a ^C exception will break right here +-- unless it is caught elsewhere. +rethrow :: IO a -> IO a +rethrow io = Exception.catch io Exception.throwIO + withInterruptsSentTo :: IO ThreadId -> IO r -> IO r withInterruptsSentTo io get_result = do ts <- takeMVar interruptTargetThread