diff options
author | Greg Clayton <gclayton@apple.com> | 2010-07-21 22:54:26 +0000 |
---|---|---|
committer | Greg Clayton <gclayton@apple.com> | 2010-07-21 22:54:26 +0000 |
commit | 4ceb9980c867fb3650e0dccd53fe1fe3adbec41d (patch) | |
tree | 877ab3d2d40e0acc02ba096d56e229d5d0ff1b72 /lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp | |
parent | 222f4be834ed7faa2c89ee2d985be282594b1ed1 (diff) | |
download | bcm5719-llvm-4ceb9980c867fb3650e0dccd53fe1fe3adbec41d.tar.gz bcm5719-llvm-4ceb9980c867fb3650e0dccd53fe1fe3adbec41d.zip |
Modified both the ObjectFileMachO and ObjectFileELF to correctly set the
SectionType for Section objects for DWARF.
Modified the DWARF plug-in to get the DWARF sections by SectionType so we
can safely abstract the LLDB core from section names for the various object
file formats.
Modified the SectionType definitions for .debug_pubnames and .debug_pubtypes
to use the correct case.
llvm-svn: 109054
Diffstat (limited to 'lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp')
-rw-r--r-- | lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp | 55 |
1 files changed, 45 insertions, 10 deletions
diff --git a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp index c4772202b7a..032fb75c06d 100644 --- a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp +++ b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp @@ -421,17 +421,52 @@ ObjectFileELF::GetSectionList() ConstString name(m_shstr_data.PeekCStr(header.sh_name)); uint64_t size = header.sh_type == SHT_NOBITS ? 0 : header.sh_size; + static ConstString g_sect_name_text (".text"); + static ConstString g_sect_name_data (".data"); + static ConstString g_sect_name_bss (".bss"); + static ConstString g_sect_name_dwarf_debug_abbrev (".debug_abbrev"); + static ConstString g_sect_name_dwarf_debug_aranges (".debug_aranges"); + static ConstString g_sect_name_dwarf_debug_frame (".debug_frame"); + static ConstString g_sect_name_dwarf_debug_info (".debug_info"); + static ConstString g_sect_name_dwarf_debug_line (".debug_line"); + static ConstString g_sect_name_dwarf_debug_loc (".debug_loc"); + static ConstString g_sect_name_dwarf_debug_macinfo (".debug_macinfo"); + static ConstString g_sect_name_dwarf_debug_pubnames (".debug_pubnames"); + static ConstString g_sect_name_dwarf_debug_pubtypes (".debug_pubtypes"); + 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"); + + SectionType sect_type = eSectionTypeOther; + + if (name == g_sect_name_text) sect_type = eSectionTypeCode; + else if (name == g_sect_name_data) sect_type = eSectionTypeData; + else if (name == g_sect_name_bss) sect_type = eSectionTypeZeroFill; + else if (name == g_sect_name_dwarf_debug_abbrev) sect_type = eSectionTypeDWARFDebugAbbrev; + else if (name == g_sect_name_dwarf_debug_aranges) sect_type = eSectionTypeDWARFDebugAranges; + else if (name == g_sect_name_dwarf_debug_frame) sect_type = eSectionTypeDWARFDebugFrame; + else if (name == g_sect_name_dwarf_debug_info) sect_type = eSectionTypeDWARFDebugInfo; + else if (name == g_sect_name_dwarf_debug_line) sect_type = eSectionTypeDWARFDebugLine; + else if (name == g_sect_name_dwarf_debug_loc) sect_type = eSectionTypeDWARFDebugLoc; + else if (name == g_sect_name_dwarf_debug_macinfo) sect_type = eSectionTypeDWARFDebugMacInfo; + else if (name == g_sect_name_dwarf_debug_pubnames) sect_type = eSectionTypeDWARFDebugPubNames; + else if (name == g_sect_name_dwarf_debug_pubtypes) sect_type = eSectionTypeDWARFDebugPubTypes; + else if (name == g_sect_name_dwarf_debug_ranges) sect_type = eSectionTypeDWARFDebugRanges; + else if (name == g_sect_name_dwarf_debug_str) sect_type = eSectionTypeDWARFDebugStr; + else if (name == g_sect_name_eh_frame) sect_type = eSectionTypeEHFrame; + + SectionSP section(new Section( - 0, // Parent section. - GetModule(), // Module to which this section belongs. - SectionIndex(I), // Section ID. - name, // Section name. - eSectionTypeOther, // FIXME: Fill in as appropriate. - header.sh_addr, // VM address. - header.sh_size, // VM size in bytes of this section. - header.sh_offset, // Offset of this section in the file. - size, // Size of the section as found in the file. - header.sh_flags)); // Flags for this section. + 0, // Parent section. + GetModule(), // Module to which this section belongs. + SectionIndex(I), // Section ID. + name, // Section name. + sect_type, // Section type. + header.sh_addr, // VM address. + header.sh_size, // VM size in bytes of this section. + header.sh_offset, // Offset of this section in the file. + size, // Size of the section as found in the file. + header.sh_flags)); // Flags for this section. m_sections_ap->AddSection(section); } |