-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
gdb "cannot subscript non-array type" to index a Vec #66482
Comments
Probably related: #33014 |
Thanks! So, to be clear: is it a bug in rust compiler or in gdb? I feel like one of the reports (either this one, or the referenced one) should be closed. |
lldb is fine. |
I'm very surprised to hear this. How does it work? |
Good point. I just tested, and it turns out for me, I deleted my prev. comment since it doesn't seem to be relevant now. @JerrieLau could you please elaborate how you managed to make it work? Perhaps are you using Rust nightly and they added debug info recently? Anything else? I tested it with lldb version |
@Hi-Angel I just use it in my IDE(CLion). Here's a screenshot: |
@JerrieLau what you're doing is different. You're basically treating But as a programmer, I don't want to mess around with private internals of Rust types, which I'd need to know, and which can easily be renamed/changed from a Rust version to version. |
the intellij-rust plugin does have some gdb-integration python code though, might be interesting to look at anyways (licensed under MIT). |
Yes. you are right |
@JerrieLau @Hi-Angel LLDB supports accessing synthetic children via
See https://lldb.llvm.org/use/variable.html#synthetic-children for more information:
Unfortunately, just adding @dario23 As for IJ Rust formatters, they're already upstreamed. But "cannot subscript non-array type" problem with GDB still exists. |
Visited during wg-debugging triage. I can confirm this is still an issue. Marking |
Attempt to print content of a
Vec
at index results in error. Since it works fine for C++, I think the problem is inrustc
not providing the necessary debug information for this to work.Vec
s are a widely used type, and not being able to print their content at index hurts debugging process noticeably.Steps to reproduce (in terms of terminal commands)
Expected
A print:
Actual
It prints:
Additional information
rustc version:
rustc 1.41.0-nightly (1bd30ce2a 2019-11-15)
gdb version:
8.3.1
The text was updated successfully, but these errors were encountered: