当前位置: 首页>>代码示例>>C++>>正文


C++ SymbolRef::getSection方法代码示例

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


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

示例1: containsSymbol

bool SectionRef::containsSymbol(SymbolRef S) const {
  Expected<section_iterator> SymSec = S.getSection();
  if (!SymSec) {
    // TODO: Actually report errors helpfully.
    consumeError(SymSec.takeError());
    return false;
  }
  return *this == **SymSec;
}
开发者ID:jacobly0,项目名称:llvm-z80,代码行数:9,代码来源:ObjectFile.cpp

示例2: resolveSectionAndAddress

// Given a symbol sym this functions returns the address and section of it.
static error_code resolveSectionAndAddress(const COFFObjectFile *Obj,
                                           const SymbolRef &Sym,
                                           const coff_section *&ResolvedSection,
                                           uint64_t &ResolvedAddr) {
  if (error_code ec = Sym.getAddress(ResolvedAddr)) return ec;
  section_iterator iter(Obj->begin_sections());
  if (error_code ec = Sym.getSection(iter)) return ec;
  ResolvedSection = Obj->getCOFFSection(iter);
  return object_error::success;
}
开发者ID:32bitmicro,项目名称:llvm,代码行数:11,代码来源:COFFDump.cpp

示例3: iter

// Given a symbol sym this functions returns the address and section of it.
static std::error_code
resolveSectionAndAddress(const COFFObjectFile *Obj, const SymbolRef &Sym,
                         const coff_section *&ResolvedSection,
                         uint64_t &ResolvedAddr) {
  if (std::error_code EC = Sym.getAddress(ResolvedAddr))
    return EC;
  section_iterator iter(Obj->section_begin());
  if (std::error_code EC = Sym.getSection(iter))
    return EC;
  ResolvedSection = Obj->getCOFFSection(*iter);
  return std::error_code();
}
开发者ID:Nanosim-LIG,项目名称:llvm,代码行数:13,代码来源:COFFDump.cpp

示例4: errorToErrorCode

// Given a symbol sym this functions returns the address and section of it.
static std::error_code
resolveSectionAndAddress(const COFFObjectFile *Obj, const SymbolRef &Sym,
                         const coff_section *&ResolvedSection,
                         uint64_t &ResolvedAddr) {
  ErrorOr<uint64_t> ResolvedAddrOrErr = Sym.getAddress();
  if (std::error_code EC = ResolvedAddrOrErr.getError())
    return EC;
  ResolvedAddr = *ResolvedAddrOrErr;
  Expected<section_iterator> Iter = Sym.getSection();
  if (!Iter)
    return errorToErrorCode(Iter.takeError());
  ResolvedSection = Obj->getCOFFSection(**Iter);
  return std::error_code();
}
开发者ID:fcrick,项目名称:llvm,代码行数:15,代码来源:COFFDump.cpp

示例5: error_code

static std::error_code resolveRelocation(const Dumper::Context &Ctx,
                                         const coff_section *Section,
                                         uint64_t Offset,
                                         const coff_section *&ResolvedSection,
                                         uint64_t &ResolvedAddress) {
  SymbolRef Symbol;
  if (std::error_code EC =
          Ctx.ResolveSymbol(Section, Offset, Symbol, Ctx.UserData))
    return EC;

  ErrorOr<uint64_t> ResolvedAddressOrErr = Symbol.getAddress();
  if (std::error_code EC = ResolvedAddressOrErr.getError())
    return EC;
  ResolvedAddress = *ResolvedAddressOrErr;

  ErrorOr<section_iterator> SI = Symbol.getSection();
  ResolvedSection = Ctx.COFF.getCOFFSection(**SI);
  return std::error_code();
}
开发者ID:adiaaida,项目名称:llvm,代码行数:19,代码来源:Win64EHDumper.cpp

示例6: SecI

static std::error_code getOffset(const SymbolRef &Sym, uint64_t &Result) {
  uint64_t Address;
  if (std::error_code EC = Sym.getAddress(Address))
    return EC;

  if (Address == UnknownAddressOrSize) {
    Result = UnknownAddressOrSize;
    return object_error::success;
  }

  const ObjectFile *Obj = Sym.getObject();
  section_iterator SecI(Obj->section_begin());
  if (std::error_code EC = Sym.getSection(SecI))
    return EC;

  if (SecI == Obj->section_end()) {
    Result = UnknownAddressOrSize;
    return object_error::success;
  }

  uint64_t SectionAddress = SecI->getAddress();
  Result = Address - SectionAddress;
  return object_error::success;
}
开发者ID:Pwootage,项目名称:llvm,代码行数:24,代码来源:RuntimeDyld.cpp

示例7: containsSymbol

bool SectionRef::containsSymbol(SymbolRef S) const {
  section_iterator SymSec = getObject()->section_end();
  if (S.getSection(SymSec))
    return false;
  return *this == *SymSec;
}
开发者ID:gh2o,项目名称:llvm,代码行数:6,代码来源:ObjectFile.cpp


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