How to use pprTrace ?
omefire at yahoo.fr
Sat Aug 15 21:56:35 UTC 2015
Thanks,It's pretty simple what I wanna print, I'm trying to familiarize myself with debugging GHC so I can get a general feel for how the whole thing works.
Trying to use Debug.Trace.trace or Debug.Trace.traceStack, I now get the following error :
GHC [stage 1] compiler/stage2/build/Module.o-boot ghc-stage1: panic! (the 'impossible' happened) (GHC version 7.11.20150810 for x86_64-unknown-linux): v_unsafeGlobalDynFlags: not initialised
Le Samedi 15 août 2015 13h45, Edward Z. Yang <ezyang at mit.edu> a écrit :
It is just as the message says: you can't use pprTrace too early in the
execution of a GHC program. It looks like you're trying to print
something pretty simple, so why not try a plain old Debug.Trace trace?
Excerpts from Omar Mefire's message of 2015-08-15 13:40:35 -0700:
> Hi all,I'm trying to step through some ghc code.I am trying to use pprTrace ( for the first time ) and I keep getting an error when I use it :I've added it to the file ghc/Main.hs and the resulting code is this :
> let argv1' = map (mkGeneralLocated "on the commandline") argv1 (argv2, staticFlagWarnings) <- pprTrace "argv1 prime" (ppr argv1') $ parseStaticFlags argv1'
> I want to examine the value of argv1'. After my modification, I go into the ghc/ folder and run : 'make'But doing this leads to an error when I try to run the program :
> ghc-stage2: panic! (the 'impossible' happened) (GHC version 7.11.20150810 for x86_64-unknown-linux): Static flags have not been initialised! Please call GHC.parseStaticFlags early enough.
> What am I doing wrong ? Omar Mefire,
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the ghc-devs