本文整理汇总了C++中BreakPointInfoPtr::getExceptionClass方法的典型用法代码示例。如果您正苦于以下问题:C++ BreakPointInfoPtr::getExceptionClass方法的具体用法?C++ BreakPointInfoPtr::getExceptionClass怎么用?C++ BreakPointInfoPtr::getExceptionClass使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BreakPointInfoPtr
的用法示例。
在下文中一共展示了BreakPointInfoPtr::getExceptionClass方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setClientOutput
void CmdBreak::setClientOutput(DebuggerClient *client) {
// Output an array of current breakpoints including exceptions
client->setOutputType(DebuggerClient::OTValues);
Array values;
m_breakpoints = client->getBreakPoints();
for (int i = 0; i < (int)m_breakpoints->size(); i++) {
BreakPointInfoPtr bpi = m_breakpoints->at(i);
Array breakpoint;
breakpoint.set(s_id, bpi->index());
breakpoint.set(s_state, bpi->state(false));
if (bpi->m_interrupt == ExceptionThrown) {
breakpoint.set(s_is_exception, true);
breakpoint.set(s_exception_class, bpi->getExceptionClass());
} else {
breakpoint.set(s_is_exception, false);
breakpoint.set(s_file, bpi->m_file);
breakpoint.set(s_line1, bpi->m_line1);
breakpoint.set(s_line2, bpi->m_line2);
breakpoint.set(s_namespace, bpi->getNamespace());
breakpoint.set(s_func, bpi->getFunction());
breakpoint.set(s_class, bpi->getClass());
}
breakpoint.set(s_url, bpi->m_url);
breakpoint.set(s_use_regex, bpi->m_regex);
breakpoint.set(s_clause_type, bpi->m_check ? s_if : s_ampamp);
breakpoint.set(s_clause, bpi->m_clause);
breakpoint.set(s_desc, bpi->desc());
values.append(breakpoint);
}
client->setOTValues(values);
}
示例2: proxySetBreakPoints
void proxySetBreakPoints(DebuggerProxy* proxy) {
std::vector<BreakPointInfoPtr> bps;
proxy->getBreakPoints(bps);
for (unsigned int i = 0; i < bps.size(); i++) {
BreakPointInfoPtr bp = bps[i];
bp->m_bindState = BreakPointInfo::Unknown;
auto className = bp->getClass();
if (!className.empty()) {
auto clsName = makeStaticString(className);
auto cls = Unit::lookupClass(clsName);
if (cls == nullptr) continue;
bp->m_bindState = BreakPointInfo::KnownToBeInvalid;
size_t numFuncs = cls->numMethods();
if (numFuncs == 0) continue;
auto methodName = bp->getFunction();
for (size_t i = 0; i < numFuncs; ++i) {
auto f = cls->getMethod(i);
if (!matchFunctionName(methodName, f)) continue;
bp->m_bindState = BreakPointInfo::KnownToBeValid;
phpAddBreakPointFuncEntry(f);
break;
}
// TODO(#2527229): what about superclass methods accessed via the derived
// class?
continue;
}
auto funcName = bp->getFuncName();
if (!funcName.empty()) {
auto fName = makeStaticString(funcName);
Func* f = Unit::lookupFunc(fName);
if (f == nullptr) continue;
bp->m_bindState = BreakPointInfo::KnownToBeValid;
phpAddBreakPointFuncEntry(f);
continue;
}
auto fileName = bp->m_file;
if (!fileName.empty()) {
for (auto& kv : g_context->m_evaledFiles) {
auto const unit = kv.second;
if (!BreakPointInfo::MatchFile(fileName,
unit->filepath()->toCppString())) {
continue;
}
addBreakPointInUnit(bp, unit);
break;
}
continue;
}
auto exceptionClassName = bp->getExceptionClass();
if (exceptionClassName == "@") {
bp->m_bindState = BreakPointInfo::KnownToBeValid;
continue;
} else if (!exceptionClassName.empty()) {
auto expClsName = makeStaticString(exceptionClassName);
auto cls = Unit::lookupClass(expClsName);
if (cls != nullptr) {
auto baseClsName = makeStaticString("Exception");
auto baseCls = Unit::lookupClass(baseClsName);
if (baseCls != nullptr) {
if (cls->classof(baseCls)) {
bp->m_bindState = BreakPointInfo::KnownToBeValid;
} else {
bp->m_bindState = BreakPointInfo::KnownToBeInvalid;
}
}
}
continue;
} else {
continue;
}
// If we get here, the break point is of a type that does
// not need to be explicitly enabled in the VM. For example
// a break point that get's triggered when the server starts
// to process a page request.
bp->m_bindState = BreakPointInfo::KnownToBeValid;
}
}