From ab2b0cb992481a4e25d3f6ae3dbd07fc798ce4a6 Mon Sep 17 00:00:00 2001 From: Enrico Granata Date: Tue, 15 Mar 2016 23:38:04 +0000 Subject: On some platforms, the compiler is allowed to assume that BOOL == bool. On others, BOOL == signed char. This can cause differences in which bit patterns end up meaning YES or NO. In general, however, 0 == NO and 1 == YES. To keep it simple, LLDB will now show "YES" and "NO" only for 1 and 0 respectively, and format other values as the plain numeric value instead. Fixes rdar://24809994 llvm-svn: 263604 --- lldb/source/Plugins/Language/ObjC/Cocoa.cpp | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'lldb/source/Plugins/Language/ObjC') diff --git a/lldb/source/Plugins/Language/ObjC/Cocoa.cpp b/lldb/source/Plugins/Language/ObjC/Cocoa.cpp index 1922de37c19..0dd5e17b3f6 100644 --- a/lldb/source/Plugins/Language/ObjC/Cocoa.cpp +++ b/lldb/source/Plugins/Language/ObjC/Cocoa.cpp @@ -870,13 +870,19 @@ lldb_private::formatters::ObjCBOOLSummaryProvider (ValueObject& valobj, Stream& if (!real_guy_sp) return false; } - uint64_t value = real_guy_sp->GetValueAsUnsigned(0); - if (value == 0) - { - stream.Printf("NO"); - return true; + uint8_t value = (real_guy_sp->GetValueAsUnsigned(0) & 0xFF); + switch (value) + { + case 0: + stream.Printf("NO"); + break; + case 1: + stream.Printf("YES"); + break; + default: + stream.Printf("%u",value); + break; } - stream.Printf("YES"); return true; } -- cgit v1.2.3