[GHC] #11047: Provide call stacks in GHCi

GHC ghc-devs at haskell.org
Mon Dec 21 18:50:56 UTC 2015


#11047: Provide call stacks in GHCi
-------------------------------------+-------------------------------------
        Reporter:  simonmar          |                Owner:  simonmar
            Type:  task              |               Status:  new
        Priority:  high              |            Milestone:  8.0.1
       Component:  GHCi              |              Version:  7.11
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:  #545, #4837,      |  Differential Rev(s):  Phab:D1407
  #11100                             |
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by Simon Marlow <marlowsd@…>):

 In [changeset:"c8c44fd91b509b9eb644c826497ed5268e89363a/ghc" c8c44fd/ghc]:
 {{{
 #!CommitTicketReference repository="ghc"
 revision="c8c44fd91b509b9eb644c826497ed5268e89363a"
 Maintain cost-centre stacks in the interpreter

 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 in the stack traces and speeds up compilation.

 * I tidied up some RealSrcSpan stuff in InteractiveUI, and made a few
   other small cleanups

 Test Plan: validate

 Reviewers: ezyang, bgamari, austin, hvr

 Subscribers: thomie

 Differential Revision: https://phabricator.haskell.org/D1595

 GHC Trac Issues: #11047
 }}}

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11047#comment:12>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list