Changes between Version 55 and Version 56 of ExplicitCallStack


Ignore:
Timestamp:
Jan 31, 2007 10:02:17 AM (7 years ago)
Author:
mnislaih
Comment:

Added point 6 about ghci debugger frames

Legend:

Unmodified
Added
Removed
Modified
  • ExplicitCallStack

    v55 v56  
    4949 
    50505. The dynamic hpc tracer will allow reverse time-travel, from an exception to the call site, by keeping a small queue of recently ticked locations. This will make it easier to find out what called the error calling function (head, !, !!, etc.), but will require a hpc-trace compiled prelude if we want to find places in the prelude that called the error. (A standard prelude would find the prelude function that was called that called the error inducing function). 
     51 
     526. The stack could thread entire ghci debugger 'frames' instead of just Strings. Such frames would have this aspect: 
     53{{{ 
     54     type Stack = [DebuggerFrame] 
     55     data DebuggerFrame = DF {   ids     :: (Ptr [Id])  
     56                              , locals :: [Locals]  
     57                              , srcloc :: SrcLoc } 
     58     data Locals = forall a. Locals a 
     59}}} 
     60The debugger can be extended to recognize bindings carrying this explicit stack and provide call stack traces in vanilla breakpoints. It would be possible then to fire the debugger in head_check by simply: 
     61 {{{ 
     62     head_check :: Stack -> [a] -> a 
     63     head_check stack [] = breakpoint (error "prelude: head") 
     64}}} 
     65or make this the default behaviour for error, and ensure that this transformation always applies to it, so there will be a stack around for breakpoint: 
     66{{{ 
     67     error0 :: String -> a    -- behaves as the current error 
     68                
     69     error msg = breakpoint (error0 msg) 
     70 
     71     head_check stack [] = error "prelude:head"  
     72}}} 
     73How realistic this is, I have no idea... but sounds good. 
    5174 
    5275== Open questions ==