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/SourceManager.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/SourceManager.cpp')
-rw-r--r-- | lldb/source/Core/SourceManager.cpp | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/lldb/source/Core/SourceManager.cpp b/lldb/source/Core/SourceManager.cpp index 87874c6b866..65b81650712 100644 --- a/lldb/source/Core/SourceManager.cpp +++ b/lldb/source/Core/SourceManager.cpp @@ -284,13 +284,18 @@ SourceManager::GetDefaultFileAndLine (FileSpec &file_spec, uint32_t &line) if (executable_ptr) { SymbolContextList sc_list; - uint32_t num_matches; ConstString main_name("main"); bool symbols_okay = false; // Force it to be a debug symbol. bool inlines_okay = true; bool append = false; - num_matches = executable_ptr->FindFunctions (main_name, NULL, lldb::eFunctionNameTypeBase, inlines_okay, symbols_okay, append, sc_list); - for (uint32_t idx = 0; idx < num_matches; idx++) + size_t num_matches = executable_ptr->FindFunctions (main_name, + NULL, + lldb::eFunctionNameTypeBase, + inlines_okay, + symbols_okay, + append, + sc_list); + for (size_t idx = 0; idx < num_matches; idx++) { SymbolContext sc; sc_list.GetContextAtIndex(idx, sc); @@ -584,14 +589,14 @@ SourceManager::File::CalculateLineOffsets (uint32_t line) else { // Some lines have been populated, start where we last left off - assert(!"Not implemented yet"); + assert("Not implemented yet" == NULL); } } else { // Calculate all line offsets up to "line" - assert(!"Not implemented yet"); + assert("Not implemented yet" == NULL); } return false; } @@ -602,8 +607,8 @@ SourceManager::File::GetLine (uint32_t line_no, std::string &buffer) if (!LineIsValid(line_no)) return false; - uint32_t start_offset = GetLineOffset (line_no); - uint32_t end_offset = GetLineOffset (line_no + 1); + size_t start_offset = GetLineOffset (line_no); + size_t end_offset = GetLineOffset (line_no + 1); if (end_offset == UINT32_MAX) { end_offset = m_data_sp->GetByteSize(); |