<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Mar 10, 2015 at 2:50 PM, Adrian Prantl <span dir="ltr"><<a href="mailto:aprantl@apple.com" target="_blank">aprantl@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span class="">Hi echristo, dblaikie,<br>
<br>
<a href="http://llvm.org/bugs/show_bug.cgi?id=22762" target="_blank">http://llvm.org/bugs/show_bug.cgi?id=22762</a><br>
The symptom was that DW_AT_frame_base should never use a DW_OP_(bit)_piece, the bug was that AddMachineRegPiece incorrectly created pieces to describe values that occupy only a subregister. Change this to emit a bit mask instead.<br>
<br>
</span>I'm posting this for review because emitting the bit mask increases the size occupied for DWARF expressions for sub-registers (~5 bytes for a 32-bit subregister). Previously we would (incorrectly!) use DW_OP_piece to describe a value occupying part of a register. However, "DW_OP_piece provides a way of describing how large a part of a variable a particular DWARF location description refers to.",</blockquote><div><br>The spec also says "If the piece is located in a register, but does not occupy the entire
register, the placement of the piece within that register is defined by the ABI. " - so we can use this in some cases at least. Should we? I assume it just means if we say _piece of size 1 in a register of size 4 we get the low byte (whatever definition of 'low' there is)?<br> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"> not the size and offset of an entire variable inside a super-register. The way that most debuggers implement DW_OP_piece this sort of works out for subregisters that are at offset 0, but it causes confusion if the expression needs to be composed (such as in DW_AT_frame_base, or if the subregister contains only a part of the variable).<br>
<br>
REPOSITORY<br>
  rL LLVM<br>
<br>
<a href="http://reviews.llvm.org/D8233" target="_blank">http://reviews.llvm.org/D8233</a><br>
<div class=""><div class="h5"><br>
Files:<br>
  lib/CodeGen/AsmPrinter/DwarfExpression.cpp<br>
  lib/CodeGen/AsmPrinter/DwarfExpression.h<br>
  test/CodeGen/ARM/debug-info-s16-reg.ll<br>
  test/CodeGen/ARM/debug-info-sreg2.ll<br>
  test/DebugInfo/ARM/s-super-register.ll<br>
  test/DebugInfo/X86/dbg-value-const-byref.ll<br>
  test/DebugInfo/X86/fission-ranges.ll<br>
  test/DebugInfo/X86/subreg.ll<br>
<br>
EMAIL PREFERENCES<br>
  <a href="http://reviews.llvm.org/settings/panel/emailpreferences/" target="_blank">http://reviews.llvm.org/settings/panel/emailpreferences/</a><br>
</div></div></blockquote></div><br></div></div>