[commit: ghc] master: Add unwind information to Cmm (711a51a)

git at git.haskell.org git at git.haskell.org
Tue Dec 16 21:02:26 UTC 2014


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

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

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

commit 711a51adcf8b32801289478443549947eedd49a2
Author: Peter Wortmann <scpmw at leeds.ac.uk>
Date:   Tue Oct 14 01:14:14 2014 +0200

    Add unwind information to Cmm
    
    Unwind information allows the debugger to discover more information
    about a program state, by allowing it to "reconstruct" other states of
    the program. In practice, this means that we explain to the debugger
    how to unravel stack frames, which comes down mostly to explaining how
    to find their Sp and Ip register values.
    
    * We declare yet another new constructor for CmmNode - and this time
      there's actually little choice, as unwind information can and will
      change mid-block. We don't actually make use of these capabilities,
      and back-end support would be tricky (generate new labels?), but it
      feels like the right way to do it.
    
    * Even though we only use it for Sp so far, we allow CmmUnwind to specify
      unwind information for any register. This is pretty cheap and could
      come in useful in future.
    
    * We allow full CmmExpr expressions for specifying unwind values. The
      advantage here is that we don't have to make up new syntax, and can e.g.
      use the WDS macro directly. On the other hand, the back-end will now
      have to simplify the expression until it can sensibly be converted
      into DWARF byte code - a process which might fail, yielding NCG panics.
      On the other hand, when you're writing Cmm by hand you really ought to
      know what you're doing.
    
    (From Phabricator D169)


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

711a51adcf8b32801289478443549947eedd49a2
 compiler/cmm/CmmCommonBlockElim.hs      |  1 +
 compiler/cmm/CmmLayoutStack.hs          |  7 +++++++
 compiler/cmm/CmmLex.x                   |  2 ++
 compiler/cmm/CmmLint.hs                 |  1 +
 compiler/cmm/CmmNode.hs                 | 10 ++++++++++
 compiler/cmm/CmmParse.y                 |  3 +++
 compiler/cmm/PprCmm.hs                  |  4 ++++
 compiler/codeGen/StgCmmMonad.hs         |  8 +++++++-
 compiler/llvmGen/LlvmCodeGen/CodeGen.hs |  1 +
 compiler/nativeGen/PPC/CodeGen.hs       |  1 +
 compiler/nativeGen/SPARC/CodeGen.hs     |  1 +
 compiler/nativeGen/X86/CodeGen.hs       |  1 +
 rts/Exception.cmm                       |  1 +
 rts/StgMiscClosures.cmm                 |  1 +
 utils/genapply/GenApply.hs              |  1 +
 15 files changed, 42 insertions(+), 1 deletion(-)

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 711a51adcf8b32801289478443549947eedd49a2


More information about the ghc-commits mailing list