<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 - Wrong backtrace in lldb with optimized code [-Og]"
href="https://bugs.llvm.org/show_bug.cgi?id=45832">45832</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Wrong backtrace in lldb with optimized code [-Og]
</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>All
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>enhancement
</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>ditaliano@apple.com
</td>
</tr>
<tr>
<th>CC</th>
<td>jdevlieghere@apple.com, llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>$ ./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 =
0x00000000004004a1
(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: 0x00000000004004a1 trace.o`main at trace.c:5:3
2 static int b(int *c) { *c = 0; }
3 int 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: 0x00000000004004b0 trace.o`b at trace.c:6:1
3 int main() {
4 int *d = &a;
5 b(d);
-> 6 }
(lldb) bt
* thread #1, name = 'trace.o', stop reason = step in
* frame #0: 0x00000000004004b0 trace.o`b at trace.c:6:1
frame #1: 0x00000000004004a6 trace.o`main at trace.c:5:3
frame #2: 0x00007ffff7a5a2e1 libc.so.6`__libc_start_main + 241
frame #3: 0x00000000004003ca trace.o`_start + 42
(lldb) s
Process 5436 stopped
* thread #1, name = 'trace.o', stop reason = step in
frame #0: 0x00000000004004a6 trace.o`main at trace.c:6:1
3 int main() {
4 int *d = &a;
5 b(d);
-> 6 }
(lldb) bt
* thread #1, name = 'trace.o', stop reason = step in
* frame #0: 0x00000000004004a6 trace.o`main at trace.c:6:1
frame #1: 0x00007ffff7a5a2e1 libc.so.6`__libc_start_main + 241
frame #2: 0x00000000004003ca 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)</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>