[commit: ghc] master: Dwarf: Ensure block length is encoded correctly (a0b1f41)

git at git.haskell.org git at git.haskell.org
Fri Sep 25 10:50:05 UTC 2015


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

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

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

commit a0b1f414a459e102f5c3d93bfbf53ebe0d81c467
Author: Ben Gamari <bgamari.foss at gmail.com>
Date:   Fri Sep 25 12:51:54 2015 +0200

    Dwarf: Ensure block length is encoded correctly
    
    This is supposed to be encoded with ULEB128 which the previous
    implementation would only guarranty with short lengths. This likely
    holds in nearly all cases, but I'd really rather not take changes.
    
    I fix this using the `.uleb128` directive. I'm not certain that this is
    portable across assemblers but it makes this quite straightforward and
    at the moment I value correctness over portability.
    
    Test Plan: Compare implementation to DWARF spec
    
    Reviewers: scpmw, austin
    
    Reviewed By: austin
    
    Subscribers: thomie
    
    Differential Revision: https://phabricator.haskell.org/D1220


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

a0b1f414a459e102f5c3d93bfbf53ebe0d81c467
 compiler/nativeGen/Dwarf/Types.hs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/compiler/nativeGen/Dwarf/Types.hs b/compiler/nativeGen/Dwarf/Types.hs
index 846f8dc..a2d07b8 100644
--- a/compiler/nativeGen/Dwarf/Types.hs
+++ b/compiler/nativeGen/Dwarf/Types.hs
@@ -383,7 +383,7 @@ pprUnwindExpr spIsCFA expr
         pprE (UwPlus u1 u2)   = pprE u1 $$ pprE u2 $$ pprByte dW_OP_plus
         pprE (UwMinus u1 u2)  = pprE u1 $$ pprE u2 $$ pprByte dW_OP_minus
         pprE (UwTimes u1 u2)  = pprE u1 $$ pprE u2 $$ pprByte dW_OP_mul
-    in ptext (sLit "\t.byte 1f-.-1") $$
+    in ptext (sLit "\t.uleb128 1f-.-1") $$ -- DW_FORM_block length
        pprE expr $$
        ptext (sLit "1:")
 



More information about the ghc-commits mailing list