[llvm-bugs] [Bug 46040] New: Inconsistent debug info between step and stepi at -O1

via llvm-bugs llvm-bugs at lists.llvm.org
Fri May 22 07:56:30 PDT 2020


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

            Bug ID: 46040
           Summary: Inconsistent debug info between step and stepi at -O1
           Product: lldb
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: All Bugs
          Assignee: lldb-dev at lists.llvm.org
          Reporter: yangyibiao at hust.edu.cn
                CC: jdevlieghere at apple.com, llvm-bugs at lists.llvm.org

Created attachment 23522
  --> https://bugs.llvm.org/attachment.cgi?id=23522&action=edit
the binary

$ clang --version
clang version 11.0.0 (/home/yibiao/.cache/yay/llvm-git/llvm-project
871beba234a83a2a02da9dedbd59b91a1bfbd7af)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin

$ lldb --version
lldb version 11.0.0
  clang revision 871beba234a83a2a02da9dedbd59b91a1bfbd7af
  llvm revision 871beba234a83a2a02da9dedbd59b91a1bfbd7af



$ clang -O1 -g small.c

$ lldb a.out
(lldb) target create "a.out"
Current executable set to '/home/yibiao/Debugger/a.out' (x86_64).
(lldb) b main
Breakpoint 1: where = a.out`main + 1 at small.c:19:3, address =
0x00000000004011d1
(lldb) r
Process 35712 launched: '/home/yibiao/Debugger/a.out' (x86_64)
Process 35712 stopped
* thread #1, name = 'a.out', stop reason = breakpoint 1.1
    frame #0: 0x00000000004011d1 a.out`main at small.c:19:3
   16   }
   17   
   18   int main() {
-> 19     f(1);
   20   }
   21   
(lldb) step
Process 35712 stopped
* thread #1, name = 'a.out', stop reason = step in
    frame #0: 0x0000000000401170 a.out`f(n=<unavailable>) at small.c:8:18
   5      char *end;
   6      int i;
   7    
-> 8      for(i=0; i<2; i++) {
   9        va_start(ap, n);
   10       while (1) {
   11         end = va_arg(ap, char *);
(lldb) step
Process 35712 stopped
* thread #1, name = 'a.out', stop reason = step in
    frame #0: 0x0000000000401179 a.out`f(n=<unavailable>) at small.c:9:5
   6      int i;
   7    
   8      for(i=0; i<2; i++) {
-> 9        va_start(ap, n);
   10       while (1) {
   11         end = va_arg(ap, char *);
   12         if (!end) break;
(lldb) step
Process 35712 stopped
* thread #1, name = 'a.out', stop reason = step in
    frame #0: 0x00000000004011a4 a.out`f(n=<unavailable>) at small.c:11:13
   8      for(i=0; i<2; i++) {
   9        va_start(ap, n);
   10       while (1) {
-> 11         end = va_arg(ap, char *);
   12         if (!end) break;
   13       }
   14       va_end(ap);
(lldb) fr var i
(int) i = 1
(lldb) 



/************************************
As showed, when step to line 11 (first hit), the value of "i" is equal to 1. 
while step-i to line 11 (first hit), the value of "i" is 0, which is as
expected. 
************************************/



$ clang -O1 -g small.c;lldb a.out
(lldb) target create "a.out"
Current executable set to '/home/yibiao/Debugger/a.out' (x86_64).
(lldb) b main
Breakpoint 1: where = a.out`main + 1 at small.c:19:3, address =
0x00000000004011d1
(lldb) r
Process 35938 launched: '/home/yibiao/Debugger/a.out' (x86_64)
Process 35938 stopped
* thread #1, name = 'a.out', stop reason = breakpoint 1.1
    frame #0: 0x00000000004011d1 a.out`main at small.c:19:3
   16   }
   17   
   18   int main() {
-> 19     f(1);
   20   }
   21   
(lldb) si -c 19
Process 35938 stopped
* thread #1, name = 'a.out', stop reason = instruction step into
    frame #0: 0x00000000004011a4 a.out`f(n=<unavailable>) at small.c:11:13
   8      for(i=0; i<2; i++) {
   9        va_start(ap, n);
   10       while (1) {
-> 11         end = va_arg(ap, char *);
   12         if (!end) break;
   13       }
   14       va_end(ap);
(lldb) fr var i
(int) i = 0
(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/20200522/51597bd2/attachment.html>


More information about the llvm-bugs mailing list