[commit: ghc] master: Maintain cost-centre stacks in the interpreter (c8c44fd)

git at git.haskell.org git at git.haskell.org
Mon Dec 21 18:50:59 UTC 2015


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/c8c44fd91b509b9eb644c826497ed5268e89363a/ghc

>---------------------------------------------------------------

commit c8c44fd91b509b9eb644c826497ed5268e89363a
Author: Simon Marlow <marlowsd at gmail.com>
Date:   Sat Oct 31 17:38:34 2015 +0000

    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


>---------------------------------------------------------------

c8c44fd91b509b9eb644c826497ed5268e89363a
 compiler/codeGen/StgCmmProf.hs                     |   2 +-
 compiler/deSugar/Coverage.hs                       | 121 ++++++++------
 compiler/deSugar/Desugar.hs                        |   4 +-
 compiler/ghci/ByteCodeAsm.hs                       |  21 +--
 compiler/ghci/ByteCodeGen.hs                       |  40 +++--
 compiler/ghci/ByteCodeInstr.hs                     |   7 +-
 compiler/ghci/ByteCodeTypes.hs                     |   3 +-
 compiler/ghci/GHCi.hs                              |  14 +-
 compiler/ghci/Linker.hs                            |  16 +-
 compiler/main/BreakArray.hs                        |  83 +++++-----
 compiler/main/DynFlags.hs                          |  11 ++
 compiler/main/GHC.hs                               |   3 +-
 compiler/main/HscTypes.hs                          |  16 +-
 compiler/main/InteractiveEval.hs                   |  34 ++--
 compiler/main/InteractiveEvalTypes.hs              |  13 +-
 compiler/prelude/primops.txt.pp                    |   8 +
 ghc/GhciMonad.hs                                   |   2 +-
 ghc/InteractiveUI.hs                               | 166 ++++++++++++-------
 includes/rts/prof/CCS.h                            |   1 +
 includes/stg/MiscClosures.h                        |   1 +
 libraries/base/GHC/Stack.hs                        |   1 +
 libraries/base/GHC/Stack/CCS.hsc                   |   4 +
 libraries/ghci/GHCi/Message.hs                     |  91 +++++-----
 libraries/ghci/GHCi/Run.hs                         |  26 ++-
 rts/Disassembler.c                                 |   5 +-
 rts/Interpreter.c                                  | 184 ++++++++++++++++++---
 rts/PrimOps.cmm                                    |  13 +-
 rts/Printer.c                                      |  90 +++++-----
 rts/Printer.h                                      |   1 -
 rts/Profiling.c                                    |   9 +
 rts/RtsSymbols.c                                   |   2 +
 testsuite/tests/ghci.debugger/scripts/T2740.script |   1 -
 testsuite/tests/ghci.debugger/scripts/T2740.stdout |   4 +-
 .../tests/ghci.debugger/scripts/break001.script    |   2 -
 .../tests/ghci.debugger/scripts/break001.stdout    |  12 +-
 .../tests/ghci.debugger/scripts/break003.stdout    |   2 +-
 .../tests/ghci.debugger/scripts/break005.stdout    |   7 +-
 .../tests/ghci.debugger/scripts/break006.script    |   2 -
 .../tests/ghci.debugger/scripts/break006.stderr    |   8 +-
 .../tests/ghci.debugger/scripts/break006.stdout    |   4 +-
 .../tests/ghci.debugger/scripts/break008.stdout    |   2 +-
 .../tests/ghci.debugger/scripts/break009.stdout    |   2 +-
 .../tests/ghci.debugger/scripts/break010.stdout    |   4 +-
 .../tests/ghci.debugger/scripts/break011.stdout    |  10 +-
 .../tests/ghci.debugger/scripts/break012.script    |   1 -
 .../tests/ghci.debugger/scripts/break012.stdout    |   4 +-
 .../tests/ghci.debugger/scripts/break013.script    |   1 -
 .../tests/ghci.debugger/scripts/break013.stdout    |   4 +-
 .../tests/ghci.debugger/scripts/break014.stdout    |   2 +-
 .../tests/ghci.debugger/scripts/break017.stdout    |   2 +-
 .../tests/ghci.debugger/scripts/break018.script    |   1 -
 .../tests/ghci.debugger/scripts/break018.stdout    |  13 +-
 .../tests/ghci.debugger/scripts/break020.stdout    |  12 +-
 .../tests/ghci.debugger/scripts/break021.script    |   5 -
 .../tests/ghci.debugger/scripts/break021.stdout    |  68 ++------
 .../ghci.debugger/scripts/break022/break022.script |   1 -
 .../ghci.debugger/scripts/break022/break022.stdout |  11 +-
 .../ghci.debugger/scripts/break023/break023.stdout |   4 +-
 .../tests/ghci.debugger/scripts/break024.stdout    |   8 +-
 .../tests/ghci.debugger/scripts/break025.stdout    |   2 +-
 .../tests/ghci.debugger/scripts/break026.script    |   6 -
 .../tests/ghci.debugger/scripts/break026.stdout    |  30 +---
 .../tests/ghci.debugger/scripts/break027.script    |   1 -
 .../tests/ghci.debugger/scripts/break027.stdout    |   9 +-
 .../tests/ghci.debugger/scripts/break028.stdout    |   7 +-
 .../tests/ghci.debugger/scripts/dynbrk002.stdout   |   2 +-
 .../tests/ghci.debugger/scripts/dynbrk007.stdout   |  10 +-
 .../tests/ghci.debugger/scripts/dynbrk008.script   |   1 -
 .../tests/ghci.debugger/scripts/dynbrk008.stdout   |  10 +-
 .../tests/ghci.debugger/scripts/dynbrk009.script   |   1 -
 .../tests/ghci.debugger/scripts/dynbrk009.stdout   |   9 +-
 .../tests/ghci.debugger/scripts/getargs.stdout     |   2 +-
 .../tests/ghci.debugger/scripts/hist001.stdout     |  34 ++--
 .../ghci.debugger/scripts/listCommand001.stdout    |   1 -
 .../ghci.debugger/scripts/listCommand002.stdout    |   6 +-
 .../tests/ghci.debugger/scripts/print005.stdout    |   4 +-
 .../tests/ghci.debugger/scripts/print018.script    |   1 -
 .../tests/ghci.debugger/scripts/print018.stdout    |   6 +-
 .../tests/ghci.debugger/scripts/print020.stdout    |  33 ++--
 .../tests/ghci.debugger/scripts/print022.script    |   1 -
 .../tests/ghci.debugger/scripts/print022.stdout    |   6 +-
 .../tests/ghci.debugger/scripts/print025.script    |   1 -
 .../tests/ghci.debugger/scripts/print025.stdout    |   6 +-
 .../tests/ghci.debugger/scripts/print029.script    |   1 -
 .../tests/ghci.debugger/scripts/print029.stdout    |   6 +-
 .../tests/ghci.debugger/scripts/print030.script    |   1 -
 .../tests/ghci.debugger/scripts/print030.stdout    |   6 +-
 .../tests/ghci.debugger/scripts/print031.script    |   1 -
 .../tests/ghci.debugger/scripts/print031.stdout    |   6 +-
 .../tests/ghci.debugger/scripts/print032.script    |   1 -
 .../tests/ghci.debugger/scripts/print032.stdout    |   7 +-
 .../tests/ghci.debugger/scripts/result001.stdout   |   2 +-
 92 files changed, 814 insertions(+), 595 deletions(-)

Diff suppressed because of size. To see it, use:

    git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc c8c44fd91b509b9eb644c826497ed5268e89363a


More information about the ghc-commits mailing list