Enabling debugging output

Jan Stolarek jan.stolarek at p.lodz.pl
Thu Apr 25 12:04:35 CEST 2013


I have some problems with enabling debugging output. I have broken the compiler in such a way that 
for some programs I'm getting compiler panic when using some of the flags (-ddump-simpl, -fhpc):

Main.h :: GHC.Types.Float -> GHC.Base.String
[GblId, Arity=1, Str=DmdType]
Main.h =ghc-stage2: panic! (the 'impossible' happened)
  (GHC version 7.7.20130422 for x86_64-unknown-linux):
	Impossible case alternative

I would like to get output from the assertions and warnings placed in the code, for example in 
this function in simplCore/Simplify.lhs (this is the source of my error message):

missingAlt :: SimplEnv -> Id -> [InAlt] -> SimplCont -> SimplM (SimplEnv, OutExpr)
missingAlt env case_bndr _ cont
  = WARN( True, ptext (sLit "missingAlt") <+> ppr case_bndr )
    return (env, mkImpossibleExpr (contResultType cont))

I recompiled GHC with the -DDEBUG option, but when I add -debug flag during program compilation I 
see no output from WARN directive. Are there any additional options I need to enable?

Janek

P.S. My build.mk has these lines:

BuildFlavour = quick

ifeq "$(BuildFlavour)" "quick"

SRC_HC_OPTS        = -H64m -O0 -fasm
GhcStage1HcOpts    = -O -fasm -Werror -Rghc-timing -DDEBUG
GhcStage2HcOpts    = -O0 -fasm -Werror -Rghc-timing -DDEBUG
GhcLibHcOpts       = -O -fasm
SplitObjs          = NO
HADDOCK_DOCS       = NO
BUILD_DOCBOOK_HTML = NO
BUILD_DOCBOOK_PS   = NO
BUILD_DOCBOOK_PDF  = NO

endif



More information about the ghc-devs mailing list