[Lldb-commits] [lldb] r144261 - /lldb/trunk/source/Core/DataExtractor.cpp

Greg Clayton gclayton at apple.com
Wed Nov 9 19:38:56 PST 2011


Author: gclayton
Date: Wed Nov  9 21:38:56 2011
New Revision: 144261

URL: http://llvm.org/viewvc/llvm-project?rev=144261&view=rev
Log:
Fixed the eFormatChar, eFormatCharPrintable and eFormatCharArray to print
things out correctly again.


Modified:
    lldb/trunk/source/Core/DataExtractor.cpp

Modified: lldb/trunk/source/Core/DataExtractor.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/DataExtractor.cpp?rev=144261&r1=144260&r2=144261&view=diff
==============================================================================
--- lldb/trunk/source/Core/DataExtractor.cpp (original)
+++ lldb/trunk/source/Core/DataExtractor.cpp Wed Nov  9 21:38:56 2011
@@ -1440,18 +1440,15 @@
         case eFormatChar:
         case eFormatCharPrintable:
         case eFormatCharArray:
-            if (item_bit_size < 8)
-                s->Printf ("%llu", GetMaxU64Bitfield(&offset, item_byte_size, item_bit_size, item_bit_offset));
-            else
             {
                 // If we are only printing one character surround it with single
                 // quotes
                 if (item_count == 1 && item_format == eFormatChar)
                     s->PutChar('\'');
 
-                uint32_t ch = GetMaxU64(&offset, item_byte_size);
+                const uint64_t ch = GetMaxU64Bitfield(&offset, item_byte_size, item_bit_size, item_bit_offset);
                 if (isprint(ch))
-                    s->Printf ("%c", ch);
+                    s->Printf ("%c", (char)ch);
                 else if (item_format != eFormatCharPrintable)
                 {
                     switch (ch)
@@ -1467,9 +1464,9 @@
                     case '\0': s->Printf ("\\0"); break;
                     default:   
                         if (item_byte_size == 1)
-                            s->Printf ("\\x%2.2x", ch); 
+                            s->Printf ("\\x%2.2x", (uint8_t)ch); 
                         else
-                            s->Printf ("\\u%x", ch); 
+                            s->Printf ("%llu", ch); 
                         break;
                     }
                 }





More information about the lldb-commits mailing list