https://bugs.llvm.org/show_bug.cgi?id=45564
Bug ID: 45564
Summary: lldb printing shadowed local variable
Product: lldb
Version: unspecified
Hardware: PC
OS: All
Status: NEW
Severity: enhancement
Priority: P
Component: All Bugs
Assignee: lldb-dev@lists.llvm.org
Reporter: v...@apple.com
CC: jdevliegh...@apple.com, llvm-b...@lists.llvm.org
When we compile the following program at -O0 and step to the third printf, lldb
prints two values for "l", which is misleading. It should just print the
unshadowed one.
```
* thread #1, queue = 'com.apple.main-thread', stop reason = step over
frame #0: 0x0000000100000f69 opt`main(argc=1, argv=0x00007ffeefbff8a8) at
opt.c:10:20
7 {
8 printf("%d\n", l);
9 int l = 7;
-> 10 printf("%d\n", l);
11 }
12
13 return 0;
(lldb) frame variable
(int) argc = 1
(char **) argv = 0x00007ffeefbff8a8
(int) l = 6
(int) l = 7
```
Program:
```
#include <stdio.h>
int main(int argc, char **argv) {
int l = 6;
printf("%d\n", l);
{
printf("%d\n", l);
int l = 7;
printf("%d\n", l);
}
return 0;
}
```
--
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