本文整理汇总了C++中DebuggerClient::getInstPoints方法的典型用法代码示例。如果您正苦于以下问题:C++ DebuggerClient::getInstPoints方法的具体用法?C++ DebuggerClient::getInstPoints怎么用?C++ DebuggerClient::getInstPoints使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DebuggerClient
的用法示例。
在下文中一共展示了DebuggerClient::getInstPoints方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: listInst
void CmdInstrument::listInst(DebuggerClient &client) {
m_type = ActionRead;
m_instPoints = client.getInstPoints();
CmdInstrumentPtr instCmdPtr = client.xend<CmdInstrument>(this);
client.setInstPoints(instCmdPtr->m_ips);
PrintInstPoints(client);
}
示例2: clearInst
void CmdInstrument::clearInst(DebuggerClient &client) {
m_type = ActionWrite;
m_instPoints = client.getInstPoints();
m_instPoints->clear();
CmdInstrumentPtr instCmdPtr = client.xend<CmdInstrument>(this);
client.setInstPoints(instCmdPtr->m_ips);
PrintInstPoints(client);
}
示例3: onClientImpl
void CmdInstrument::onClientImpl(DebuggerClient &client) {
if (DebuggerCommand::displayedHelp(client)) return;
if (client.argCount() == 1) {
if (client.argValue(1) == "list" || client.argValue(1) == "l") {
listInst(client);
return;
}
if (client.argValue(1) == "clear" || client.argValue(1) == "c") {
clearInst(client);
return;
}
}
if (client.argCount() < 2 || client.argValue(1) == "help") {
help(client);
return;
}
std::string loc = client.argValue(1);
std::string file = client.argValue(2);
std::string desc;
if (client.argCount() >= 3) {
desc = client.argValue(3);
}
Variant code = f_file_get_contents(file.c_str());
if (code.isNull()) {
client.error("Unable to read from file %s", file.c_str());
return;
}
m_instPoints = client.getInstPoints();
if (loc == "here") {
InstPointInfoPtr ipi(new InstPointInfo());
ipi->setLocHere();
ipi->m_code = (std::string) code.toString();
ipi->m_desc = desc;
m_instPoints->push_back(ipi);
} else if (loc.rfind("()") == loc.size() - 2){
InstPointInfoPtr ipi(new InstPointInfo());
ipi->setLocFuncEntry(loc.substr(0, loc.size() - 2));
ipi->m_code = (std::string) code.toString();
ipi->m_desc = desc;
m_instPoints->push_back(ipi);
} else {
client.error("Not implemented\n");
return;
}
m_type = ActionWrite;
CmdInstrumentPtr instCmdPtr = client.xend<CmdInstrument>(this);
if (!instCmdPtr->m_enabled) {
client.error("Instrumentation is not enabled on the server");
}
client.setInstPoints(instCmdPtr->m_ips);
CmdInstrument::PrintInstPoints(client);
}
示例4: PrintInstPoints
void CmdInstrument::PrintInstPoints(DebuggerClient &client) {
InstPointInfoPtrVec* ips = client.getInstPoints();
int size = ips->size();
client.print("%d instrumentation points", size);
for (int i = 0; i < size; i++) {
InstPointInfoPtr ipi = (*ips)[i];
if (ipi->m_locType == InstPointInfo::LocFileLine) {
client.print(" %d\t%s\t%s\tfile:\t%s:%d", i,
ipi->m_valid ? "valid" : "invalid",
ipi->m_desc.c_str(), ipi->m_file.c_str(), ipi->m_line);
} else if (ipi->m_locType == InstPointInfo::LocFuncEntry) {
client.print(" %d\t%s\t%s\tfunc entry:\t%s", i,
ipi->m_valid ? "valid" : "invalid",
ipi->m_desc.c_str(), ipi->m_func.c_str());
}
}
}
示例5: setClientOutput
void CmdInstrument::setClientOutput(DebuggerClient &client) {
// Output all instrumentation point info
client.setOutputType(DebuggerClient::OTValues);
Array values;
InstPointInfoPtrVec* ips = client.getInstPoints();
for (unsigned int i = 0; i < ips->size(); i++) {
InstPointInfoPtr ipi = (*ips)[i];
Array instpoint;
instpoint.set(s_valid, ipi->m_valid);
instpoint.set(s_desc, ipi->m_desc);
if (ipi->m_locType == InstPointInfo::LocFileLine) {
instpoint.set(s_type, s_file_line);
instpoint.set(s_file, ipi->m_file);
instpoint.set(s_line, ipi->m_line);
} else if (ipi->m_locType == InstPointInfo::LocFuncEntry) {
instpoint.set(s_type, s_func_entry);
instpoint.set(s_func, ipi->m_func);
}
values.append(instpoint);
}
client.setOTValues(values);
}