[commit: ghc] master: Enable stack traces with ghci -fexternal-interpreter -prof (6be09e8)

git at git.haskell.org git at git.haskell.org
Fri Jan 8 08:50:45 UTC 2016


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

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

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

commit 6be09e884730f19da6c24fc565980f515300e53c
Author: Simon Marlow <marlowsd at gmail.com>
Date:   Thu Jan 7 11:36:41 2016 +0000

    Enable stack traces with ghci -fexternal-interpreter -prof
    
    Summary:
    The main goal here is enable stack traces in GHCi.  After this change,
    if you start GHCi like this:
    
      ghci -fexternal-interpreter -prof
    
    (which requires packages to be built for profiling, but not GHC
    itself) then the interpreter manages cost-centre stacks during
    execution and can produce a stack trace on request.  Call locations
    are available for all interpreted code, and any compiled code that was
    built with the `-fprof-auto` familiy of flags.
    
    There are a couple of ways to get a stack trace:
    
    * `error`/`undefined` automatically get one attached
    * `Debug.Trace.traceStack` can be used anywhere, and prints the current
      stack
    
    Because the interpreter is running in a separate process, only the
    interpreted code is running in profiled mode and the compiler itself
    isn't slowed down by profiling.
    
    The GHCi debugger still doesn't work with -fexternal-interpreter,
    although this patch gets it a step closer.  Most of the functionality
    of breakpoints is implemented, but the runtime value introspection is
    still not supported.
    
    Along the way I also did some refactoring and added type arguments to
    the various remote pointer types in `GHCi.RemotePtr`, so there's
    better type safety and documentation in the bridge code between GHC
    and ghc-iserv.
    
    Test Plan: validate
    
    Reviewers: bgamari, ezyang, austin, hvr, goldfire, erikd
    
    Subscribers: thomie
    
    Differential Revision: https://phabricator.haskell.org/D1747
    
    GHC Trac Issues: #11047, #11100


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

6be09e884730f19da6c24fc565980f515300e53c
 compiler/deSugar/Coverage.hs                       |  43 ++---
 compiler/deSugar/Desugar.hs                        |   2 +-
 compiler/ghc.cabal.in                              |   1 -
 compiler/ghc.mk                                    |   1 -
 compiler/ghci/ByteCodeAsm.hs                       |  33 ++--
 compiler/ghci/ByteCodeGen.hs                       |  64 ++++----
 compiler/ghci/ByteCodeInstr.hs                     |  10 +-
 compiler/ghci/ByteCodeItbls.hs                     |   3 +-
 compiler/ghci/ByteCodeLink.hs                      |  43 ++---
 compiler/ghci/ByteCodeTypes.hs                     |  99 +++++++++---
 compiler/ghci/Debugger.hs                          |   4 +-
 compiler/ghci/GHCi.hs                              |  74 ++++++---
 compiler/ghci/Linker.hs                            |  52 +++---
 compiler/main/DriverPipeline.hs                    |   4 +-
 compiler/main/GHC.hs                               |   3 +-
 compiler/main/HscMain.hs                           |   6 +-
 compiler/main/HscTypes.hs                          |  73 ++-------
 compiler/main/InteractiveEval.hs                   | 121 +++++++-------
 compiler/main/InteractiveEvalTypes.hs              |  41 +++--
 compiler/typecheck/TcRnTypes.hs                    |   3 +-
 compiler/typecheck/TcSplice.hs                     |   8 +-
 ghc.mk                                             |   5 +-
 ghc/GHCi/UI.hs                                     |  52 +++---
 ghc/GHCi/UI/Monad.hs                               |   2 +-
 .../main => libraries/ghci/GHCi}/BreakArray.hs     |  22 +--
 libraries/ghci/GHCi/CreateBCO.hs                   |  14 +-
 libraries/ghci/GHCi/FFI.hsc                        |   5 +-
 libraries/ghci/GHCi/InfoTable.hsc                  |   2 +-
 libraries/ghci/GHCi/Message.hs                     | 177 +++++++++++++--------
 libraries/ghci/GHCi/ObjLink.hs                     |   2 +-
 libraries/ghci/GHCi/RemoteTypes.hs                 |  87 +++++-----
 libraries/ghci/GHCi/ResolvedBCO.hs                 |  28 +---
 libraries/ghci/GHCi/Run.hs                         |  77 +++++----
 libraries/ghci/GHCi/TH.hs                          |  32 ++--
 libraries/ghci/ghci.cabal.in                       |   1 +
 rts/Exception.cmm                                  |  17 +-
 rts/Interpreter.c                                  |  43 +++--
 rules/build-prog.mk                                |   6 +-
 .../tests/ghci.debugger/scripts/break021.stdout    |   4 +-
 39 files changed, 680 insertions(+), 584 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 6be09e884730f19da6c24fc565980f515300e53c


More information about the ghc-commits mailing list