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


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

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


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

示例1: handleIfDueToSharedObjectMapping

bool dynamic_linking::handleIfDueToSharedObjectMapping(EventRecord &ev, 
                                                       pdvector<mapped_object*> &changed_objects)
{

   struct dyn_saved_regs regs;

   // multi-threaded: possible one of many threads hit the breakpoint

   pdvector<Frame> activeFrames;
   if (!proc->getAllActiveFrames(activeFrames)) {
      return false;
   }

   dyn_lwp *brk_lwp = NULL;
   sharedLibHook *hook = NULL;
   for (unsigned frame_iter = 0; frame_iter < activeFrames.size();frame_iter++)
   {
       hook = reachedLibHook(activeFrames[frame_iter].getPC());
       if (hook) {
           brk_lwp = activeFrames[frame_iter].getLWP();
           break;
       }
   }

   if (brk_lwp || force_library_load) {
       // find out what has changed in the link map
      // and process it
      r_debug debug_elm;
      if(!proc->readDataSpace((caddr_t)(r_debug_addr),
                              sizeof(r_debug),(caddr_t)&(debug_elm),true)) {
          // bperr("read failed r_debug_addr = 0x%x\n",r_debug_addr);
          return false;
      }
      
      // if the state of the link maps is consistent then we can read
      // the link maps, otherwise just set the r_state value
      ev.what = r_state;   // previous state of link maps 
      r_state = debug_elm.r_state;  // new state of link maps

      if( debug_elm.r_state == 0) {
          // figure out how link maps have changed, and then create
         // a list of either all the removed shared objects if this
         // was a dlclose or the added shared objects if this was a dlopen
      
         // kludge: the state of the first add can get screwed up
         // so if both change_type and r_state are 0 set change_type to 1
         if(ev.what == 0) ev.what = SHAREDOBJECT_ADDED;
         findChangeToLinkMaps((u_int &)ev.what, changed_objects);
      } 
      
      // Don't need to reset PC
      if (!force_library_load) {
          assert(brk_lwp);
          
          // Get the registers for this lwp
          brk_lwp->getRegisters(&regs);
#if defined(arch_sparc)
          // change the pc so that it will look like the retl instr 
          // completed: set PC to o7 in current frame
          // we can do this because this retl doesn't correspond to 
          // an instrumentation point, so we don't have to worry about 
          // missing any instrumentation code by making it look like the
          // retl has already happend
          
          // first get the value of the stackpointer
          Address o7reg = regs.theIntRegs[R_O7];
          o7reg += 2*instruction::size();
          if(!(brk_lwp->changePC(o7reg, NULL))) {
              // bperr("error in changePC handleIfDueToSharedObjectMapping\n");
              return false;
          }
#else //x86
      // set the pc to the "ret" instruction
          Address next_pc = regs[R_PC] + instruction::size();
          if (!brk_lwp->changePC(next_pc))
              return false;
#endif
      }
      if (changed_objects.size() == 0) ev.what = 0;
      return true;

   }
  return false;
}
开发者ID:vishalmistry,项目名称:imitate,代码行数:84,代码来源:solarisDL.C


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