diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2015-12-30 11:55:28 +0000 | 
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2015-12-30 11:55:28 +0000 | 
| commit | e81d9d49145e432d917eea3a70d2ae74dcad1d89 (patch) | |
| tree | 9ed5e1a91f242e2cb5911577356e487a55c01b78 /source/Symbol/ObjectFile.cpp | |
| parent | 85d8ef8f1f0e0e063a8571944302be2d2026f823 (diff) | |
Notes
Diffstat (limited to 'source/Symbol/ObjectFile.cpp')
| -rw-r--r-- | source/Symbol/ObjectFile.cpp | 50 | 
1 files changed, 45 insertions, 5 deletions
| diff --git a/source/Symbol/ObjectFile.cpp b/source/Symbol/ObjectFile.cpp index 22a313cf6a20..99f9236a2cd9 100644 --- a/source/Symbol/ObjectFile.cpp +++ b/source/Symbol/ObjectFile.cpp @@ -351,25 +351,31 @@ ObjectFile::GetAddressClass (addr_t file_addr)                      case eSectionTypeZeroFill:                      case eSectionTypeDataObjCMessageRefs:                      case eSectionTypeDataObjCCFStrings: +                    case eSectionTypeGoSymtab:                          return eAddressClassData;                      case eSectionTypeDebug:                      case eSectionTypeDWARFDebugAbbrev: +                    case eSectionTypeDWARFDebugAddr:                      case eSectionTypeDWARFDebugAranges:                      case eSectionTypeDWARFDebugFrame:                      case eSectionTypeDWARFDebugInfo:                      case eSectionTypeDWARFDebugLine:                      case eSectionTypeDWARFDebugLoc:                      case eSectionTypeDWARFDebugMacInfo: +                    case eSectionTypeDWARFDebugMacro:                      case eSectionTypeDWARFDebugPubNames:                      case eSectionTypeDWARFDebugPubTypes:                      case eSectionTypeDWARFDebugRanges:                      case eSectionTypeDWARFDebugStr: +                    case eSectionTypeDWARFDebugStrOffsets:                      case eSectionTypeDWARFAppleNames:                      case eSectionTypeDWARFAppleTypes:                      case eSectionTypeDWARFAppleNamespaces:                      case eSectionTypeDWARFAppleObjC:                          return eAddressClassDebug;                      case eSectionTypeEHFrame: +                    case eSectionTypeARMexidx: +                    case eSectionTypeARMextab:                      case eSectionTypeCompactUnwind:                          return eAddressClassRuntime;                      case eSectionTypeELFSymbolTable: @@ -532,6 +538,7 @@ ObjectFile::ReadSectionData (const Section *section, DataExtractor& section_data                  }              }          } +        return GetData(section->GetFileOffset(), section->GetFileSize(), section_data);      }      else      { @@ -600,16 +607,49 @@ ObjectFile::ClearSymtab ()  }  SectionList * -ObjectFile::GetSectionList() +ObjectFile::GetSectionList(bool update_module_section_list)  {      if (m_sections_ap.get() == nullptr)      { -        ModuleSP module_sp(GetModule()); -        if (module_sp) +        if (update_module_section_list) +        { +            ModuleSP module_sp(GetModule()); +            if (module_sp) +            { +                lldb_private::Mutex::Locker locker(module_sp->GetMutex()); +                CreateSections(*module_sp->GetUnifiedSectionList()); +            } +        } +        else          { -            lldb_private::Mutex::Locker locker(module_sp->GetMutex()); -            CreateSections(*module_sp->GetUnifiedSectionList()); +            SectionList unified_section_list; +            CreateSections(unified_section_list);          }      }      return m_sections_ap.get();  } + +lldb::SymbolType +ObjectFile::GetSymbolTypeFromName (llvm::StringRef name, +                                   lldb::SymbolType symbol_type_hint) +{ +    if (!name.empty()) +    { +        if (name.startswith("_OBJC_")) +        { +            // ObjC +            if (name.startswith("_OBJC_CLASS_$_")) +                return lldb::eSymbolTypeObjCClass; +            if (name.startswith("_OBJC_METACLASS_$_")) +                return lldb::eSymbolTypeObjCMetaClass; +            if (name.startswith("_OBJC_IVAR_$_")) +                return lldb::eSymbolTypeObjCIVar; +        } +        else if (name.startswith(".objc_class_name_")) +        { +            // ObjC v1 +            return lldb::eSymbolTypeObjCClass; +        } +    } +    return symbol_type_hint; +} | 
