-
Notifications
You must be signed in to change notification settings - Fork 13.5k
LLDB: reference to std::deque<> incorrectly shows size zero #62153
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@llvm/issue-subscribers-lldb |
EDIT: $ cat dequeue.cpp
#include <deque>
int main() {
std::deque<int> q{10};
auto& ref = q;
return 0;
}
$ ./bin/lldb a.out -b -o version -o "br se -p return" -o run -o "frame var ref" -o "expr ref"
(lldb) br se -p return
Breakpoint 1: where = a.out`main + 72 at deque.cpp:6:5, address = 0x00000001000037f4
(lldb) run
Process 48032 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1
frame #0: 0x00000001000037f4 a.out`main at dequeue.cpp:6:5
3 int main() {
4 std::deque<int> q{10};
5 auto& ref = q;
-> 6 return 0;
7 }
Process 48032 launched: '/Users/michaelbuch/a.out' (arm64)
(lldb) frame var ref
(std::deque<int> &) ref = size=0 {}
(lldb) expr ref
(std::deque<int>) $0 = size=1 {
[0] = 10
} |
I am not using the command-line LLDB, so even if there is a way to coerce it to display the correct value, but it is not available to the IDE, it is still a problem. |
Sure, was curious because I wanted to narrow down which part of lldb this problem occurs in. Definitely needs attention either way |
So looks like the
Having stepped through the python implementation looks like the failure occurs in the following location:
When we have a reference type we fail to Looking at other places where we use
Adding this to the failing block in the deque summary provider fixes the issue for me. Will submit a patch shortly |
You would expect this example to fail, right? You're stopped before the variable is initialized. It looks like someone nicely 0-initialized your locals, but this doesn't have a value yet...
Jim
… On Apr 14, 2023, at 6:25 PM, Michael Buch ***@***.***> wrote:
can repro on top-of-tree
$ cat dequeue.cpp
#include <deque>
int main() {
std::deque<int> q{10};
auto& ref = q;
return 0;
}
$ ./bin/lldb a.out -b -o version -o "b main" -o run -o "expr q"
(lldb) b main
Breakpoint 1: where = a.out`main + 20 at dequeue.cpp:4:22, address = 0x00000001000037c0
(lldb) run
Process 46394 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1
frame #0: 0x00000001000037c0 a.out`main at dequeue.cpp:4:22
1 #include <deque>
2
3 int main() {
-> 4 std::deque<int> q{10};
5 auto& ref = q;
6 return 0;
7 }
Process 46394 launched: '/Users/michaelbuch/a.out' (arm64)
(lldb) expr q
(std::deque<int>) $0 = size=0 {}
—
Reply to this email directly, view it on GitHub <#62153 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ADUPVW3LBQ33EQ6VRDCYYVTXBH2IRANCNFSM6AAAAAAW7CCHGQ>.
You are receiving this because you are on a team that was mentioned.
|
Yup I realised shortly after posting that original comment. The edited comment shows the actual reproducer |
Tested on an M1 Mac running OS X 13.3 under VSCode
Reproduced on an Intel Mac under CLion
The text was updated successfully, but these errors were encountered: