<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_5626"><span id="yui_3_16_0_1_1439675410672_6802">Thanks,</span></div><div id="yui_3_16_0_1_1439675410672_5626" dir="ltr"><span id="yui_3_16_0_1_1439675410672_7187">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.</span></div><div id="yui_3_16_0_1_1439675410672_5626" dir="ltr"><span><br></span></div><div id="yui_3_16_0_1_1439675410672_5626" dir="ltr">Trying to use Debug.Trace.trace or Debug.Trace.traceStack, I now get the following error :</div><div id="yui_3_16_0_1_1439675410672_5626" dir="ltr"><br></div><div id="yui_3_16_0_1_1439675410672_5626" dir="ltr" class="">      GHC [stage 1] compiler/stage2/build/Module.o-boot</div><div id="yui_3_16_0_1_1439675410672_5626" dir="ltr" class="">      ghc-stage1: panic! (the 'impossible' happened)</div><div id="yui_3_16_0_1_1439675410672_5626" dir="ltr" class="">      (GHC version 7.11.20150810 for x86_64-unknown-linux):</div><div id="yui_3_16_0_1_1439675410672_5626" dir="ltr" class=""><span class="" style="white-space:pre-wrap;">             </span>v_unsafeGlobalDynFlags: not initialised</div><div dir="ltr" class="" id="yui_3_16_0_1_1439675410672_6020"><br class=""></div><div></div><div id="yui_3_16_0_1_1439675410672_6411"> </div><div class="signature" id="yui_3_16_0_1_1439675410672_6412">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 13h45, Edward Z. Yang <ezyang@mit.edu> a écrit :<br> </font> </div>  <br><br> <div class="y_msg_container">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"><div class="yqt0100163986" id="yqtfd06590"><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"></div><br><br></div>  </div> </div>  </div></div></body></html>