<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 - Incorrect encoding of DWARF 5 loc list entry"
   href="https://bugs.llvm.org/show_bug.cgi?id=40525">40525</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Incorrect encoding of DWARF 5 loc list entry
          </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>paul_robinson@playstation.sony.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>Report from Philip Craig, <a href="mailto:philipjcraig@gmail.com">philipjcraig@gmail.com</a>, quoted here:

I've been working on DWARF v5 parsing in another project, and I was
testing on LLVM's output, and I noticed a bug in the location list
entry.

See section 2.6.2 of the v5 standard:

"A counted location description operand consists of an unsigned ULEB
integer giving the length of the location description (see Section 2.6.1 on
page 39) that immediately follows."

but LLVM encodes the length as a 16 bit int here:
<a href="https://github.com/llvm-mirror/llvm/blob/c35ddbd43e57090947d74b7670d53ee1106c50f2/lib/CodeGen/AsmPrinter/DwarfDebug.cpp#L1981">https://github.com/llvm-mirror/llvm/blob/c35ddbd43e57090947d74b7670d53ee1106c50f2/lib/CodeGen/AsmPrinter/DwarfDebug.cpp#L1981</a>

This function is correct for DWARF v4, but needs updating for entries
in .debug_loclists. llvm-dwarfdump will need fixing to parse it
correctly too. I've checked that gcc emits a ULEB and gdb parses it as
a ULEB.</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>