[PATCH] D59687: [DebugInfo] Prologue inserter need to insert DW_OP_deref_size

Markus Lavin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 16 06:56:33 PDT 2019


markus updated this revision to Diff 195363.
markus added a comment.

The Chromium compilation segfault comes down to two issues:

1. `DW_OP_deref_size` is supposed to take a single byte argument (and not a ULEB128). If a `size` argument larger than 127 was used ULEB128 does not encode the same way as data1 so the extractor in `DwarfDebug::emitDebugLocEntry` looses track and that results in the crash.

2. When compiling the provoking file much larger than expected objects show up in `PEI::replaceFrameIndices` (I was expecting that it was just primitive parameter values passed on the stack) but instead we got

  (gdb) p MI.getDebugVariable()->isParameter()
  $20 = true
  (gdb) p MI.dump()
  DBG_VALUE $rbp, $noreg, !"this", !DIExpression(DW_OP_plus_uconst, 56, DW_OP_stack_value), debug-location !20746; ../../third_party/SPIRV-Tools/src/test/unit_spirv.h:0 @[ ../../third_party/SPIRV-Tools/src/test/text_to_binary.annotation_test.cpp:64:1 ] line no:0
  (gdb) p Size
  $23 = 2128

This patch addresses 1) but I am a bit confused about what to do with 2) so I will need to investigate that further.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D59687/new/

https://reviews.llvm.org/D59687

Files:
  include/llvm/IR/DebugInfoMetadata.h
  lib/CodeGen/AsmPrinter/DwarfDebug.cpp
  lib/CodeGen/AsmPrinter/DwarfExpression.cpp
  lib/CodeGen/AsmPrinter/DwarfExpression.h
  lib/CodeGen/AsmPrinter/DwarfUnit.cpp
  lib/CodeGen/MIRParser/MIParser.cpp
  lib/CodeGen/PrologEpilogInserter.cpp
  lib/IR/DebugInfoMetadata.cpp
  test/CodeGen/X86/prologepilog_deref_size.mir

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D59687.195363.patch
Type: text/x-patch
Size: 9799 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190416/eb5cede4/attachment.bin>


More information about the llvm-commits mailing list