<rdar://problem/13069948>

Major fixed to allow reading files that are over 4GB. The main problems were that the DataExtractor was using 32 bit offsets as a data cursor, and since we mmap all of our object files we could run into cases where if we had a very large core file that was over 4GB, we were running into the 4GB boundary.

So I defined a new "lldb::offset_t" which should be used for all file offsets.

After making this change, I enabled warnings for data loss and for enexpected implicit conversions temporarily and found a ton of things that I fixed.

Any functions that take an index internally, should use "size_t" for any indexes and also should return "size_t" for any sizes of collections.

llvm-svn: 173463
diff --git a/lldb/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.cpp b/lldb/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.cpp
index 8e658a5..32b77ab 100644
--- a/lldb/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.cpp
+++ b/lldb/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.cpp
@@ -122,7 +122,7 @@
     {
         if (WaitForPacketWithTimeoutMicroSecondsNoLock (reply_packet, GetPacketTimeoutInMicroSeconds ()))
         {
-            uint32_t offset = 0;
+            lldb::offset_t offset = 0;
             const uint8_t reply_command = reply_packet.GetU8 (&offset);
             const uint8_t reply_sequence_id = reply_packet.GetU8 (&offset);
             if ((reply_command & eCommandTypeMask) == command)
@@ -273,7 +273,7 @@
     if (bytes_available >= 8)
     {
         packet.SetData (&m_bytes[0], bytes_available, m_byte_order);
-        uint32_t offset = 0;
+        lldb::offset_t offset = 0;
         uint8_t reply_command = packet.GetU8(&offset);
         switch (reply_command)
         {
@@ -406,7 +406,7 @@
     {
         // Reset the sequence ID to zero for reattach
         ClearKDPSettings ();
-        uint32_t offset = 4;
+        lldb::offset_t offset = 4;
         m_session_key = reply_packet.GetU32 (&offset);
         return true;
     }
@@ -440,7 +440,7 @@
     DataExtractor reply_packet;
     if (SendRequestAndGetReply (command, request_sequence_id, request_packet, reply_packet))
     {
-        uint32_t offset = 8;
+        lldb::offset_t offset = 8;
         m_kdp_version_version = reply_packet.GetU32 (&offset);
         m_kdp_version_feature = reply_packet.GetU32 (&offset);
         return true;
@@ -568,7 +568,7 @@
     DataExtractor reply_packet;
     if (SendRequestAndGetReply (command, request_sequence_id, request_packet, reply_packet))
     {
-        uint32_t offset = 8;
+        lldb::offset_t offset = 8;
         m_kdp_hostinfo_cpu_mask     = reply_packet.GetU32 (&offset);
         m_kdp_hostinfo_cpu_type     = reply_packet.GetU32 (&offset);
         m_kdp_hostinfo_cpu_subtype  = reply_packet.GetU32 (&offset);
@@ -648,7 +648,7 @@
     DataExtractor reply_packet;
     if (SendRequestAndGetReply (command, request_sequence_id, request_packet, reply_packet))
     {
-        uint32_t offset = 8;
+        lldb::offset_t offset = 8;
         uint32_t kdp_error = reply_packet.GetU32 (&offset);
         uint32_t src_len = reply_packet.GetByteSize() - 12;
         
@@ -696,7 +696,7 @@
     DataExtractor reply_packet;
     if (SendRequestAndGetReply (command, request_sequence_id, request_packet, reply_packet))
     {
-        uint32_t offset = 8;
+        lldb::offset_t offset = 8;
         uint32_t kdp_error = reply_packet.GetU32 (&offset);
         if (kdp_error)
             error.SetErrorStringWithFormat ("kdp write memory failed (error %u)", kdp_error);
@@ -730,7 +730,7 @@
     
     if (SendRequestAndGetReply (command, request_sequence_id, request_packet, reply_packet))
     {
-        uint32_t offset = 8;
+        lldb::offset_t offset = 8;
         uint32_t kdp_error = reply_packet.GetU32 (&offset);
         if (kdp_error)
             error.SetErrorStringWithFormat ("request packet 0x%8.8x failed (error %u)", command_byte, kdp_error);
@@ -799,7 +799,7 @@
     }
     else
     {
-        uint32_t offset = 0;
+        lldb::offset_t offset = 0;
         const uint8_t first_packet_byte = packet.GetU8 (&offset);
         const uint8_t sequence_id = packet.GetU8 (&offset);
         const uint16_t length = packet.GetU16 (&offset);
@@ -1152,7 +1152,7 @@
     DataExtractor reply_packet;
     if (SendRequestAndGetReply (command, request_sequence_id, request_packet, reply_packet))
     {
-        uint32_t offset = 8;
+        lldb::offset_t offset = 8;
         uint32_t kdp_error = reply_packet.GetU32 (&offset);
         uint32_t src_len = reply_packet.GetByteSize() - 12;
         
@@ -1200,7 +1200,7 @@
     DataExtractor reply_packet;
     if (SendRequestAndGetReply (command, request_sequence_id, request_packet, reply_packet))
     {
-        uint32_t offset = 8;
+        lldb::offset_t offset = 8;
         uint32_t kdp_error = reply_packet.GetU32 (&offset);
         if (kdp_error == 0)
             return src_len;
@@ -1247,7 +1247,7 @@
     DataExtractor reply_packet;
     if (SendRequestAndGetReply (command, request_sequence_id, request_packet, reply_packet))
     {
-        uint32_t offset = 8;
+        lldb::offset_t offset = 8;
         uint32_t kdp_error = reply_packet.GetU32 (&offset);        
         if (kdp_error == 0)
             return true;