diff options
author | Greg Clayton <gclayton@apple.com> | 2013-01-25 18:06:21 +0000 |
---|---|---|
committer | Greg Clayton <gclayton@apple.com> | 2013-01-25 18:06:21 +0000 |
commit | c7bece56faa5eef1c3d141d0c0b0b68b28a9aed2 (patch) | |
tree | 9a0132fc3b0bb4f38d06a0f352ee75ac57994771 /lldb/source/Core/Section.cpp | |
parent | d0ed6c249dbd6bd488b6491b536a387548c00f7e (diff) | |
download | bcm5719-llvm-c7bece56faa5eef1c3d141d0c0b0b68b28a9aed2.tar.gz bcm5719-llvm-c7bece56faa5eef1c3d141d0c0b0b68b28a9aed2.zip |
<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
Diffstat (limited to 'lldb/source/Core/Section.cpp')
-rw-r--r-- | lldb/source/Core/Section.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/lldb/source/Core/Section.cpp b/lldb/source/Core/Section.cpp index 0efa39a03e2..a9481d2ccac 100644 --- a/lldb/source/Core/Section.cpp +++ b/lldb/source/Core/Section.cpp @@ -162,10 +162,10 @@ Section::GetLoadBaseAddress (Target *target) const bool Section::ResolveContainedAddress (addr_t offset, Address &so_addr) const { - const uint32_t num_children = m_children.GetSize(); + const size_t num_children = m_children.GetSize(); if (num_children > 0) { - for (uint32_t i=0; i<num_children; i++) + for (size_t i=0; i<num_children; i++) { Section* child_section = m_children.GetSectionAtIndex (i).get(); @@ -395,17 +395,17 @@ SectionList::~SectionList () { } -uint32_t +size_t SectionList::AddSection (const lldb::SectionSP& section_sp) { assert (section_sp.get()); - uint32_t section_index = m_sections.size(); + size_t section_index = m_sections.size(); m_sections.push_back(section_sp); InvalidateRangeCache(); return section_index; } -uint32_t +size_t SectionList::FindSectionIndex (const Section* sect) { iterator sect_iter; @@ -422,10 +422,10 @@ SectionList::FindSectionIndex (const Section* sect) return UINT32_MAX; } -uint32_t +size_t SectionList::AddUniqueSection (const lldb::SectionSP& sect_sp) { - uint32_t sect_idx = FindSectionIndex (sect_sp.get()); + size_t sect_idx = FindSectionIndex (sect_sp.get()); if (sect_idx == UINT32_MAX) sect_idx = AddSection (sect_sp); return sect_idx; @@ -470,7 +470,7 @@ SectionList::GetNumSections (uint32_t depth) const } SectionSP -SectionList::GetSectionAtIndex (uint32_t idx) const +SectionList::GetSectionAtIndex (size_t idx) const { SectionSP sect_sp; if (idx < m_sections.size()) @@ -530,11 +530,11 @@ SectionList::FindSectionByID (user_id_t sect_id) const SectionSP -SectionList::FindSectionByType (SectionType sect_type, bool check_children, uint32_t start_idx) const +SectionList::FindSectionByType (SectionType sect_type, bool check_children, size_t start_idx) const { SectionSP sect_sp; - uint32_t num_sections = m_sections.size(); - for (uint32_t idx = start_idx; idx < num_sections; ++idx) + size_t num_sections = m_sections.size(); + for (size_t idx = start_idx; idx < num_sections; ++idx) { if (m_sections[idx]->GetType() == sect_type) { |