本文整理汇总了C++中Extension::debuggerSupport方法的典型用法代码示例。如果您正苦于以下问题:C++ Extension::debuggerSupport方法的具体用法?C++ Extension::debuggerSupport怎么用?C++ Extension::debuggerSupport使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Extension
的用法示例。
在下文中一共展示了Extension::debuggerSupport方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: onServer
bool CmdExtension::onServer(DebuggerProxy *proxy) {
if (m_args.size() <= 1) {
return processList(proxy);
}
string name = m_args[1];
Extension *ext = Extension::GetExtension(name);
if (ext) {
if (m_args.size() == 2) {
if (ext->debuggerSupport() & IDebuggable::SupportInfo) {
IDebuggable::InfoVec info;
ext->debuggerInfo(info);
m_out = DebuggerClient::FormatInfoVec(info);
} else {
m_err = "Extension doesn't have summary information.";
}
} else if (DebuggerClient::Match(m_args[2].c_str(), "dump")) {
if (ext->debuggerSupport() & IDebuggable::SupportDump) {
m_out = ext->debuggerDump();
m_out += "\n";
} else {
m_err = "Extension doesn't have detailed dumps.";
}
} else {
if (ext->debuggerSupport() & IDebuggable::SupportVerb) {
string verb = m_args[2];
StringVec args;
if (m_args.size() > 3) {
args.insert(args.end(), m_args.begin() + 3, m_args.end());
}
m_out = ext->debuggerVerb(verb, args);
m_out += "\n";
} else {
m_err = "Extension doesn't support any debugger actions.";
}
}
} else {
m_err = "Unable to find the specified extension: ";
m_err += String(name);
}
return proxy->send(this);
}
示例2: processList
bool CmdExtension::processList(DebuggerProxy *proxy) {
IDebuggable::InfoVec info;
Array exts = Extension::GetLoadedExtensions();
typedef std::set<std::string, string_lessi> sorted_iset;
sorted_iset names;
for (ArrayIter iter(exts); iter; ++iter) {
names.insert(iter.second().toString().data());
}
for (sorted_iset::const_iterator iter = names.begin();
iter != names.end(); ++iter) {
Extension *ext = Extension::GetExtension(*iter);
ASSERT(ext);
if (ext) {
int support = ext->debuggerSupport();
string line;
line += (support & IDebuggable::SupportInfo) ? "Yes " : " ";
line += (support & IDebuggable::SupportDump) ? "Yes " : " ";
line += (support & IDebuggable::SupportVerb) ? "Yes " : " ";
line += ext->getVersion();
IDebuggable::Add(info, iter->c_str(), line);
}
}
int nameLen;
String body = DebuggerClient::FormatInfoVec(info, &nameLen);
int hrLen = nameLen + 42;
if (hrLen > DebuggerClient::LineWidth) hrLen = DebuggerClient::LineWidth;
StringBuffer sb;
for (int i = 0; i < hrLen; i++) sb.append(BOX_H); sb.append("\n");
sb.append(StringUtil::Pad("Name\\Support", nameLen));
sb.append("Info Dump Verb Version\n");
for (int i = 0; i < hrLen; i++) sb.append(BOX_H); sb.append("\n");
sb.append(body);
for (int i = 0; i < hrLen; i++) sb.append(BOX_H); sb.append("\n");
m_out = sb.detach();
return proxy->send(this);
}