本文整理汇总了C++中DebuggerClient::getThread方法的典型用法代码示例。如果您正苦于以下问题:C++ DebuggerClient::getThread方法的具体用法?C++ DebuggerClient::getThread怎么用?C++ DebuggerClient::getThread使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DebuggerClient
的用法示例。
在下文中一共展示了DebuggerClient::getThread方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: onClient
void CmdThread::onClient(DebuggerClient &client) {
if (DebuggerCommand::displayedHelp(client)) return;
if (client.argCount() > 1) {
help(client);
return;
}
if (client.argCount() == 0) {
m_body = "info";
auto res = client.xend<CmdThread>(this);
client.print(res->m_out);
} else if (client.arg(1, "list")) {
processList(client);
} else if (client.arg(1, "normal")) {
m_body = "normal";
client.sendToServer(this);
client.info("Thread is running in normal mode now. Other threads will "
"interleave when they hit breakpoints as well.");
} else if (client.arg(1, "sticky")) {
m_body = "sticky";
client.sendToServer(this);
client.info("Thread is running in sticky mode now. All other threads "
"will wait until this thread finishes, when they hit "
"breakpoints.");
} else if (client.arg(1, "exclusive")) {
m_body = "exclusive";
client.sendToServer(this);
client.info("Thread is running in exclusive mode now. All other threads "
"will not break, even when they hit breakpoints.");
} else {
std::string snum = client.argValue(1);
if (!DebuggerClient::IsValidNumber(snum)) {
client.error("'[t]hread {index}' needs a numeric argument.");
client.tutorial(
"You will have to run '[t]hread [l]ist' first to see a list of valid "
"numbers or indices to specify. Thread 1 is always your current "
"thread. If that's the only thread on the list, you do not have "
"another thread at break to switch to."
);
return;
}
int num = atoi(snum.c_str());
DThreadInfoPtr thread = client.getThread(num);
if (!thread) {
processList(client, false);
thread = client.getThread(num);
if (!thread) {
client.error("\"%s\" is not a valid thread index. Choose one from "
"this list:", snum.c_str());
processList(client);
return;
}
}
if (thread->m_id == client.getCurrentThreadId()) {
client.info("This is your current thread already.");
return;
}
m_body = "switch";
m_threads.push_back(thread);
client.sendToServer(this);
throw DebuggerConsoleExitException();
}
}