<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - LLVM emits invalid entry values covering composite location descriptions"
   href="https://bugs.llvm.org/show_bug.cgi?id=45009">45009</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>LLVM emits invalid entry values covering composite location descriptions
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libraries
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Windows NT
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>DebugInfo
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>david.stenberg@ericsson.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>jdevlieghere@apple.com, keith.walker@arm.com, llvm-bugs@lists.llvm.org, paul_robinson@playstation.sony.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>When working on D67492 I made DwarfExpression emit a single DW_OP_entry_value
operation covering the whole composite location description that is produced if
a register does not have a valid DWARF number, and is instead composed of
multiple sub-registers. Looking closer at the standard, I noticed that that is
not valid DWARF. A DW_OP_entry_value operation's block can only be a DWARF
expression or a register location description, so it is not valid to hold a
composite location description like that. See DWARFv5 sec. 2.5.1.7:

"The DW_OP_entry_value operation pushes the value that the described location
held upon entering the current subprogram. It has two operands: an unsigned
LEB128 length, followed by a block containing a DWARF expression or a register
location description (see Section 2.6.1.1.3 on page 39)."

Such a case can be seen in
llvm/test/DebugInfo/Sparc/entry-value-complex-reg-expr.ll.

Perhaps we instead want to emit expressions containing one DW_OP_entry_value
operation per sub-register, e.g.:

  DW_OP_entry_value(DW_OP_regx D0), DW_OP_piece 0x8,
  DW_OP_entry_value(DW_OP_regx D1), DW_OP_piece 0x8,
  DW_OP_stack_value

However, it is a bit unclear how the call site location should be for that;
should we emit one entry per sub-register, or a single composite location and
let the debugger figure out how the two expressions correlate? It is unclear to
me if it is valid DWARF to have
multiple entries per parameter. The
latter should be valid DWARF, but AFAICT no debugger can understand such call
site locations at the moment. GDB can only understand single DW_OP_reg or
DW_OP_fbreg locations.</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>