diff options
author | Enrico Granata <egranata@apple.com> | 2016-03-15 23:38:04 +0000 |
---|---|---|
committer | Enrico Granata <egranata@apple.com> | 2016-03-15 23:38:04 +0000 |
commit | ab2b0cb992481a4e25d3f6ae3dbd07fc798ce4a6 (patch) | |
tree | f8394b34a7ed277654f83d1cb20c46fe238033a6 /lldb/source/Plugins/Language/ObjC | |
parent | 35f94bb72cc084d596d27de3691b156c5a715629 (diff) | |
download | bcm5719-llvm-ab2b0cb992481a4e25d3f6ae3dbd07fc798ce4a6.tar.gz bcm5719-llvm-ab2b0cb992481a4e25d3f6ae3dbd07fc798ce4a6.zip |
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
Diffstat (limited to 'lldb/source/Plugins/Language/ObjC')
-rw-r--r-- | lldb/source/Plugins/Language/ObjC/Cocoa.cpp | 18 |
1 files changed, 12 insertions, 6 deletions
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; } |