<html><body><div style="color:#000; background-color:#fff; font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:16px"><div id="yui_3_16_0_1_1439675410672_23703"><span id="yui_3_16_0_1_1439675410672_24451">Thanks Edward !</span></div><div id="yui_3_16_0_1_1439675410672_23703"><span id="yui_3_16_0_1_1439675410672_26910">I'll heed your advice.</span></div><div></div><div id="yui_3_16_0_1_1439675410672_23702"> </div><div class="signature" id="yui_3_16_0_1_1439675410672_23701">Omar Mefire, </div>  <br><div class="qtdSeparateBR"><br><br></div><div class="yahoo_quoted" style="display: block;"> <div style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 16px;"> <div style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 16px;"> <div dir="ltr"> <font size="2" face="Arial"> Le Samedi 15 août 2015 15h05, Edward Z. Yang <ezyang@mit.edu> a écrit :<br> </font> </div>  <br><br> <div class="y_msg_container">If you are really just using trace, and using it on a plain<br clear="none">set of strings from the command line, this shouldn't happen.<br clear="none">Hard to say more without a diff.<br clear="none"><br clear="none">Why not experiment with tracing GHC in NOT ghc/Main.hs, or at least<br clear="none">after the code that sets up the global dynamic flags is all done?  If<br clear="none">you add trace statements to the type checker, you can expect pprTrace to<br clear="none">work fine.  As is, you're in a lot of pain for not very much benefit.<br clear="none"><br clear="none">Edward<br clear="none"><div class="yqt4167068545" id="yqtfd67514"><br clear="none">Excerpts from Omar Mefire's message of 2015-08-15 14:56:35 -0700:<br clear="none">> 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.<br clear="none">> Trying to use Debug.Trace.trace or Debug.Trace.traceStack, I now get the following error :<br clear="none">>       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<br clear="none">>  Omar Mefire, <br clear="none">> <br clear="none">> <br clear="none">>      Le Samedi 15 août 2015 13h45, Edward Z. Yang <<a shape="rect" ymailto="mailto:ezyang@mit.edu" href="mailto:ezyang@mit.edu">ezyang@mit.edu</a>> a écrit :<br clear="none">>    <br clear="none">> <br clear="none">>  It is just as the message says: you can't use pprTrace too early in the<br clear="none">> execution of a GHC program.  It looks like you're trying to print<br clear="none">> something pretty simple, so why not try a plain old Debug.Trace trace?<br clear="none">> <br clear="none">> Edward<br clear="none">> <br clear="none">> Excerpts from Omar Mefire's message of 2015-08-15 13:40:35 -0700:<br clear="none">> > 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 :<br clear="none">> >        let argv1' = map (mkGeneralLocated "on the commandline") argv1       (argv2, staticFlagWarnings) <- pprTrace "argv1 prime" (ppr argv1') $ parseStaticFlags argv1'<br clear="none">> > 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 :<br clear="none">> >       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.<br clear="none">> > What am I doing wrong ? Omar Mefire, <br clear="none">> <br clear="none"></div><br><br></div>  </div> </div>  </div></div></body></html>