Changes between Version 4 and Version 5 of ExplicitCallStack/StackTraceExperience


Ignore:
Timestamp:
Feb 2, 2007 4:39:34 PM (8 years ago)
Author:
guest
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ExplicitCallStack/StackTraceExperience

    v4 v5  
    3838} 
    3939}}} 
    40     
     40I had to add the type annotation on the literal 30 because defaulting doesn't work in hat. 
    4141 
    42    
     42Commands to prepare for tracing: 
     43{{{ 
     44    hmake -hat Main 
     45}}} 
    4346 
     47Commands to see stack trace: 
     48{{{ 
     49   hat-stack Main | less 
     50}}} 
     51 
     52Output: 
     53{{{ 
     54Program terminated with error: 
     55        divide by zero 
     56Virtual stack trace: 
     57(unknown)       {?} 
     58(Utils.hs:108)  div 2 0 
     59(unknown)       k' 
     60(Utils.hs:119)  rands 1 2 
     61(Utils.hs:118)  utRandomInts 1 2 ESC[1;34m|ESC[0mESC[0m ESC[1;34mifESC[0mESC[0m True 
     62(FrontierDATAFN2.hs:243)        utRandomInts 1 2 
     63 
     64<... deleted piles of stuff ...> 
     65}}} 
     66}}} 
     67 
     68Here we see the top of the stack just before the error. The stack it produces is very deep, so I have deleted a lot of stuff from below. Nonetheless it is very easy to find the bug from this trace. The important part is: 
     69{{{ 
     70   utRandomInts -> rands 1 2 -> k' -> div 2 0 -> error 
     71}}}