clayborg added a comment.

We can create a new SectionType enumeration in lldb-enumerations.h. Then in 
ObjectFileELF::CreateSections() we would classify the ".plt" section as 
eSectionTypeProcedureLinkageTable:

  static ConstString g_sect_name_plt (".plt");
  if (name == g_sect_name_plt)
      sect_type = eSectionTypeProcedureLinkageTable;

Then you can find sections by type no matter what the file format is. This 
isn't needed for this fix, but if sections contain common information in 
different file formats, this is handy to avoid having to know to look for 
sections by name. For instance, DWARF debug info is contained in ".debug_info" 
and ".debug_abbrev" in ELF, but in MachO the sections are "__debug_info" and 
"__debug_abbrev". So we made section types for them in the SectionType 
enumeration and then the DWARF parser just asks the lldb_private::ObjectFile 
for the sections by type (eSectionTypeDWARFDebugInfo and 
eSectionTypeDWARFDebugAbbrev).


http://reviews.llvm.org/D18973



_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to