-
Notifications
You must be signed in to change notification settings - Fork 13.4k
[LLDB] static const
fields of type unsigned char
cannot be inspected
#119101
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 Author: Walnut (Walnut356)
The sample code is roughly the debuginfo layout of Rust enums, written in C++ and compiled via `cl.exe`. Worth pointing out that Rust uses `TypeSystemClangCommon` at the moment. For the enum type and non-uchar integer types, `SBTypeStaticField::GetConstantValue()` returns the static field's initializer value. For unsigned char it always returns an invalid `SBValue`
version: 19.1.1 main.cpp:
Output:
Output if
|
It isn't entirely correct to say that these values can't be viewed. Debugging your example:
Seeing a static variable in a struct's value by inspecting its type is a bit of a roundabout way of getting the value, though that should also work. It's also a bit worrisome that
If |
Hmmm are you generating DWARF or PDB? Your example (using |
Whoops sorry, this is for PDB
This is almost exclusively used for the debugger visualizer script's Funnily enough, I testing out the commands on my end and I get the exact opposite issue.
I also tried using the enum definition: pub enum Container {
First(u32),
Second{val: u64, val2: i8},
Third,
} output (via codelldb):
I am using this patch of the rust compiler. LLDB was unable to inspect non-const static fields at all, so the patch adds the Rust has this explanation of the debuginfo generation, and the code that builds the associated consts is a bit further down |
The sample code is roughly the debuginfo layout of Rust enums, written in C++ and compiled via
cl.exe
. Worth pointing out that Rust usesTypeSystemClangCommon
at the moment. For the enum type and non-uchar integer types,SBTypeStaticField::GetConstantValue()
returns the static field's initializer value. For unsigned char it always returns an invalidSBValue
version: 19.1.1
main.cpp:
Output:
Output if
DISCR_EXACT
is changed tounsigned long long
:The text was updated successfully, but these errors were encountered: