- handleBkptEx _ NotNeeded = error "Nothing to do"
- handleBkptEx m NotHandled = error$ "Module " ++ showSDoc (ppr m) ++ " was not loaded under debugging mode. Enable debugging mode with -fdebugging (and reload your module)"
+ handleBkptEx _ _ NotNeeded = error "Nothing to do"
+ handleBkptEx s m NotHandled = io$
+ findModSummary m >>= \mod_summary ->
+ isModuleInterpreted s mod_summary >>= \it ->
+ if it
+ then error$ "Module " ++ showSDoc (ppr m) ++ " was not loaded under debugging mode.\n"
+ ++ "Enable debugging mode with -fdebugging (and reload your module)"
+ else error$ "Module " ++ showSDoc (ppr m) ++ " was loaded in compiled (.o) mode.\n"
+ ++ "You must load a module in interpreted mode and with -fdebugging on to debug it."
+ where findModSummary m = getModuleGraph s >>= \mod_graph ->
+ case [ modsum | modsum <- mod_graph
+ , ms_mod modsum == m ] of
+ [modsum] -> return modsum