projects
/
ghc-hetmet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
058b5c2
)
#2197: try to detect when GHCi is compiled with -prof and emit an error message
author
Simon Marlow
<simonmar@microsoft.com>
Wed, 6 May 2009 19:48:02 +0000
(19:48 +0000)
committer
Simon Marlow
<simonmar@microsoft.com>
Wed, 6 May 2009 19:48:02 +0000
(19:48 +0000)
ghc/InteractiveUI.hs
patch
|
blob
|
history
diff --git
a/ghc/InteractiveUI.hs
b/ghc/InteractiveUI.hs
index
4aa441e
..
323dc25
100644
(file)
--- a/
ghc/InteractiveUI.hs
+++ b/
ghc/InteractiveUI.hs
@@
-38,6
+38,7
@@
import Outputable hiding (printForUser, printForUserPartWay)
import Module -- for ModuleEnv
import Name
import SrcLoc
import Module -- for ModuleEnv
import Name
import SrcLoc
+import ObjLink
-- Other random utilities
import CmdLineParser
-- Other random utilities
import CmdLineParser
@@
-285,6
+286,13
@@
findEditor = do
interactiveUI :: [(FilePath, Maybe Phase)] -> Maybe [String]
-> Ghc ()
interactiveUI srcs maybe_exprs = do
interactiveUI :: [(FilePath, Maybe Phase)] -> Maybe [String]
-> Ghc ()
interactiveUI srcs maybe_exprs = do
+ -- although GHCi compiles with -prof, it is not usable: the byte-code
+ -- compiler and interpreter don't work with profiling. So we check for
+ -- this up front and emit a helpful error message (#2197)
+ m <- liftIO $ lookupSymbol "PushCostCentre"
+ when (isJust m) $
+ ghcError (InstallationError "GHCi cannot be used when compiled with -prof")
+
-- HACK! If we happen to get into an infinite loop (eg the user
-- types 'let x=x in x' at the prompt), then the thread will block
-- on a blackhole, and become unreachable during GC. The GC will
-- HACK! If we happen to get into an infinite loop (eg the user
-- types 'let x=x in x' at the prompt), then the thread will block
-- on a blackhole, and become unreachable during GC. The GC will