<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 - comments in assembly files confuse line numbers in debugging with lldb"
   href="https://bugs.llvm.org/show_bug.cgi?id=33664">33664</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>comments in assembly files confuse line numbers in debugging with lldb
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>new-bugs
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>4.0
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Macintosh
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>MacOS X
          </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>new bugs
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>mike.benfield@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>I don't know whether this is a problem with lldb or with the debugging
information clang produces. In the following example, I try to set a breakpoint
at line 11 but lldb points to line 16.

$ cat trash.s
.intel_syntax noprefix

.text
        .global _main
_main:
        # text
        # text
        # text
        # text
        # text
        mov     rbx, 20
        # text
        # text
        # text
        # text
        # text
        mov     rax, 5
        ret
$ clang -c -g trash.s
$ clang trash.o
$ lldb a.out
(lldb) target create "a.out"
Current executable set to 'a.out' (x86_64).
(lldb) breakpoint set -f trash.s -l 11
Breakpoint 1: where = a.out`main, address = 0x0000000100000fa9
(lldb) run
Process 24212 launched:
'/Users/mike/Dropbox/Repositories/assembly_experiments/isort/a.out' (x86_64)
Process 24212 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1
    frame #0: 0x0000000100000fa9 a.out`main at trash.s:16
   13           # text
   14           # text
   15           # text
-> 16           # text
   17           mov     rax, 5
   18           ret</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>