[Lldb-commits] [lldb] r203349 - Remove %zx in printf (only GCC supports it, not MSVC).

Virgile Bello virgile.bello at gmail.com
Sat Mar 8 09:15:36 PST 2014


Author: xen2
Date: Sat Mar  8 11:15:35 2014
New Revision: 203349

URL: http://llvm.org/viewvc/llvm-project?rev=203349&view=rev
Log:
Remove %zx in printf (only GCC supports it, not MSVC).

Modified:
    lldb/trunk/source/Commands/CommandObjectMemory.cpp
    lldb/trunk/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp
    lldb/trunk/source/Target/Memory.cpp

Modified: lldb/trunk/source/Commands/CommandObjectMemory.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectMemory.cpp?rev=203349&r1=203348&r2=203349&view=diff
==============================================================================
--- lldb/trunk/source/Commands/CommandObjectMemory.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectMemory.cpp Sat Mar  8 11:15:35 2014
@@ -685,7 +685,7 @@ protected:
             data_sp.reset (new DataBufferHeap (total_byte_size, '\0'));
             if (data_sp->GetBytes() == NULL)
             {
-                result.AppendErrorWithFormat ("can't allocate 0x%zx bytes for the memory read buffer, specify a smaller size to read", total_byte_size);
+                result.AppendErrorWithFormat ("can't allocate 0x%" PRIx32 " bytes for the memory read buffer, specify a smaller size to read", (uint32_t)total_byte_size);
                 result.SetStatus(eReturnStatusFailed);
                 return false;
             }

Modified: lldb/trunk/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp?rev=203349&r1=203348&r2=203349&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp (original)
+++ lldb/trunk/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp Sat Mar  8 11:15:35 2014
@@ -852,7 +852,7 @@ ObjectFilePECOFF::DumpOptCOFFHeader(Stre
     s->Printf ("  heap_reserve_size       = 0x%16.16" PRIx64 "\n", header.heap_reserve_size);
     s->Printf ("  heap_commit_size        = 0x%16.16" PRIx64 "\n", header.heap_commit_size);
     s->Printf ("  loader_flags            = 0x%8.8x\n", header.loader_flags);
-    s->Printf ("  num_data_dir_entries    = 0x%8.8zx\n", header.data_dirs.size());
+    s->Printf ("  num_data_dir_entries    = 0x%8.8x\n", (uint32_t)header.data_dirs.size());
     uint32_t i;
     for (i=0; i<header.data_dirs.size(); i++)
     {

Modified: lldb/trunk/source/Target/Memory.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Memory.cpp?rev=203349&r1=203348&r2=203349&view=diff
==============================================================================
--- lldb/trunk/source/Target/Memory.cpp (original)
+++ lldb/trunk/source/Target/Memory.cpp Sat Mar  8 11:15:35 2014
@@ -9,6 +9,7 @@
 
 #include "lldb/Target/Memory.h"
 // C Includes
+#include <inttypes.h>
 // C++ Includes
 // Other libraries and framework includes
 // Project includes
@@ -395,8 +396,8 @@ AllocatedMemoryCache::AllocatePage (uint
     Log *log (GetLogIfAllCategoriesSet (LIBLLDB_LOG_PROCESS));
     if (log)
     {
-        log->Printf ("Process::DoAllocateMemory (byte_size = 0x%8.8zx, permissions = %s) => 0x%16.16" PRIx64,
-                     page_byte_size, 
+        log->Printf ("Process::DoAllocateMemory (byte_size = 0x%8.8" PRIx32 ", permissions = %s) => 0x%16.16" PRIx64,
+                     (uint32_t)page_byte_size, 
                      GetPermissionsAsCString(permissions), 
                      (uint64_t)addr);
     }
@@ -433,7 +434,7 @@ AllocatedMemoryCache::AllocateMemory (si
     }
     Log *log (GetLogIfAllCategoriesSet (LIBLLDB_LOG_PROCESS));
     if (log)
-        log->Printf ("AllocatedMemoryCache::AllocateMemory (byte_size = 0x%8.8zx, permissions = %s) => 0x%16.16" PRIx64, byte_size, GetPermissionsAsCString(permissions), (uint64_t)addr);
+        log->Printf ("AllocatedMemoryCache::AllocateMemory (byte_size = 0x%8.8" PRIx32 ", permissions = %s) => 0x%16.16" PRIx64, (uint32_t)byte_size, GetPermissionsAsCString(permissions), (uint64_t)addr);
     return addr;
 }
 





More information about the lldb-commits mailing list