本文整理汇总了C++中Proc::getCluster方法的典型用法代码示例。如果您正苦于以下问题:C++ Proc::getCluster方法的具体用法?C++ Proc::getCluster怎么用?C++ Proc::getCluster使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Proc
的用法示例。
在下文中一共展示了Proc::getCluster方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: parseCmd
//.........这里部分代码省略.........
prog->getRootCluster()->printTree(std::cout);
std::cout << "\n\tlibprocs:\n";
PROGMAP::const_iterator it;
for (Proc *p = prog->getFirstProc(it); p; p = prog->getNextProc(it))
if (p->isLib())
std::cout << "\t\t" << p->getName() << "\n";
std::cout << "\n\tuserprocs:\n";
for (Proc *p = prog->getFirstProc(it); p; p = prog->getNextProc(it))
if (!p->isLib())
std::cout << "\t\t" << p->getName() << "\n";
std::cout << "\n";
return 0;
} else if (!strcmp(argv[1], "cluster")) {
if (argc <= 2) {
std::cerr << "not enough arguments for cmd\n";
return 1;
}
Cluster *cluster = prog->findCluster(argv[2]);
if (cluster == NULL) {
std::cerr << "cannot find cluster " << argv[2] << "\n";
return 1;
}
std::cout << "cluster " << cluster->getName() << ":\n";
if (cluster->getParent())
std::cout << "\tparent = " << cluster->getParent()->getName() << "\n";
else
std::cout << "\troot cluster.\n";
std::cout << "\tprocs:\n";
PROGMAP::const_iterator it;
for (Proc *p = prog->getFirstProc(it); p; p = prog->getNextProc(it))
if (p->getCluster() == cluster)
std::cout << "\t\t" << p->getName() << "\n";
std::cout << "\n";
return 0;
} else if (!strcmp(argv[1], "proc")) {
if (argc <= 2) {
std::cerr << "not enough arguments for cmd\n";
return 1;
}
Proc *proc = prog->findProc(argv[2]);
if (proc == NULL) {
std::cerr << "cannot find proc " << argv[2] << "\n";
return 1;
}
std::cout << "proc " << proc->getName() << ":\n";
std::cout << "\tbelongs to cluster " << proc->getCluster()->getName() << "\n";
std::cout << "\tnative address " << std::hex << proc->getNativeAddress() << std::dec << "\n";
if (proc->isLib())
std::cout << "\tis a library proc.\n";
else {
std::cout << "\tis a user proc.\n";
UserProc *p = (UserProc*)proc;
if (p->isDecoded())
std::cout << "\thas been decoded.\n";
//if (p->isAnalysed())
// std::cout << "\thas been analysed.\n";
}
std::cout << "\n";
return 0;