[lldb-dev] [Bug 45832] New: Wrong backtrace in lldb with optimized code [-Og]

2020-05-07 Thread via lldb-dev
https://bugs.llvm.org/show_bug.cgi?id=45832

Bug ID: 45832
   Summary: Wrong backtrace in lldb with optimized code [-Og]
   Product: lldb
   Version: unspecified
  Hardware: PC
OS: All
Status: NEW
  Severity: enhancement
  Priority: P
 Component: All Bugs
  Assignee: lldb-dev@lists.llvm.org
  Reporter: ditali...@apple.com
CC: jdevliegh...@apple.com, llvm-b...@lists.llvm.org

$ ./lldb trace.o
(lldb) target create "trace.o"
Current executable set to '/home/g_a_diluna/lldb-build/bin/trace.o' (x86_64).
(lldb) b main
Breakpoint 1: where = trace.o`main + 1 at trace.c:5:3, address =
0x004004a1
(lldb) r
Process 5436 launched: '/home/Dave/lldb-build/bin/trace.o' (x86_64)
Process 5436 stopped
* thread #1, name = 'trace.o', stop reason = breakpoint 1.1
frame #0: 0x004004a1 trace.o`main at trace.c:5:3
   2static int b(int *c) { *c = 0; }
   3int main() {
   4  int *d = &a;
-> 5  b(d);
   6}
(lldb) s
Process 5436 stopped
* thread #1, name = 'trace.o', stop reason = step in
frame #0: 0x004004b0 trace.o`b at trace.c:6:1
   3int main() {
   4  int *d = &a;
   5  b(d);
-> 6}
(lldb) bt
* thread #1, name = 'trace.o', stop reason = step in
  * frame #0: 0x004004b0 trace.o`b at trace.c:6:1
frame #1: 0x004004a6 trace.o`main at trace.c:5:3
frame #2: 0x77a5a2e1 libc.so.6`__libc_start_main + 241
frame #3: 0x004003ca trace.o`_start + 42
(lldb) s
Process 5436 stopped
* thread #1, name = 'trace.o', stop reason = step in
frame #0: 0x004004a6 trace.o`main at trace.c:6:1
   3int main() {
   4  int *d = &a;
   5  b(d);
-> 6}
(lldb) bt
* thread #1, name = 'trace.o', stop reason = step in
  * frame #0: 0x004004a6 trace.o`main at trace.c:6:1
frame #1: 0x77a5a2e1 libc.so.6`__libc_start_main + 241
frame #2: 0x004003ca trace.o`_start + 42
(lldb) q

$ ./lldb -v
lldb version 11.0.0
  clang revision 237d0e3c0416abf9919406bcc92874cfd15f5e0c
  llvm revision 237d0e3c0416abf9919406bcc92874cfd15f5e0c

$ ./clang-11 -g -Og trace.c -o trace.o
trace.c:2:32: warning: non-void function does not return a value
[-Wreturn-type]
static int b(int *c) { *c = 0; }
   ^

$ cat trace.c

static int a;
static int b(int *c) { *c = 0; }
int main() {
  int *d = &a;
  b(d);
}

Only reproduces on Linux (x86_64)

-- 
You are receiving this mail because:
You are the assignee for the bug.___
lldb-dev mailing list
lldb-dev@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev


[lldb-dev] [Bug 45832] Wrong backtrace in lldb with optimized code [-Og]

2020-05-07 Thread via lldb-dev
https://bugs.llvm.org/show_bug.cgi?id=45832

Davide Italiano  changed:

   What|Removed |Added

Version|unspecified |trunk
 CC||keith.wal...@arm.com,
   ||paul_robinson@playstation.s
   ||ony.com
  Component|All Bugs|DebugInfo
   Assignee|lldb-dev@lists.llvm.org |unassignedb...@nondot.org
Product|lldb|libraries

-- 
You are receiving this mail because:
You are the assignee for the bug.___
lldb-dev mailing list
lldb-dev@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev