[llvm-bugs] [Bug 46045] New: inconsistent behaviors at -O1

via llvm-bugs llvm-bugs at lists.llvm.org
Sat May 23 08:22:16 PDT 2020


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

            Bug ID: 46045
           Summary: inconsistent behaviors 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

$ 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 22
Breakpoint 1: where = a.out`foo + 37 at small.c:22:3, address =
0x0000000000401135
(lldb) r
Process 367418 launched: '/home/yibiao/Debugger/a.out' (x86_64)
Process 367418 exited with status = 0 (0x00000000) 
(lldb)



/*********************************************
As showed above, when setting breakpoint at Line 22, lldb wrongly exit
directly.
Line 22 is actually executed in step-i as follow:
*********************************************/


$ 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:26:3, address =
0x0000000000401151
(lldb) r
Process 367312 launched: '/home/yibiao/Debugger/a.out' (x86_64)
Process 367312 stopped
* thread #1, name = 'a.out', stop reason = breakpoint 1.1
    frame #0: 0x0000000000401151 a.out`main at small.c:26:3
   23   }
   24   
   25   int main() {
-> 26     foo();
   27     return 0;
   28   }
(lldb) si -c 9
Process 367312 stopped
* thread #1, name = 'a.out', stop reason = instruction step into
    frame #0: 0x000000000040113f a.out`foo at small.c:22:3
   19     if (pn->p==(void *)ph)
   20       ph->f = &nd;
   21   
-> 22     return 0;
   23   }
   24   
   25   int main() {
(lldb)

--- Comment #1 from Yibiao Yang (杨已彪) <yangyibiao at hust.edu.cn> ---
*** Bug 46046 has been marked as a duplicate of this bug. ***

-- 
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/20200523/743f2fd5/attachment-0001.html>


More information about the llvm-bugs mailing list