[llvm-bugs] [Bug 32343] New: [Windows] Incorrect step-over behavior in 64-bit LLDB

via llvm-bugs llvm-bugs at lists.llvm.org
Sat Mar 18 22:38:33 PDT 2017


https://bugs.llvm.org/show_bug.cgi?id=32343

            Bug ID: 32343
           Summary: [Windows] Incorrect step-over behavior in 64-bit LLDB
           Product: lldb
           Version: unspecified
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: All Bugs
          Assignee: lldb-dev at lists.llvm.org
          Reporter: vadimcn at gmail.com
                CC: llvm-bugs at lists.llvm.org

Created attachment 18129
  --> https://bugs.llvm.org/attachment.cgi?id=18129&action=edit
lldb log

Repro:
- Install 64-bit LLVM for Windows from http://llvm.org/builds (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)

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20170319/3f700e7d/attachment.html>


More information about the llvm-bugs mailing list