<html>
    <head>
      <base href="http://llvm.org/bugs/" />
    </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 --- - COFF line table debug info is wrong in the presence of __asm align 4"
   href="http://llvm.org/bugs/show_bug.cgi?id=18679">18679</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>COFF line table debug info is wrong in the presence of __asm align 4
          </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>normal
          </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>timurrrr@google.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>See test/DebugInfo/COFF/asm.ll:

;  1 void g(void);
;  2
;  3 void f(void) {
;  4   __asm align 4;
;  5   g();
;  6 }

Generates this code:
+0:  calll   _g
+5:  ret

There's the following problem at debug info generation time.

The debug line table format is something like:
  ...
  <number of lines>
  ...
  <pc><line>
  <pc><line>
  ...
  <pc><line>
  ...

For each instruction on a new source code line, WinCodeViewLineTables generates
a new entry in the debug info.
The problem is that "__asm align 4" doesn't generate any code in the result
binary.

So for the above example the table looks like this:
  ...
  3
  ...
  +0x0 4
  +0x0 5
  +0x5 6
  ...

If a stack trace includes 'f' calling 'g', the symbolizer looks up '+0x0' in
the debug info line table and gets line 4 as the result.  Thus, the line number
in the symbolized stack trace is wrong.

Is there a way to know whether a particular instruction generates any bytes?
It'd be very handy to just skip processing of such an __asm block while
generating the debug info.</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>