bool is considered to be unsigned according to std::is_unsigned<bool>::value (and Type::GetTypeInfo). Encoding it as signed int works fine for normal variables and fields, but breaks when reading the values of boolean bitfields. If the field is declared as bool b : 1 and has a value of 0b1, the call to SBValue::GetValueAsSigned() will return -1.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
Nice, and it's not even my birthday. Just some nits that don't need another round of review.
lldb/test/API/lang/cpp/bitfields/TestCppBitfields.py | ||
---|---|---|
21 | Please land that as it's own commit (from what I understand from the bug report this worked before and you just remove the skipIf here) | |
134 | You might want to assert that bb.IsValid() after this call (otherwise the GetValueAs* calls just return 0 and that's a confusing error). |
Comment Actions
Thanks for a quick review!
lldb/test/API/lang/cpp/bitfields/TestCppBitfields.py | ||
---|---|---|
21 | Okay, will submit this in a follow up commit |
Please land that as it's own commit (from what I understand from the bug report this worked before and you just remove the skipIf here)