From 8d38ac453673a0cbad6d2a6b5332cbf2c2847d1a Mon Sep 17 00:00:00 2001 From: Greg Clayton Date: Mon, 28 Jun 2010 23:51:11 +0000 Subject: Fixed debug map in executable + DWARF in .o debugging on Mac OS X. Added the ability to dump any file in the global module cache using any of the "image dump" commands. This allows us to dump the .o files that are used with DWARF + .o since they don't belong the the target list for the current target. llvm-svn: 107100 --- lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp') diff --git a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp index 21860e1e4fb..89b0bce4be7 100644 --- a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp +++ b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp @@ -341,6 +341,20 @@ ObjectFileMachO::ParseSections () segment->GetChildren().Slide (-slide_amount, false); segment->SetByteSize (curr_seg_max_addr - sect64_min_addr); } + + // Grow the section size as needed. + if (sect64.offset) + { + const lldb::addr_t segment_min_file_offset = segment->GetFileOffset(); + const lldb::addr_t segment_max_file_offset = segment_min_file_offset + segment->GetFileSize(); + + const lldb::addr_t section_min_file_offset = sect64.offset; + const lldb::addr_t section_max_file_offset = section_min_file_offset + sect64.size; + const lldb::addr_t new_file_offset = std::min (section_min_file_offset, segment_min_file_offset); + const lldb::addr_t new_file_size = std::max (section_max_file_offset, segment_max_file_offset) - new_file_offset; + segment->SetFileOffset (new_file_offset); + segment->SetFileSize (new_file_size); + } } else { -- cgit v1.2.3