diff options
author | Greg Clayton <gclayton@apple.com> | 2010-10-08 00:21:05 +0000 |
---|---|---|
committer | Greg Clayton <gclayton@apple.com> | 2010-10-08 00:21:05 +0000 |
commit | 8941142af83243ece14d49c4f7adb551aa19af82 (patch) | |
tree | 3a83f7e7b868d8902a5a781d25d623b2e9f2fabd /lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp | |
parent | e2245542ce6ec6d47c53ea856dc2beef3dff9f99 (diff) | |
download | bcm5719-llvm-8941142af83243ece14d49c4f7adb551aa19af82.tar.gz bcm5719-llvm-8941142af83243ece14d49c4f7adb551aa19af82.zip |
Hooked up ability to look up data symbols so they show up in disassembly
if the address comes from a data section.
Fixed an issue that could occur when looking up a symbol that has a zero
byte size where no match would be returned even if there was an exact symbol
match.
Cleaned up the section dump output and added the section type into the output.
llvm-svn: 116017
Diffstat (limited to 'lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp')
-rw-r--r-- | lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp index ccb9105174f..666fde4f160 100644 --- a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp +++ b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp @@ -394,10 +394,11 @@ ObjectFileMachO::ParseSections () static ConstString g_sect_name_dwarf_debug_ranges ("__debug_ranges"); static ConstString g_sect_name_dwarf_debug_str ("__debug_str"); static ConstString g_sect_name_eh_frame ("__eh_frame"); + static ConstString g_sect_name_DATA ("__DATA"); + static ConstString g_sect_name_TEXT ("__TEXT"); SectionType sect_type = eSectionTypeOther; - if (section_name == g_sect_name_dwarf_debug_abbrev) sect_type = eSectionTypeDWARFDebugAbbrev; else if (section_name == g_sect_name_dwarf_debug_aranges) @@ -442,7 +443,14 @@ ObjectFileMachO::ParseSections () switch (mach_sect_type) { // TODO: categorize sections by other flags for regular sections - case SectionTypeRegular: sect_type = eSectionTypeOther; break; + case SectionTypeRegular: + if (segment_sp->GetName() == g_sect_name_TEXT) + sect_type = eSectionTypeCode; + else if (segment_sp->GetName() == g_sect_name_DATA) + sect_type = eSectionTypeData; + else + sect_type = eSectionTypeOther; + break; case SectionTypeZeroFill: sect_type = eSectionTypeZeroFill; break; case SectionTypeCStringLiterals: sect_type = eSectionTypeDataCString; break; // section with only literal C strings case SectionType4ByteLiterals: sect_type = eSectionTypeData4; break; // section with only 4 byte literals |