本文整理汇总了C++中BreakPointInfoPtr::state方法的典型用法代码示例。如果您正苦于以下问题:C++ BreakPointInfoPtr::state方法的具体用法?C++ BreakPointInfoPtr::state怎么用?C++ BreakPointInfoPtr::state使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BreakPointInfoPtr
的用法示例。
在下文中一共展示了BreakPointInfoPtr::state方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: processList
bool CmdBreak::processList(DebuggerClient *client) {
m_breakpoints = client->getBreakPoints();
for (int i = 0; i < (int)m_breakpoints->size(); i++) {
BreakPointInfoPtr bpi = m_breakpoints->at(i);
client->print(" %d\t%s %s", bpi->index(), bpi->state(true).c_str(),
bpi->desc().c_str());
}
if (m_breakpoints->empty()) {
client->tutorial(
"Use '[b]reak ?|[h]elp' to read how to set breakpoints. "
);
} else {
client->tutorial(
"Use '[b]reak [c]lear {index}|[a]ll' to remove breakpoint(s). "
"Use '[b]reak [t]oggle {index}|[a]ll' to change their states."
);
}
return true;
}
示例3: processUpdate
//.........这里部分代码省略.........
bp->setState(BreakPointInfo::Always);
} else if (hasDisableArg(client)) {
action = "updated";
bp->setState(BreakPointInfo::Disabled);
} else {
assert(hasToggleArg(client));
action = "updated";
bp->toggle();
}
client->info("Breakpoint %d is %s %s", bp->index(),
action, bp->site().c_str());
found = true;
}
}
if (found) {
updateImpl(client);
return true;
}
client->error("There is no current breakpoint to clear or toggle.");
return true;
}
if (client->arg(2, "all")) {
if (hasClearArg(client)) {
m_breakpoints->clear();
updateImpl(client);
client->info("All breakpoints are cleared.");
return true;
}
for (unsigned int i = 0; i < m_breakpoints->size(); i++) {
BreakPointInfoPtr bpi = (*m_breakpoints)[i];
if (hasEnableArg(client)) {
bpi->setState(BreakPointInfo::Always);
}
else if (hasDisableArg(client)) {
bpi->setState(BreakPointInfo::Disabled);
}
else {
assert(hasToggleArg(client));
bpi->toggle();
}
}
updateImpl(client);
return processList(client);
}
string snum = client->argValue(2);
if (!DebuggerClient::IsValidNumber(snum)) {
client->error("'[b]reak [c]lear|[t]oggle' needs an {index} argument.");
client->tutorial(
"You will have to run '[b]reak [l]ist' first to see a list of valid "
"numbers or indices to specify."
);
return true;
}
int index = -1;
int num = atoi(snum.c_str());
for (unsigned int i = 0; i < m_breakpoints->size(); i++) {
if (m_breakpoints->at(i)->index() == num) {
index = i;
break;
}
}
if (index < 0) {
client->error("\"%s\" is not a valid breakpoint index. Choose one from "
"this list:", snum.c_str());
processList(client);
return true;
}
BreakPointInfoPtr bpi = (*m_breakpoints)[index];
if (hasClearArg(client)) {
m_breakpoints->erase(m_breakpoints->begin() + index);
updateImpl(client);
client->info("Breakpoint %d cleared %s", bpi->index(),
bpi->desc().c_str());
} else if (hasEnableArg(client)) {
bpi->setState(BreakPointInfo::Always);
updateImpl(client);
client->info("Breakpoint %d's state is changed to %s.", bpi->index(),
bpi->state(false).c_str());
} else if (hasDisableArg(client)) {
bpi->setState(BreakPointInfo::Disabled);
updateImpl(client);
client->info("Breakpoint %d's state is changed to %s.", bpi->index(),
bpi->state(false).c_str());
} else {
assert(hasToggleArg(client));
bpi->toggle();
updateImpl(client);
client->info("Breakpoint %d's state is changed to %s.", bpi->index(),
bpi->state(false).c_str());
}
return true;
}