• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ SectionList类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中SectionList的典型用法代码示例。如果您正苦于以下问题:C++ SectionList类的具体用法?C++ SectionList怎么用?C++ SectionList使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了SectionList类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1:

//------------------------------------------------------------------
// Static Functions
//------------------------------------------------------------------
enum ObjCRuntimeVersions
AppleObjCRuntime::GetObjCVersion (Process *process, ModuleSP &objc_module_sp)
{
    ModuleList &images = process->GetTarget().GetImages();
    size_t num_images = images.GetSize();
    for (size_t i = 0; i < num_images; i++)
    {
        ModuleSP module_sp = images.GetModuleAtIndex(i);
        if (AppleIsModuleObjCLibrary (module_sp))
        {
            objc_module_sp = module_sp;
            ObjectFile *ofile = module_sp->GetObjectFile();
            if (!ofile)
                return eObjC_VersionUnknown;
            
            SectionList *sections = ofile->GetSectionList();
            if (!sections)
                return eObjC_VersionUnknown;    
            SectionSP v1_telltale_section_sp = sections->FindSectionByName(ConstString ("__OBJC"));
            if (v1_telltale_section_sp)
            {
                return eAppleObjC_V1;
            }
            return eAppleObjC_V2;
        }
    }
            
    return eObjC_VersionUnknown;
}
开发者ID:fbsd,项目名称:old_lldb,代码行数:32,代码来源:AppleObjCRuntime.cpp


示例2: if

// ------------------------------------------------------------------------------------------------
// .MD5CAMERA parsing function
MD5CameraParser::MD5CameraParser(SectionList& mSections)
{
    DefaultLogger::get()->debug("MD5CameraParser begin");
    fFrameRate = 24.0f;

    for (SectionList::const_iterator iter =  mSections.begin(), iterEnd = mSections.end(); iter != iterEnd; ++iter) {
        if ((*iter).mName == "numFrames")   {
            frames.reserve(strtoul10((*iter).mGlobalValue.c_str()));
        }
        else if ((*iter).mName == "frameRate")  {
            fFrameRate = fast_atof ((*iter).mGlobalValue.c_str());
        }
        else if ((*iter).mName == "numCuts")    {
            cuts.reserve(strtoul10((*iter).mGlobalValue.c_str()));
        }
        else if ((*iter).mName == "cuts")   {
            for (ElementList::const_iterator eit = (*iter).mElements.begin(), eitEnd = (*iter).mElements.end(); eit != eitEnd; ++eit) {
                cuts.push_back(strtoul10((*eit).szStart)+1);
            }
        }
        else if ((*iter).mName == "camera") {
            for (ElementList::const_iterator eit = (*iter).mElements.begin(), eitEnd = (*iter).mElements.end(); eit != eitEnd; ++eit) {
                const char* sz = (*eit).szStart;

                frames.push_back(CameraAnimFrameDesc());
                CameraAnimFrameDesc& cur = frames.back();
                AI_MD5_READ_TRIPLE(cur.vPositionXYZ);
                AI_MD5_READ_TRIPLE(cur.vRotationQuat);
                AI_MD5_SKIP_SPACES();
                cur.fFOV = fast_atof(sz);
            }
        }
    }
    DefaultLogger::get()->debug("MD5CameraParser end");
}
开发者ID:robn,项目名称:pioneer-thirdparty,代码行数:37,代码来源:MD5Parser.cpp


示例3: module_sp

//----------------------------------------------------------------------
// Dump
//
// Dump the specifics of the runtime file container (such as any headers
// segments, sections, etc).
//----------------------------------------------------------------------
void ObjectFilePECOFF::Dump(Stream *s) {
  ModuleSP module_sp(GetModule());
  if (module_sp) {
    std::lock_guard<std::recursive_mutex> guard(module_sp->GetMutex());
    s->Printf("%p: ", static_cast<void *>(this));
    s->Indent();
    s->PutCString("ObjectFilePECOFF");

    ArchSpec header_arch;
    GetArchitecture(header_arch);

    *s << ", file = '" << m_file
       << "', arch = " << header_arch.GetArchitectureName() << "\n";

    SectionList *sections = GetSectionList();
    if (sections)
      sections->Dump(s, NULL, true, UINT32_MAX);

    if (m_symtab_ap.get())
      m_symtab_ap->Dump(s, NULL, eSortOrderNone);

    if (m_dos_header.e_magic)
      DumpDOSHeader(s, m_dos_header);
    if (m_coff_header.machine) {
      DumpCOFFHeader(s, m_coff_header);
      if (m_coff_header.hdrsize)
        DumpOptCOFFHeader(s, m_coff_header_opt);
    }
    s->EOL();
    DumpSectionHeaders(s);
    s->EOL();
  }
}
开发者ID:sas,项目名称:lldb,代码行数:39,代码来源:ObjectFilePECOFF.cpp


示例4: module_sp

void
ObjectFileJIT::Dump (Stream *s)
{
    ModuleSP module_sp(GetModule());
    if (module_sp)
    {
        lldb_private::Mutex::Locker locker(module_sp->GetMutex());
        s->Printf("%p: ", static_cast<void*>(this));
        s->Indent();
        s->PutCString("ObjectFileJIT");

        ArchSpec arch;
        if (GetArchitecture(arch))
            *s << ", arch = " << arch.GetArchitectureName();

        s->EOL();

        SectionList *sections = GetSectionList();
        if (sections)
            sections->Dump(s, NULL, true, UINT32_MAX);

        if (m_symtab_ap.get())
            m_symtab_ap->Dump(s, NULL, eSortOrderNone);
    }
}
开发者ID:BlueRiverInteractive,项目名称:lldb,代码行数:25,代码来源:ObjectFileJIT.cpp


示例5: ASSIMP_LOG_DEBUG

// ------------------------------------------------------------------------------------------------
// .MD5CAMERA parsing function
MD5CameraParser::MD5CameraParser(SectionList& mSections)
{
    ASSIMP_LOG_DEBUG("MD5CameraParser begin");
    fFrameRate = 24.0f;

    for (SectionList::const_iterator iter =  mSections.begin(), iterEnd = mSections.end();iter != iterEnd;++iter) {
        if ((*iter).mName == "numFrames")   {
            frames.reserve(strtoul10((*iter).mGlobalValue.c_str()));
        }
        else if ((*iter).mName == "frameRate")  {
            fFrameRate = fast_atof ((*iter).mGlobalValue.c_str());
        }
        else if ((*iter).mName == "numCuts")    {
            cuts.reserve(strtoul10((*iter).mGlobalValue.c_str()));
        }
        else if ((*iter).mName == "cuts")   {
            for (const auto & elem : (*iter).mElements){
                cuts.push_back(strtoul10(elem.szStart)+1);
            }
        }
        else if ((*iter).mName == "camera") {
            for (const auto & elem : (*iter).mElements){
                const char* sz = elem.szStart;

                frames.push_back(CameraAnimFrameDesc());
                CameraAnimFrameDesc& cur = frames.back();
                AI_MD5_READ_TRIPLE(cur.vPositionXYZ);
                AI_MD5_READ_TRIPLE(cur.vRotationQuat);
                AI_MD5_SKIP_SPACES();
                cur.fFOV = fast_atof(sz);
            }
        }
    }
    ASSIMP_LOG_DEBUG("MD5CameraParser end");
}
开发者ID:Madrich,项目名称:assimp,代码行数:37,代码来源:MD5Parser.cpp


示例6: lmfree

void LinearMechanism::create()
{
	int i;
	lmfree();
	i = 0;
	Object* o = *hoc_objgetarg(++i);
	
	if (strcmp(o->ctemplate->sym->name, "PythonObject") == 0) {
	    f_callable_ = o;
    	hoc_obj_ref(o);
	    c_ = matrix_arg(++i);
    } else {
        f_callable_ = NULL;
        c_ = matrix_arg(1);
    }
	g_ = matrix_arg(++i);
	y_ = vector_arg(++i);

	if (ifarg(i + 2) && hoc_is_object_arg(i + 2) && is_vector_arg(i + 2)) {
		y0_ = vector_arg(++i);
	}
	b_ = vector_arg(++i);
    if (ifarg(++i)) {
#if HAVE_IV
	Oc oc;
#endif

	if (hoc_is_double_arg(i)) {
		nnode_ = 1;
		nodes_ = new Node*[1];
		double x = chkarg(i, 0., 1.);
		Section* sec = chk_access();
		nodes_[0] = node_exact(sec, x);
		nrn_notify_when_double_freed(&NODEV(nodes_[0]), this);
	}else{
		Object* o = *hoc_objgetarg(i);
		check_obj_type(o, "SectionList");
		SectionList* sl = new SectionList(o);
		sl->ref();
		Vect* x = vector_arg(i+1);
		Section* sec;
		nnode_ = 0;
		nodes_ = new Node*[x->capacity()];
		for (sec = sl->begin(); sec; sec = sl->next()) {
			nodes_[nnode_] = node_exact(sec, x->elem(nnode_));
			nrn_notify_when_double_freed(&NODEV(nodes_[nnode_]), this);
			++nnode_;
		}
		if (ifarg(i+2)) {
			elayer_ = vector_arg(i+2);
		}
		sl->unref();
	}
    }
 	model_ = new LinearModelAddition(c_, g_, y_, y0_, b_,
		nnode_, nodes_, elayer_, f_callable_);
}
开发者ID:vortexlaboratory,项目名称:neuron,代码行数:57,代码来源:linmod1.cpp


示例7: updateSectionLoadAddress

static void updateSectionLoadAddress(const SectionList &section_list,
                                     Target &target,
                                     uint64_t symbolfile_addr,
                                     uint64_t symbolfile_size,
                                     uint64_t &vmaddrheuristic,
                                     uint64_t &min_addr,
                                     uint64_t &max_addr)
{
    const uint32_t num_sections = section_list.GetSize();
    for (uint32_t i = 0; i<num_sections; ++i)
    {
        SectionSP section_sp(section_list.GetSectionAtIndex(i));
        if (section_sp)
        {
            if(section_sp->IsFake()) {
                uint64_t lower = (uint64_t)-1;
                uint64_t upper = 0;
                updateSectionLoadAddress(section_sp->GetChildren(), target, symbolfile_addr, symbolfile_size, vmaddrheuristic,
                    lower, upper);
                if (lower < min_addr)
                    min_addr = lower;
                if (upper > max_addr)
                    max_addr = upper;
                const lldb::addr_t slide_amount = lower - section_sp->GetFileAddress();
                section_sp->Slide(slide_amount, false);
                section_sp->GetChildren().Slide(-slide_amount, false);
                section_sp->SetByteSize (upper - lower);
            } else {
                vmaddrheuristic += 2<<section_sp->GetLog2Align();
                uint64_t lower;
                if (section_sp->GetFileAddress() > vmaddrheuristic)
                    lower = section_sp->GetFileAddress();
                else {
                    lower = symbolfile_addr+section_sp->GetFileOffset();
                    section_sp->SetFileAddress(symbolfile_addr+section_sp->GetFileOffset());
                }
                target.SetSectionLoadAddress(section_sp, lower, true);
                uint64_t upper = lower + section_sp->GetByteSize();
                if (lower < min_addr)
                    min_addr = lower;
                if (upper > max_addr)
                    max_addr = upper;
                // This is an upper bound, but a good enough heuristic
                vmaddrheuristic += section_sp->GetByteSize();
            }
        }
    }
}
开发者ID:Jean-Daniel,项目名称:lldb,代码行数:48,代码来源:JITLoaderGDB.cpp


示例8: modules_locker

//------------------------------------------------------------------
// Static Functions
//------------------------------------------------------------------
ObjCLanguageRuntime::ObjCRuntimeVersions
AppleObjCRuntime::GetObjCVersion (Process *process, ModuleSP &objc_module_sp)
{
    if (!process)
        return ObjCRuntimeVersions::eObjC_VersionUnknown;

    Target &target = process->GetTarget();
    if (target.GetArchitecture().GetTriple().getVendor() != llvm::Triple::VendorType::Apple)
        return ObjCRuntimeVersions::eObjC_VersionUnknown;

    const ModuleList &target_modules = target.GetImages();
    Mutex::Locker modules_locker(target_modules.GetMutex());
    
    size_t num_images = target_modules.GetSize();
    for (size_t i = 0; i < num_images; i++)
    {
        ModuleSP module_sp = target_modules.GetModuleAtIndexUnlocked(i);
        // One tricky bit here is that we might get called as part of the initial module loading, but
        // before all the pre-run libraries get winnowed from the module list.  So there might actually
        // be an old and incorrect ObjC library sitting around in the list, and we don't want to look at that.
        // That's why we call IsLoadedInTarget.
        
        if (AppleIsModuleObjCLibrary (module_sp) && module_sp->IsLoadedInTarget(&target))
        {
            objc_module_sp = module_sp;
            ObjectFile *ofile = module_sp->GetObjectFile();
            if (!ofile)
                return ObjCRuntimeVersions::eObjC_VersionUnknown;
            
            SectionList *sections = module_sp->GetSectionList();
            if (!sections)
                return ObjCRuntimeVersions::eObjC_VersionUnknown;
            SectionSP v1_telltale_section_sp = sections->FindSectionByName(ConstString ("__OBJC"));
            if (v1_telltale_section_sp)
            {
                return ObjCRuntimeVersions::eAppleObjC_V1;
            }
            return ObjCRuntimeVersions::eAppleObjC_V2;
        }
    }
            
    return ObjCRuntimeVersions::eObjC_VersionUnknown;
}
开发者ID:runt18,项目名称:swift-lldb,代码行数:46,代码来源:AppleObjCRuntime.cpp


示例9: GetVectorOfSections

void CIniFileBase::GetVectorOfSections( SectionList & sections)
{
	sections.clear();

	CGuard Guard(m_CS);
	if (!m_File.IsOpen())
	{
		return; 
	}

	{
		stdstr_f DoesNotExist(_T("DoesNotExist%d%d%d"),rand(),rand(),rand());
		MoveToSectionNameData(DoesNotExist.c_str(),false);
	}

	for (FILELOC::const_iterator iter = m_SectionsPos.begin(); iter != m_SectionsPos.end(); iter++)
	{
		sections.push_back(iter->first);
	}
}
开发者ID:BenjaminSiskoo,项目名称:project64,代码行数:20,代码来源:Ini+File+Class.cpp


示例10: GetObjectFile

bool
Module::IsLoadedInTarget (Target *target)
{
    ObjectFile *obj_file = GetObjectFile();
    if (obj_file)
    {
        SectionList *sections = obj_file->GetSectionList();
        if (sections != NULL)
        {
            size_t num_sections = sections->GetSize();
            for (size_t sect_idx = 0; sect_idx < num_sections; sect_idx++)
            {
                SectionSP section_sp = sections->GetSectionAtIndex(sect_idx);
                if (section_sp->GetLoadBaseAddress(target) != LLDB_INVALID_ADDRESS)
                {
                    return true;
                }
            }
        }
    }
    return false;
}
开发者ID:markpeek,项目名称:lldb,代码行数:22,代码来源:Module.cpp


示例11: DWARFCallFrameInfo

void
UnwindTable::Initialize ()
{
    if (m_initialized)
        return;

    SectionList* sl = m_object_file.GetSectionList ();
    if (sl)
    {
        SectionSP sect = sl->FindSectionByType (eSectionTypeEHFrame, true);
        if (sect.get())
        {
            m_eh_frame = new DWARFCallFrameInfo(m_object_file, sect, eRegisterKindGCC, true);
        }
    }
    
    ArchSpec arch;
    if (m_object_file.GetArchitecture (arch))
    {
        m_assembly_profiler = UnwindAssembly::FindPlugin (arch);
        m_initialized = true;
    }
}
开发者ID:ztianjin,项目名称:lldb,代码行数:23,代码来源:UnwindTable.cpp


示例12:

void
DynamicLoaderLinuxDYLD::UpdateLoadedSections(ModuleSP module, addr_t base_addr)
{
    ObjectFile *obj_file = module->GetObjectFile();
    SectionList *sections = obj_file->GetSectionList();
    SectionLoadList &load_list = m_process->GetTarget().GetSectionLoadList();
    const size_t num_sections = sections->GetSize();

    for (unsigned i = 0; i < num_sections; ++i)
    {
        Section *section = sections->GetSectionAtIndex(i).get();
        lldb::addr_t new_load_addr = section->GetFileAddress() + base_addr;
        lldb::addr_t old_load_addr = load_list.GetSectionLoadAddress(section);

        // If the file address of the section is zero then this is not an
        // allocatable/loadable section (property of ELF sh_addr).  Skip it.
        if (new_load_addr == base_addr)
            continue;

        if (old_load_addr == LLDB_INVALID_ADDRESS ||
            old_load_addr != new_load_addr)
            load_list.SetSectionLoadAddress(section, new_load_addr);
    }
}
开发者ID:eightcien,项目名称:lldb,代码行数:24,代码来源:DynamicLoaderLinuxDYLD.cpp


示例13: guard

void UnwindTable::Initialize() {
  if (m_initialized)
    return;

  std::lock_guard<std::mutex> guard(m_mutex);

  if (m_initialized) // check again once we've acquired the lock
    return;
  m_initialized = true;

  SectionList *sl = m_object_file.GetSectionList();
  if (!sl)
    return;

  SectionSP sect = sl->FindSectionByType(eSectionTypeEHFrame, true);
  if (sect.get()) {
    m_eh_frame_up.reset(
        new DWARFCallFrameInfo(m_object_file, sect, DWARFCallFrameInfo::EH));
  }

  sect = sl->FindSectionByType(eSectionTypeDWARFDebugFrame, true);
  if (sect) {
    m_debug_frame_up.reset(
        new DWARFCallFrameInfo(m_object_file, sect, DWARFCallFrameInfo::DWARF));
  }

  sect = sl->FindSectionByType(eSectionTypeCompactUnwind, true);
  if (sect) {
    m_compact_unwind_up.reset(new CompactUnwindInfo(m_object_file, sect));
  }

  sect = sl->FindSectionByType(eSectionTypeARMexidx, true);
  if (sect) {
    SectionSP sect_extab = sl->FindSectionByType(eSectionTypeARMextab, true);
    if (sect_extab.get()) {
      m_arm_unwind_up.reset(new ArmUnwindInfo(m_object_file, sect, sect_extab));
    }
  }
}
开发者ID:2trill2spill,项目名称:freebsd,代码行数:39,代码来源:UnwindTable.cpp


示例14: BinarySearchRegularSecondPage

bool
CompactUnwindInfo::GetCompactUnwindInfoForFunction (Target &target, Address address, FunctionInfo &unwind_info)
{
    unwind_info.encoding = 0;
    unwind_info.lsda_address.Clear();
    unwind_info.personality_ptr_address.Clear();

    if (!IsValid (target.GetProcessSP()))
        return false;

    addr_t text_section_file_address = LLDB_INVALID_ADDRESS;
    SectionList *sl = m_objfile.GetSectionList ();
    if (sl)
    {
        SectionSP text_sect = sl->FindSectionByType (eSectionTypeCode, true);
        if (text_sect.get())
        {
           text_section_file_address = text_sect->GetFileAddress();
        }
    }
    if (text_section_file_address == LLDB_INVALID_ADDRESS)
        return false;

    addr_t function_offset = address.GetFileAddress() - m_objfile.GetHeaderAddress().GetFileAddress();
    
    UnwindIndex key;
    key.function_offset = function_offset;
    
    std::vector<UnwindIndex>::const_iterator it;
    it = std::lower_bound (m_indexes.begin(), m_indexes.end(), key);
    if (it == m_indexes.end())
    {
        return false;
    }

    if (it->function_offset != key.function_offset)
    {
        if (it != m_indexes.begin())
            --it;
    }

    if (it->sentinal_entry == true)
    {
        return false;
    }

    auto next_it = it + 1;
    if (next_it != m_indexes.end())
    {
        // initialize the function offset end range to be the start of the 
        // next index offset.  If we find an entry which is at the end of
        // the index table, this will establish the range end.
        unwind_info.valid_range_offset_end = next_it->function_offset;
    }

    offset_t second_page_offset = it->second_level;
    offset_t lsda_array_start = it->lsda_array_start;
    offset_t lsda_array_count = (it->lsda_array_end - it->lsda_array_start) / 8;

    offset_t offset = second_page_offset;
    uint32_t kind = m_unwindinfo_data.GetU32(&offset);  // UNWIND_SECOND_LEVEL_REGULAR or UNWIND_SECOND_LEVEL_COMPRESSED

    if (kind == UNWIND_SECOND_LEVEL_REGULAR)
    {
            // struct unwind_info_regular_second_level_page_header
            // {
            //     uint32_t    kind;    // UNWIND_SECOND_LEVEL_REGULAR
            //     uint16_t    entryPageOffset;
            //     uint16_t    entryCount;

            // typedef uint32_t compact_unwind_encoding_t;
            // struct unwind_info_regular_second_level_entry 
            // {
            //     uint32_t                    functionOffset;
            //     compact_unwind_encoding_t    encoding;

        uint16_t entry_page_offset = m_unwindinfo_data.GetU16(&offset); // entryPageOffset
        uint16_t entry_count = m_unwindinfo_data.GetU16(&offset);       // entryCount

        offset_t entry_offset = BinarySearchRegularSecondPage (second_page_offset + entry_page_offset, entry_count, function_offset, &unwind_info.valid_range_offset_start, &unwind_info.valid_range_offset_end);
        if (entry_offset == LLDB_INVALID_OFFSET)
        {
            return false;
        }
        entry_offset += 4;                                              // skip over functionOffset
        unwind_info.encoding = m_unwindinfo_data.GetU32(&entry_offset); // encoding
        if (unwind_info.encoding & UNWIND_HAS_LSDA)
        {
            SectionList *sl = m_objfile.GetSectionList ();
            if (sl)
            {
                uint32_t lsda_offset = GetLSDAForFunctionOffset (lsda_array_start, lsda_array_count, function_offset);
                addr_t objfile_header_file_address = m_objfile.GetHeaderAddress().GetFileAddress();
                unwind_info.lsda_address.ResolveAddressUsingFileSections (objfile_header_file_address + lsda_offset, sl);
            }
        }
        if (unwind_info.encoding & UNWIND_PERSONALITY_MASK)
        {
            uint32_t personality_index = EXTRACT_BITS (unwind_info.encoding, UNWIND_PERSONALITY_MASK);

//.........这里部分代码省略.........
开发者ID:envytools,项目名称:lldb,代码行数:101,代码来源:CompactUnwindInfo.cpp


示例15: SectionList

void ObjectFilePECOFF::CreateSections(SectionList &unified_section_list) {
  if (!m_sections_ap.get()) {
    m_sections_ap.reset(new SectionList());

    ModuleSP module_sp(GetModule());
    if (module_sp) {
      std::lock_guard<std::recursive_mutex> guard(module_sp->GetMutex());
      const uint32_t nsects = m_sect_headers.size();
      ModuleSP module_sp(GetModule());
      for (uint32_t idx = 0; idx < nsects; ++idx) {
        std::string sect_name;
        GetSectionName(sect_name, m_sect_headers[idx]);
        ConstString const_sect_name(sect_name.c_str());
        static ConstString g_code_sect_name(".code");
        static ConstString g_CODE_sect_name("CODE");
        static ConstString g_data_sect_name(".data");
        static ConstString g_DATA_sect_name("DATA");
        static ConstString g_bss_sect_name(".bss");
        static ConstString g_BSS_sect_name("BSS");
        static ConstString g_debug_sect_name(".debug");
        static ConstString g_reloc_sect_name(".reloc");
        static ConstString g_stab_sect_name(".stab");
        static ConstString g_stabstr_sect_name(".stabstr");
        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");
        static ConstString g_sect_name_go_symtab(".gosymtab");
        SectionType section_type = eSectionTypeOther;
        if (m_sect_headers[idx].flags & llvm::COFF::IMAGE_SCN_CNT_CODE &&
            ((const_sect_name == g_code_sect_name) ||
             (const_sect_name == g_CODE_sect_name))) {
          section_type = eSectionTypeCode;
        } else if (m_sect_headers[idx].flags &
                       llvm::COFF::IMAGE_SCN_CNT_INITIALIZED_DATA &&
                   ((const_sect_name == g_data_sect_name) ||
                    (const_sect_name == g_DATA_sect_name))) {
          section_type = eSectionTypeData;
        } else if (m_sect_headers[idx].flags &
                       llvm::COFF::IMAGE_SCN_CNT_UNINITIALIZED_DATA &&
                   ((const_sect_name == g_bss_sect_name) ||
                    (const_sect_name == g_BSS_sect_name))) {
          if (m_sect_headers[idx].size == 0)
            section_type = eSectionTypeZeroFill;
          else
            section_type = eSectionTypeData;
        } else if (const_sect_name == g_debug_sect_name) {
          section_type = eSectionTypeDebug;
        } else if (const_sect_name == g_stabstr_sect_name) {
          section_type = eSectionTypeDataCString;
        } else if (const_sect_name == g_reloc_sect_name) {
          section_type = eSectionTypeOther;
        } else if (const_sect_name == g_sect_name_dwarf_debug_abbrev)
          section_type = eSectionTypeDWARFDebugAbbrev;
        else if (const_sect_name == g_sect_name_dwarf_debug_aranges)
          section_type = eSectionTypeDWARFDebugAranges;
        else if (const_sect_name == g_sect_name_dwarf_debug_frame)
          section_type = eSectionTypeDWARFDebugFrame;
        else if (const_sect_name == g_sect_name_dwarf_debug_info)
          section_type = eSectionTypeDWARFDebugInfo;
        else if (const_sect_name == g_sect_name_dwarf_debug_line)
          section_type = eSectionTypeDWARFDebugLine;
        else if (const_sect_name == g_sect_name_dwarf_debug_loc)
          section_type = eSectionTypeDWARFDebugLoc;
        else if (const_sect_name == g_sect_name_dwarf_debug_macinfo)
          section_type = eSectionTypeDWARFDebugMacInfo;
        else if (const_sect_name == g_sect_name_dwarf_debug_pubnames)
          section_type = eSectionTypeDWARFDebugPubNames;
        else if (const_sect_name == g_sect_name_dwarf_debug_pubtypes)
          section_type = eSectionTypeDWARFDebugPubTypes;
        else if (const_sect_name == g_sect_name_dwarf_debug_ranges)
          section_type = eSectionTypeDWARFDebugRanges;
        else if (const_sect_name == g_sect_name_dwarf_debug_str)
          section_type = eSectionTypeDWARFDebugStr;
        else if (const_sect_name == g_sect_name_eh_frame)
          section_type = eSectionTypeEHFrame;
        else if (const_sect_name == g_sect_name_go_symtab)
          section_type = eSectionTypeGoSymtab;
        else if (m_sect_headers[idx].flags & llvm::COFF::IMAGE_SCN_CNT_CODE) {
          section_type = eSectionTypeCode;
        } else if (m_sect_headers[idx].flags &
                   llvm::COFF::IMAGE_SCN_CNT_INITIALIZED_DATA) {
          section_type = eSectionTypeData;
        } else if (m_sect_headers[idx].flags &
                   llvm::COFF::IMAGE_SCN_CNT_UNINITIALIZED_DATA) {
          if (m_sect_headers[idx].size == 0)
            section_type = eSectionTypeZeroFill;
          else
            section_type = eSectionTypeData;
        }

        // Use a segment ID of the segment index shifted left by 8 so they
//.........这里部分代码省略.........
开发者ID:sas,项目名称:lldb,代码行数:101,代码来源:ObjectFilePECOFF.cpp



注:本文中的SectionList类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ SectionRef类代码示例发布时间:2022-05-31
下一篇:
C++ SectionKind类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap