<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 - [Windows] Incorrect step-over behavior in 64-bit LLDB"
   href="https://bugs.llvm.org/show_bug.cgi?id=32343">32343</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[Windows] Incorrect step-over behavior in 64-bit LLDB
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>lldb
          </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>normal
          </td>
        </tr>

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

        <tr>
          <th>Component</th>
          <td>All Bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>lldb-dev@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>vadimcn@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=18129" name="attach_18129" title="lldb log">attachment 18129</a> <a href="attachment.cgi?id=18129&action=edit" title="lldb log">[details]</a></span>
lldb log

Repro:
- Install 64-bit LLVM for Windows from <a href="http://llvm.org/builds">http://llvm.org/builds</a> (r295586 as of
this report).
- Compile the following simple program.
- Try line-stepping through it.

Result:
See the debug session below.  I don't think this is a correct behavior.

Notes:
- 32-bit LLDB of the same release appears to work correctly (when debugging a
32-bit binary).
- Same problem observed if the program is compiled with mingw-w64 gcc (version
6.1.0 (x86_64-win32-seh, Built by MinGW-W64 project))


Debug session:
C:\temp>type hello.cpp
int main() {
    char a[1024] = {0};
    int b[1024] = {0};
}

C:\temp>clang++ -g -O0 hello.cpp -o hello --target=x86_64-pc-windows-gnu

C:\temp>lldb hello.exe
(lldb) target create "hello.exe"
Current executable set to 'hello.exe' (x86_64).
(lldb) break set -f hello.cpp -l 2
Breakpoint 1: where = hello.exe`main + 27 at hello.cpp:2, address =
0x00000000004015cb
(lldb) run
Process 4016 launching
(lldb) Process 4016 launched: 'C:\temp\hello.exe' (x86_64)
Process 4016 stopped
* thread #1, stop reason = breakpoint 1.1
    frame #0: 0x00000000004015cb hello.exe`main at hello.cpp:2
   1    int main() {
-> 2        char a[1024] = {0};
   3        int b[1024] = {0};
   4    }
(lldb) log enable -f lldb.log lldb step
(lldb) next
Process 4016 stopped
* thread #1, stop reason = step over
    frame #0: 0x00000000004015e2 hello.exe`main at hello.cpp:2
   1    int main() {
-> 2        char a[1024] = {0};
   3        int b[1024] = {0};
   4    }
(lldb) next
Process 4016 stopped
* thread #1, stop reason = step over
    frame #0: 0x0000000000402b90 hello.exe`memset
hello.exe`memset:
->  0x402b90 <+0>: jmpq   *0x57f6(%rip)             ; .idata$5
    0x402b96 <+6>: nop
    0x402b97 <+7>: nop

hello.exe`memcpy:
    0x402b98 <+0>: jmpq   *0x57e6(%rip)             ; .idata$5
(lldb) log disable all
(lldb) image dump line-table hello.cpp
Line table for C:\temp\hello.cpp in `hello.exe
0x00000000004015b0: C:\temp\hello.cpp:1
0x00000000004015c6: C:\temp\hello.cpp:1
0x00000000004015cb: C:\temp\hello.cpp:2
0x00000000004015e7: C:\temp\hello.cpp:3
0x0000000000401600: C:\temp\hello.cpp:4
0x000000000040160e: C:\temp\hello.cpp:4

(lldb)</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>