On 29/11/2013 10:28, Joachim Breitner wrote:
Hi,
Am Freitag, den 29.11.2013, 10:08 +0000 schrieb Simon Marlow:
Actually this isn't quite right. compiler_debugged() is true when
GhcDebugged=YES in the build system, and GhcDebugged controls whether
GHC is compiled with -debug or not.
That is, compiler_debugged() tells us whether the compiler was compiled
with -debug, not -DDEBUG. The -debug flag links in the debug RTS and
doesn't change allocation or heap residency, whereas -DDEBUG enables
assertions in the compiler and *does* change allocation and heap residency.
It looks like we need another predicate to tell us whether GHC was
compiled with -DDEBUG or not.
Would you mind backing out these changes in the meantime?
are you sure? compiler_debugged() is certainly true when I build ghc
with
GhcStage2HcOpts = -O0 -DDEBUG
which yields
./inplace/bin/ghc-stage2 --info|grep 'Debug on'
,("Debug on","True")
but
./inplace/bin/ghc-stage2 +RTS --info|grep -i debug
is empty.
The test runner sets the value testsuite/mk/ghc-config.hs:
info <- readProcess ghc ["--info"] ""
let fields = read info :: [(String,String)]
getGhcFieldOrFail fields "GhcDebugged" "Debug on"
which writes to testsuite/mk/ghcconfig_*
which is then read by testsuite/mk/boilerplate.mk
which is included everywhere
including mk/test.mk which sets "-e ghc_debugged=$(GhcDebugged)"
Oh, we use the same variable name GhcDebugged to mean two different
things: in the GHC build system it means that GHC was compiled with
-debug, but in the testsuite build system it means that GHC was compiled
with -DDEBUG. How confusing!
Anyway you're right - there doesn't seem to be a bug, but we should
rename things to avoid confusion. I'll do that.
So it seems that it is simply the wiki documentation that is wrong here.
I didn't check the wiki, just got confused by the source. Please go
ahead and fix the wiki if there's something wrong there.
Cheers,
Simon
_______________________________________________
ghc-devs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/ghc-devs