Index: lldb/source/Core/ValueObject.cpp =================================================================== --- lldb/source/Core/ValueObject.cpp +++ lldb/source/Core/ValueObject.cpp @@ -378,8 +378,11 @@ { ExecutionContext exe_ctx(GetExecutionContextRef()); Value tmp_value(m_value); + bool is_unsigned = !scalar.IsSigned(); scalar = tmp_value.ResolveValue(&exe_ctx); if (scalar.IsValid()) { + if (is_unsigned) + scalar.MakeUnsigned(); const uint32_t bitfield_bit_size = GetBitfieldBitSize(); if (bitfield_bit_size) return scalar.ExtractBitfield(bitfield_bit_size, @@ -1144,7 +1147,6 @@ if (ResolveValue(scalar)) { if (success) *success = true; - scalar.MakeUnsigned(); return scalar.ULongLong(fail_value); } // fallthrough, otherwise... Index: lldb/test/API/functionalities/data-formatter/boolreference/TestFormattersBoolRefPtr.py =================================================================== --- lldb/test/API/functionalities/data-formatter/boolreference/TestFormattersBoolRefPtr.py +++ lldb/test/API/functionalities/data-formatter/boolreference/TestFormattersBoolRefPtr.py @@ -75,3 +75,6 @@ substrs=['NO']) if not(isArm): self.expect('frame variable unset', substrs=['12']) + + self.expect('p myField', + substrs=['(BoolBitFields)', 'fieldOne = NO', 'fieldTwo = YES', 'fieldThree = NO', 'fieldFour = NO', 'fieldfive = YES']) Index: lldb/test/API/functionalities/data-formatter/boolreference/main.mm =================================================================== --- lldb/test/API/functionalities/data-formatter/boolreference/main.mm +++ lldb/test/API/functionalities/data-formatter/boolreference/main.mm @@ -1,12 +1,20 @@ #import +typedef struct { + BOOL fieldOne : 1; + BOOL fieldTwo : 1; + BOOL fieldThree : 1; + BOOL fieldFour : 1; + BOOL fieldfive : 1; +} BoolBitFields; + int main (int argc, const char * argv[]) { - NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; + NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; BOOL yes = YES; BOOL no = NO; - BOOL unset = 12; + BOOL unset = 12; BOOL &yes_ref = yes; BOOL &no_ref = no; @@ -16,6 +24,10 @@ BOOL* no_ptr = &no; BOOL* unset_ptr = &unset; + BoolBitFields myField = {0}; + myField.fieldTwo = YES; + myField.fieldfive = YES; + [pool drain];// Set break point at this line. return 0; }