summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--hadrian/src/Flavour/Type.hs2
-rw-r--r--hadrian/src/Settings/Builders/RunTest.hs12
2 files changed, 11 insertions, 3 deletions
diff --git a/hadrian/src/Flavour/Type.hs b/hadrian/src/Flavour/Type.hs
index 9f992fd6f2..b21953e9de 100644
--- a/hadrian/src/Flavour/Type.hs
+++ b/hadrian/src/Flavour/Type.hs
@@ -32,7 +32,7 @@ data Flavour = Flavour {
ghciWithDebugger :: Bool,
-- | Build profiled GHC.
ghcProfiled :: Bool,
- -- | Build GHC with debugging assertions.
+ -- | Build GHC with debug RTS
ghcDebugged :: Bool,
-- | Build the GHC executable against the threaded runtime system.
ghcThreaded :: Bool,
diff --git a/hadrian/src/Settings/Builders/RunTest.hs b/hadrian/src/Settings/Builders/RunTest.hs
index 6a49334a70..51a21183e1 100644
--- a/hadrian/src/Settings/Builders/RunTest.hs
+++ b/hadrian/src/Settings/Builders/RunTest.hs
@@ -2,7 +2,7 @@
module Settings.Builders.RunTest (runTestBuilderArgs, runTestGhcFlags) where
import Hadrian.Utilities
-import System.Environment
+import System.Environment hiding (getArgs)
import CommandLine
import Oracles.TestSettings
@@ -12,6 +12,7 @@ import qualified Data.Set as Set
import Flavour
import qualified Context.Type as C
import System.Directory (findExecutable)
+import Hadrian.Target (target)
getTestSetting :: TestSetting -> Expr String
getTestSetting key = expr $ testSetting key
@@ -95,7 +96,14 @@ inTreeCompilerArgs stg = expr $ do
withInterpreter <- ghcWithInterpreter
unregisterised <- flag GhcUnregisterised
withSMP <- targetSupportsSMP
- debugged <- ghcDebugged <$> flavour
+ -- --info reports "Debug on = YES" if debugIsOn = True which is set by passing -DDEBUG to
+ -- "compiler/GHC/Utils/Constants.hs"
+ debug_args <-
+ interpret (target (Context stg compiler vanilla)
+ (Ghc CompileHs stg)
+ ["compiler" -/- "GHC" -/- "Utils" -/- "Constants.hs"] [""])
+ getArgs
+ let debugged = "-DDEBUG" `elem` debug_args
profiled <- ghcProfiled <$> flavour
os <- setting HostOs