本文整理汇总了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(®s);
#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;
}