<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 - clang produces debug info with wrong path with "-xassembler""
   href="https://bugs.llvm.org/show_bug.cgi?id=41839">41839</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>clang produces debug info with wrong path with "-xassembler"
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </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>Driver
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>efriedma@quicinc.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>aprantl@apple.com, dblaikie@gmail.com, llvm-bugs@lists.llvm.org, neeilans@live.com, paul_robinson@playstation.sony.com, richard-llvm@metafoo.co.uk
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Steps to reproduce:

1. compile as assembler file to an object file, with the current directory
different from the directory containing the assembler file ("cd /; clang
-xassembler /some/path/foo.s -o /some/path/foo.o -c").
2. Run objdump -S; observe there is no interleaved assembly.
3. Repeat step 1, except use "-xassembler-with-cpp"
4. Run objdump -S; observe there is interleaved assembly.
5. Repeat step 1, except "cd" to the directory containing the assembler file
before invoking the compiler.
6. Run objdump -S; observe there is interleaved assembly.

I'm not sure I completely understand the issue; I'm not that familiar with
DWARF.  But I think what's happening is that we're not encoding the necessary
paths into the object file, and we end up trying to compute a path relative to
the compilation directory.

It looks like clang has some code in CGDebugInfo::CreateCompileUnit which
processes the "-main-file-name" differently from
MCContext::setGenDwarfRootFile; I think that's related.</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>