Skip to content
  • Simon Marlow's avatar
    Maintain cost-centre stacks in the interpreter · c8c44fd9
    Simon Marlow authored
    Summary:
    Breakpoints become SCCs, so we have detailed call-stack info for
    interpreted code.  Currently this only works when GHC is compiled with
    -prof, but D1562 (Remote GHCi) removes this constraint so that in the
    future call stacks will be available without building your own GHCi.
    
    How can you get a stack trace?
    
    * programmatically: GHC.Stack.currentCallStack
    * I've added an experimental :where command that shows the stack when
      stopped at a breakpoint
    * `error` attaches a call stack automatically, although since calls to
      `error` are often lifted out to the top level, this is less useful
      than it might be (ImplicitParams still works though).
    * Later we might attach call stacks to all exceptions
    
    Other related changes in this diff:
    
    * I reduced the number of places that get ticks attached for
      breakpoints.  In particular there was a breakpoint around the whole
      declaration, which was often redundant because it bound no variables.
      This reduces clutter...
    c8c44fd9