[Lldb-commits] [PATCH] Fix the remainder of warnings for the Windows build.

Zachary Turner zturner at google.com
Thu May 29 15:46:15 PDT 2014


================
Comment at: include/lldb/Core/DataBufferMemoryMap.h:111
@@ -110,3 +110,3 @@
                            lldb::offset_t offset = 0,
-                           lldb::offset_t length = SIZE_MAX,
+                           size_t length = SIZE_MAX,
                            bool writeable = false);
----------------
Todd Fiala wrote:
> I think you may need to do something more like:
> 
> #include <limits>
> lldb::offset_t length = std::numeric_limits<lldb::offset_t>::max().
> 
> MacOSX/iOS have cases where 32-bit code debugs 64-bit code, and in cases like that using the host data types does the wrong thing.  I'd keep it lldb::offset_t and just fix the warning by what I suspect is the real issue, which is using SIZE_MAX as the initializer.
Hmm, am I misunderstanding the purpose of this function?  In the end, this results in a call to CreateFileMapping() in this process, and mmap() on linux.  So the mapping is being created inside this process, for which size_t accurately dictates how much memory can be mapped.  32-bit code can debug 64-bit code, but you still can't map more than 4GB into the 32-bit process, which is what could happen if offset_t is the argument type.

It's a little confusing though, so let me know if I've misunderstood.

http://reviews.llvm.org/D3944






More information about the lldb-commits mailing list