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/Commands/CommandObjectSource.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/Commands/CommandObjectSource.cpp')
-rw-r--r-- | lldb/source/Commands/CommandObjectSource.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/lldb/source/Commands/CommandObjectSource.cpp b/lldb/source/Commands/CommandObjectSource.cpp index 576519a39a0..f2a2488e6fe 100644 --- a/lldb/source/Commands/CommandObjectSource.cpp +++ b/lldb/source/Commands/CommandObjectSource.cpp @@ -299,7 +299,7 @@ protected: bool DoExecute (Args& command, CommandReturnObject &result) { - const int argc = command.GetArgumentCount(); + const size_t argc = command.GetArgumentCount(); if (argc != 0) { @@ -320,10 +320,11 @@ protected: bool append = true; size_t num_matches = 0; - if (m_options.modules.size() > 0) + const size_t num_modules = m_options.modules.size(); + if (num_modules > 0) { ModuleList matching_modules; - for (unsigned i = 0, e = m_options.modules.size(); i != e; i++) + for (size_t i = 0; i < num_modules; ++i) { FileSpec module_file_spec(m_options.modules[i].c_str(), false); if (module_file_spec) @@ -423,7 +424,7 @@ protected: // This is a little hacky, but the first line table entry for a function points to the "{" that // starts the function block. It would be nice to actually get the function // declaration in there too. So back up a bit, but not further than what you're going to display. - size_t lines_to_back_up = m_options.num_lines >= 10 ? 5 : m_options.num_lines/2; + uint32_t lines_to_back_up = m_options.num_lines >= 10 ? 5 : m_options.num_lines/2; uint32_t line_no; if (start_line <= lines_to_back_up) line_no = 1; @@ -475,8 +476,8 @@ protected: // The target isn't loaded yet, we need to lookup the file address // in all modules const ModuleList &module_list = target->GetImages(); - const uint32_t num_modules = module_list.GetSize(); - for (uint32_t i=0; i<num_modules; ++i) + const size_t num_modules = module_list.GetSize(); + for (size_t i=0; i<num_modules; ++i) { ModuleSP module_sp (module_list.GetModuleAtIndex(i)); if (module_sp && module_sp->ResolveFileAddress(m_options.address, so_addr)) @@ -621,7 +622,7 @@ protected: if (m_options.modules.size() > 0) { ModuleList matching_modules; - for (unsigned i = 0, e = m_options.modules.size(); i != e; i++) + for (size_t i = 0, e = m_options.modules.size(); i < e; ++i) { FileSpec module_file_spec(m_options.modules[i].c_str(), false); if (module_file_spec) |