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


C++ OffsetRangeVec::cend方法代码示例

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


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

示例1: addRanges

int PCFilter::addRanges(const Unit* unit, const OffsetRangeVec& offsets) {
  int counter = 0;
  for (auto range = offsets.cbegin(); range != offsets.cend(); ++range) {
    for (PC pc = unit->at(range->m_base); pc < unit->at(range->m_past);
         pc += instrLen((Opcode*)pc)) {
      addPC(pc);
      counter++;
    }
  }
  return counter;
}
开发者ID:huangbaihua001,项目名称:hiphop-php,代码行数:11,代码来源:debugger_hook.cpp

示例2: addRanges

// Adds a range of PCs to the filter given a collection of offset ranges.
// Omit PCs which have opcodes that don't pass the given opcode filter.
void PCFilter::addRanges(const Unit* unit, const OffsetRangeVec& offsets,
                         OpcodeFilter isOpcodeAllowed) {
  for (auto range = offsets.cbegin(); range != offsets.cend(); ++range) {
    TRACE(3, "\toffsets [%d, %d)\n", range->m_base, range->m_past);
    for (PC pc = unit->at(range->m_base); pc < unit->at(range->m_past);
         pc += instrLen(pc)) {
      if (isOpcodeAllowed(*pc)) {
        TRACE(3, "\t\tpc %p\n", pc);
        addPC(pc);
      } else {
        TRACE(3, "\t\tpc %p -- skipping (offset %d)\n", pc, unit->offsetOf(pc));
      }
    }
  }
}
开发者ID:MarkTseng,项目名称:hiphop-php,代码行数:17,代码来源:debugger_hook.cpp

示例3: removeRanges

// Removes a range of PCs to the filter given a collection of offset ranges.
// Omit PCs which have opcodes that don't pass the given opcode filter.
void PCFilter::removeRanges(const Unit* unit, const OffsetRangeVec& offsets,
                            OpcodeFilter isOpcodeAllowed) {
  for (auto range = offsets.cbegin(); range != offsets.cend(); ++range) {
    TRACE(3, "\toffsets [%d, %d) (remove)\n", range->m_base, range->m_past);
    for (PC pc = unit->at(range->m_base); pc < unit->at(range->m_past);
         pc += instrLen((Op*) pc)) {
      if (isOpcodeAllowed(*reinterpret_cast<const Op*>(pc))) {
        TRACE(3, "\t\tpc %p (remove)\n", pc);
        removePC(pc);
      } else {
        TRACE(3, "\t\tpc %p -- skipping (offset %d) (remove)\n", pc,
              unit->offsetOf(pc));
      }
    }
  }
}
开发者ID:IshanRastogi,项目名称:hhvm,代码行数:18,代码来源:pc-filter.cpp


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