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


C++ VarList::size方法代码示例

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


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

示例1: Inst

InstFakeKill::InstFakeKill(Cfg *Func, const VarList &KilledRegs,
                           const Inst *Linked)
    : Inst(Func, Inst::FakeKill, KilledRegs.size(), NULL), Linked(Linked) {
  for (VarList::const_iterator I = KilledRegs.begin(), E = KilledRegs.end();
       I != E; ++I) {
    Variable *Var = *I;
    addSource(Var);
  }
}
开发者ID:stichnot,项目名称:subzero,代码行数:9,代码来源:IceInst.cpp

示例2: organizeNewBss

void DataRewriter::organizeNewBss(Region* reg, unsigned char magic) {
   /**
    *
    */

   fprintf(stderr, "BSS region starts at %p\n", reg->getRegionAddr());

   VarList globals = filterVariables(reg);

   unsigned int dataSize = 0;
   unsigned int dataBase = 0;
   unsigned int dataOffset = 0;

   unsigned int rawIndex = 0;
   unsigned int rawValue = 0;

   unsigned int newRawIndex = 0;

   dataSize = reg->getRegionSize();
   dataBase = newDataBase + newDataSize;

   fprintf(stderr, "BSS base = %p\n", (void*) dataBase);

   unsigned int newBssSize = sizeof(unsigned char) * dataSize;

   oldRawBss = (unsigned char*) reg->getPtrToRawData();
   newRawBss = (unsigned char*) malloc (newBssSize);

   memcpy(newRawBss, oldRawBss, dataSize);


   for (int i = 0; i < globals.size(); i++) {
      dataOffset = globals[i]->getOffset();
      rawIndex = dataOffset - dataBase;
      // Update the relocated address mapping
      newLocs[dataOffset] = dataBase + newRawIndex;
      newRawIndex += globals[i]->getSize();
   }

   for (AddrMapping::const_iterator iter = newLocs.begin();
         iter != newLocs.end();
         ++iter) {
      fprintf(stderr, "%p -> %p\n", iter->first, iter->second);
   }

   // Causes a segfault in the mutated binary
   // 
   //if (!reg->setPtrToRawData(newRawBss, newDataSize)) {
   //   fprintf(stderr, "Unable to assign new data section.\n");
   //   exit(EXIT_FAILURE);
   //}

}
开发者ID:AmesianX,项目名称:memz,代码行数:53,代码来源:DataRewriter.cpp

示例3: organizeNewData

void DataRewriter::organizeNewData(Region* reg, unsigned char magic) {
   /**
    *
    */
   VarList globals = filterVariables(reg);

   unsigned int dataSize = 0;
   unsigned int dataBase = 0;
   unsigned int dataOffset = 0;

   unsigned int rawIndex = 0;
   unsigned int rawValue = 0;

   unsigned int newRawIndex = 0;

   dataSize = reg->getRegionSize();
   dataBase = reg->getRegionAddr();

   newDataBase = dataBase;
   newDataSize = sizeof(unsigned char) * dataSize * 2;

   oldRaw = (unsigned char*) reg->getPtrToRawData();
   newRaw = (unsigned char*) malloc (newDataSize);

   // The dso_handle bullshit
   memcpy(newRaw, oldRaw, 4);
   memset(newRaw + 4, magic, 4);
   newRawIndex += 8;

   // Pad the new data section with an extra 4 bytes between all 4 byte values.
   for (int i = 0; i < globals.size(); i++) {
      dataOffset = globals[i]->getOffset();
      rawIndex = dataOffset - dataBase;
      memcpy(newRaw + newRawIndex, oldRaw + rawIndex, 4);
      // Sanity checks, write magic values into padding
      memset(newRaw + newRawIndex + 4, magic, 4);
      // Update the relocated address mapping
      newLocs[dataOffset] = dataBase + newRawIndex;
      newRawIndex += 8;
   }

   fprintf(stderr, "NEW DATA: %p through %p\n", newDataBase, newDataBase + newDataSize);

   if (!reg->setPtrToRawData(newRaw, newDataSize)) {
      fprintf(stderr, "Unable to assign new data section.\n");
      exit(EXIT_FAILURE);
   }

}
开发者ID:AmesianX,项目名称:memz,代码行数:49,代码来源:DataRewriter.cpp

示例4: nvars

 const size_t nvars( void ) const
 {
     return( m_vars.size() );
 }
开发者ID:zkbreeze,项目名称:OceanVis,代码行数:4,代码来源:main.cpp


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