HomePhabricator

[lldb] Encode `bool` as unsigned int

Authored by werat on May 18 2021, 5:43 AM.

Description

[lldb] Encode bool as unsigned int

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.

Reviewed By: teemperor

Differential Revision: https://reviews.llvm.org/D102685

Details

Committed
weratMay 19 2021, 6:32 AM
Reviewer
teemperor
Differential Revision
D102685: [lldb] Encode `bool` as unsigned int
Parents
rGff954865137c: [lldb][NFC] Remove sample test boilerplate from TestBreakOnCPP11Initializers
Branches
Unknown
Tags
Unknown