summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2010-06-28 23:51:11 +0000
committerGreg Clayton <gclayton@apple.com>2010-06-28 23:51:11 +0000
commit8d38ac453673a0cbad6d2a6b5332cbf2c2847d1a (patch)
tree946670ae4bac7d57b5a7480c9c7a6e3a2eb6b4dc /lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
parent3dd716c3c31f8cd2172fa53ca5a85b94db2dea65 (diff)
downloadbcm5719-llvm-8d38ac453673a0cbad6d2a6b5332cbf2c2847d1a.tar.gz
bcm5719-llvm-8d38ac453673a0cbad6d2a6b5332cbf2c2847d1a.zip
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
Diffstat (limited to 'lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp')
-rw-r--r--lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp14
1 files changed, 14 insertions, 0 deletions
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
{
OpenPOWER on IntegriCloud