Closed by commit rL212192 (authored by @zturner).

REPOSITORY
  rL LLVM

http://reviews.llvm.org/D4358

Files:
  lldb/trunk/include/lldb/Core/Module.h
  lldb/trunk/include/lldb/Core/ValueObject.h
  lldb/trunk/include/lldb/Core/ValueObjectChild.h
  lldb/trunk/include/lldb/Expression/ClangExpressionDeclMap.h
  lldb/trunk/include/lldb/Expression/ClangExpressionVariable.h
  lldb/trunk/include/lldb/Symbol/DWARFCallFrameInfo.h
  lldb/trunk/include/lldb/Symbol/ObjectFile.h
  lldb/trunk/include/lldb/Target/PathMappingList.h
  lldb/trunk/source/Core/Module.cpp
  lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp
  lldb/trunk/source/Expression/IRForTarget.cpp
  lldb/trunk/source/Plugins/ObjectFile/JIT/ObjectFileJIT.cpp
  lldb/trunk/source/Plugins/ObjectFile/JIT/ObjectFileJIT.h
  lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp
  lldb/trunk/source/Symbol/ObjectFile.cpp
  lldb/trunk/source/Target/PathMappingList.cpp
Index: lldb/trunk/include/lldb/Target/PathMappingList.h
===================================================================
--- lldb/trunk/include/lldb/Target/PathMappingList.h
+++ lldb/trunk/include/lldb/Target/PathMappingList.h
@@ -78,7 +78,7 @@
             bool notify);
 
     bool
-    Remove (off_t index, bool notify);
+    Remove (size_t index, bool notify);
 
     bool
     Remove (const ConstString &path, bool notify);
Index: lldb/trunk/include/lldb/Core/ValueObject.h
===================================================================
--- lldb/trunk/include/lldb/Core/ValueObject.h
+++ lldb/trunk/include/lldb/Core/ValueObject.h
@@ -468,7 +468,7 @@
         return true;
     }
 
-    virtual off_t
+    virtual lldb::offset_t
     GetByteOffset()
     {
         return 0;
Index: lldb/trunk/include/lldb/Core/ValueObjectChild.h
===================================================================
--- lldb/trunk/include/lldb/Core/ValueObjectChild.h
+++ lldb/trunk/include/lldb/Core/ValueObjectChild.h
@@ -32,7 +32,7 @@
         return m_byte_size;
     }
 
-    virtual off_t
+    virtual lldb::offset_t
     GetByteOffset()
     {
         return m_byte_offset;
Index: lldb/trunk/include/lldb/Core/Module.h
===================================================================
--- lldb/trunk/include/lldb/Core/Module.h
+++ lldb/trunk/include/lldb/Core/Module.h
@@ -88,7 +88,7 @@
     Module (const FileSpec& file_spec,
             const ArchSpec& arch,
             const ConstString *object_name = NULL,
-            off_t object_offset = 0,
+            lldb::offset_t object_offset = 0,
             const TimeValue *object_mod_time_ptr = NULL);
 
     Module (const ModuleSpec &module_spec);
Index: lldb/trunk/include/lldb/Expression/ClangExpressionDeclMap.h
===================================================================
--- lldb/trunk/include/lldb/Expression/ClangExpressionDeclMap.h
+++ lldb/trunk/include/lldb/Expression/ClangExpressionDeclMap.h
@@ -167,7 +167,7 @@
                       const ConstString &name,
                       llvm::Value *value,
                       size_t size,
-                      off_t alignment);
+                      lldb::offset_t alignment);
     
     //------------------------------------------------------------------
     /// [Used by IRForTarget] Finalize the struct, laying out the position 
@@ -198,7 +198,7 @@
     bool 
     GetStructInfo (uint32_t &num_elements,
                    size_t &size,
-                   off_t &alignment);
+                   lldb::offset_t &alignment);
     
     //------------------------------------------------------------------
     /// [Used by IRForTarget] Get specific information about one field
@@ -234,7 +234,7 @@
     bool 
     GetStructElement (const clang::NamedDecl *&decl,
                       llvm::Value *&value,
-                      off_t &offset,
+                      lldb::offset_t &offset,
                       ConstString &name,
                       uint32_t index);
     
@@ -461,7 +461,7 @@
         {
         }
         
-        off_t                       m_struct_alignment;         ///< The alignment of the struct in bytes.
+        lldb::offset_t              m_struct_alignment;         ///< The alignment of the struct in bytes.
         size_t                      m_struct_size;              ///< The size of the struct in bytes.
         bool                        m_struct_laid_out;          ///< True if the struct has been laid out and the layout is valid (that is, no new fields have been added since).
         ConstString                 m_result_name;              ///< The name of the result variable ($1, for example)
Index: lldb/trunk/include/lldb/Expression/ClangExpressionVariable.h
===================================================================
--- lldb/trunk/include/lldb/Expression/ClangExpressionVariable.h
+++ lldb/trunk/include/lldb/Expression/ClangExpressionVariable.h
@@ -162,9 +162,9 @@
         {
         }
 
-        off_t   m_alignment;    ///< The required alignment of the variable, in bytes
-        size_t  m_size;         ///< The space required for the variable, in bytes
-        off_t   m_offset;       ///< The offset of the variable in the struct, in bytes
+        lldb::offset_t   m_alignment; ///< The required alignment of the variable, in bytes
+        size_t  m_size;               ///< The space required for the variable, in bytes
+        lldb::offset_t   m_offset;    ///< The offset of the variable in the struct, in bytes
     };
     
 private:
Index: lldb/trunk/include/lldb/Symbol/ObjectFile.h
===================================================================
--- lldb/trunk/include/lldb/Symbol/ObjectFile.h
+++ lldb/trunk/include/lldb/Symbol/ObjectFile.h
@@ -798,14 +798,14 @@
                 size_t byte_size);
 
     size_t
-    GetData (off_t offset, size_t length, DataExtractor &data) const;
+    GetData (lldb::offset_t offset, size_t length, DataExtractor &data) const;
     
     size_t
-    CopyData (off_t offset, size_t length, void *dst) const;
+    CopyData (lldb::offset_t offset, size_t length, void *dst) const;
     
     virtual size_t
     ReadSectionData (const Section *section, 
-                     off_t section_offset, 
+                     lldb::offset_t section_offset, 
                      void *dst, 
                      size_t dst_len) const;
     virtual size_t
Index: lldb/trunk/include/lldb/Symbol/DWARFCallFrameInfo.h
===================================================================
--- lldb/trunk/include/lldb/Symbol/DWARFCallFrameInfo.h
+++ lldb/trunk/include/lldb/Symbol/DWARFCallFrameInfo.h
@@ -100,7 +100,7 @@
 
     typedef std::shared_ptr<CIE> CIESP;
 
-    typedef std::map<off_t, CIESP> cie_map_t;
+    typedef std::map<dw_offset_t, CIESP> cie_map_t;
 
     // Start address (file address), size, offset of FDE location
     // used for finding an FDE for a given File address; the start address field is
Index: lldb/trunk/source/Expression/IRForTarget.cpp
===================================================================
--- lldb/trunk/source/Expression/IRForTarget.cpp
+++ lldb/trunk/source/Expression/IRForTarget.cpp
@@ -1519,11 +1519,11 @@
         }
         
         const uint64_t value_size = clang_type.GetByteSize();
-        off_t value_alignment = (clang_type.GetTypeBitAlign() + 7ull) / 8ull;
+        lldb::offset_t value_alignment = (clang_type.GetTypeBitAlign() + 7ull) / 8ull;
         
         if (log)
         {
-            log->Printf("Type of \"%s\" is [clang \"%s\", llvm \"%s\"] [size %" PRIu64 ", align %" PRId64 "]",
+            log->Printf("Type of \"%s\" is [clang \"%s\", llvm \"%s\"] [size %" PRIu64 ", align %" PRIu64 "]",
                         name.c_str(), 
                         clang_type.GetQualType().getAsString().c_str(),
                         PrintType(value_type).c_str(),
@@ -2258,7 +2258,7 @@
     uint32_t element_index;
     
     size_t size;
-    off_t alignment;
+    lldb::offset_t alignment;
     
     if (!m_decl_map->GetStructInfo (num_elements, size, alignment))
         return false;
@@ -2359,7 +2359,7 @@
     {
         const clang::NamedDecl *decl = NULL;
         Value *value = NULL;
-        off_t offset;
+        lldb::offset_t offset;
         lldb_private::ConstString name;
         
         if (!m_decl_map->GetStructElement (decl, value, offset, name, element_index))
@@ -2371,7 +2371,7 @@
         }
             
         if (log)
-            log->Printf("  \"%s\" (\"%s\") placed at %" PRId64,
+            log->Printf("  \"%s\" (\"%s\") placed at %" PRIu64,
                         name.GetCString(),
                         decl->getNameAsString().c_str(),
                         offset);
Index: lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp
===================================================================
--- lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp
+++ lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp
@@ -304,7 +304,7 @@
     const ConstString &name,
     llvm::Value *value,
     size_t size,
-    off_t alignment
+    lldb::offset_t alignment
 )
 {
     assert (m_struct_vars.get());
@@ -412,7 +412,7 @@
 (
     uint32_t &num_elements,
     size_t &size,
-    off_t &alignment
+    lldb::offset_t &alignment
 )
 {
     assert (m_struct_vars.get());
@@ -432,7 +432,7 @@
 (
     const NamedDecl *&decl,
     llvm::Value *&value,
-    off_t &offset,
+    lldb::offset_t &offset,
     ConstString &name,
     uint32_t index
 )
Index: lldb/trunk/source/Symbol/ObjectFile.cpp
===================================================================
--- lldb/trunk/source/Symbol/ObjectFile.cpp
+++ lldb/trunk/source/Symbol/ObjectFile.cpp
@@ -439,24 +439,24 @@
 }
 
 size_t
-ObjectFile::GetData (off_t offset, size_t length, DataExtractor &data) const
+ObjectFile::GetData (lldb::offset_t offset, size_t length, DataExtractor &data) const
 {
     // The entire file has already been mmap'ed into m_data, so just copy from there
     // as the back mmap buffer will be shared with shared pointers.
     return data.SetData (m_data, offset, length);
 }
 
 size_t
-ObjectFile::CopyData (off_t offset, size_t length, void *dst) const
+ObjectFile::CopyData (lldb::offset_t offset, size_t length, void *dst) const
 {
     // The entire file has already been mmap'ed into m_data, so just copy from there
     // Note that the data remains in target byte order.
     return m_data.CopyData (offset, length, dst);
 }
 
 
 size_t
-ObjectFile::ReadSectionData (const Section *section, off_t section_offset, void *dst, size_t dst_len) const
+ObjectFile::ReadSectionData (const Section *section, lldb::offset_t section_offset, void *dst, size_t dst_len) const
 {
     // If some other objectfile owns this data, pass this to them.
     if (section->GetObjectFile() != this)
@@ -475,11 +475,11 @@
     }
     else
     {
-        const uint64_t section_file_size = section->GetFileSize();
-        if (section_offset < static_cast<off_t>(section_file_size))
+        const lldb::offset_t section_file_size = section->GetFileSize();
+        if (section_offset < section_file_size)
         {
-            const uint64_t section_bytes_left = section_file_size - section_offset;
-            uint64_t section_dst_len = dst_len;
+            const size_t section_bytes_left = section_file_size - section_offset;
+            size_t section_dst_len = dst_len;
             if (section_dst_len > section_bytes_left)
                 section_dst_len = section_bytes_left;
             return CopyData (section->GetFileOffset() + section_offset, section_dst_len, dst);
Index: lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp
===================================================================
--- lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp
+++ lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp
@@ -680,32 +680,32 @@
                         // If the slice registers are not included, then using the byte_offset values into the
                         // data buffer is the best way to find individual register values.
 
-                        int size_including_slice_registers = 0;
-                        int size_not_including_slice_registers = 0;
-                        int size_by_highest_offset = 0;
+                        uint64_t size_including_slice_registers = 0;
+                        uint64_t size_not_including_slice_registers = 0;
+                        uint64_t size_by_highest_offset = 0;
 
                         for (uint32_t reg_idx=0; (reg_info = GetRegisterInfoAtIndex (reg_idx)) != NULL; ++reg_idx)
                         {
                             size_including_slice_registers += reg_info->byte_size;
                             if (reg_info->value_regs == NULL)
                                 size_not_including_slice_registers += reg_info->byte_size;
-                            if (static_cast<off_t>(reg_info->byte_offset) >= size_by_highest_offset)
+                            if (reg_info->byte_offset >= size_by_highest_offset)
                                 size_by_highest_offset = reg_info->byte_offset + reg_info->byte_size;
                         }
 
                         bool use_byte_offset_into_buffer;
-                        if (static_cast<size_t>(size_by_highest_offset) == restore_data.GetByteSize())
+                        if (size_by_highest_offset == restore_data.GetByteSize())
                         {
                             // The size of the packet agrees with the highest offset: + size in the register file
                             use_byte_offset_into_buffer = true;
                         }
-                        else if (static_cast<size_t>(size_not_including_slice_registers) == restore_data.GetByteSize())
+                        else if (size_not_including_slice_registers == restore_data.GetByteSize())
                         {
                             // The size of the packet is the same as concatenating all of the registers sequentially,
                             // skipping the slice registers
                             use_byte_offset_into_buffer = true;
                         }
-                        else if (static_cast<size_t>(size_including_slice_registers) == restore_data.GetByteSize())
+                        else if (size_including_slice_registers == restore_data.GetByteSize())
                         {
                             // The slice registers are present in the packet (when they shouldn't be).
                             // Don't try to use the RegisterInfo byte_offset into the restore_data, it will
Index: lldb/trunk/source/Plugins/ObjectFile/JIT/ObjectFileJIT.cpp
===================================================================
--- lldb/trunk/source/Plugins/ObjectFile/JIT/ObjectFileJIT.cpp
+++ lldb/trunk/source/Plugins/ObjectFile/JIT/ObjectFileJIT.cpp
@@ -322,14 +322,14 @@
     
 size_t
 ObjectFileJIT::ReadSectionData (const lldb_private::Section *section,
-                                off_t section_offset,
+                                lldb::offset_t section_offset,
                                 void *dst,
                                 size_t dst_len) const
 {
     lldb::offset_t file_size = section->GetFileSize();
-    if (section_offset < static_cast<off_t>(file_size))
+    if (section_offset < file_size)
     {
-        uint64_t src_len = file_size - section_offset;
+        size_t src_len = file_size - section_offset;
         if (src_len > dst_len)
             src_len = dst_len;
         const uint8_t *src = ((uint8_t *)(uintptr_t)section->GetFileOffset()) + section_offset;
@@ -339,6 +339,7 @@
     }
     return 0;
 }
+
 size_t
 ObjectFileJIT::ReadSectionData (const lldb_private::Section *section,
                                 lldb_private::DataExtractor& section_data) const
Index: lldb/trunk/source/Plugins/ObjectFile/JIT/ObjectFileJIT.h
===================================================================
--- lldb/trunk/source/Plugins/ObjectFile/JIT/ObjectFileJIT.h
+++ lldb/trunk/source/Plugins/ObjectFile/JIT/ObjectFileJIT.h
@@ -108,7 +108,7 @@
     
     virtual size_t
     ReadSectionData (const lldb_private::Section *section,
-                     off_t section_offset,
+                     lldb::offset_t section_offset,
                      void *dst,
                      size_t dst_len) const;
     virtual size_t
Index: lldb/trunk/source/Target/PathMappingList.cpp
===================================================================
--- lldb/trunk/source/Target/PathMappingList.cpp
+++ lldb/trunk/source/Target/PathMappingList.cpp
@@ -132,9 +132,9 @@
 }
 
 bool
-PathMappingList::Remove (off_t index, bool notify)
+PathMappingList::Remove (size_t index, bool notify)
 {
-    if (static_cast<size_t>(index) >= m_pairs.size())
+    if (index >= m_pairs.size())
         return false;
 
     ++m_mod_id;
Index: lldb/trunk/source/Core/Module.cpp
===================================================================
--- lldb/trunk/source/Core/Module.cpp
+++ lldb/trunk/source/Core/Module.cpp
@@ -235,7 +235,7 @@
 Module::Module(const FileSpec& file_spec, 
                const ArchSpec& arch, 
                const ConstString *object_name, 
-               off_t object_offset,
+               lldb::offset_t object_offset,
                const TimeValue *object_mod_time_ptr) :
     m_mutex (Mutex::eMutexTypeRecursive),
     m_mod_time (file_spec.GetModificationTime()),
_______________________________________________
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits

Reply via email to