本文整理汇总了C++中DebuggerClient::isLocal方法的典型用法代码示例。如果您正苦于以下问题:C++ DebuggerClient::isLocal方法的具体用法?C++ DebuggerClient::isLocal怎么用?C++ DebuggerClient::isLocal使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DebuggerClient
的用法示例。
在下文中一共展示了DebuggerClient::isLocal方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AttachSandbox
bool CmdMachine::AttachSandbox(DebuggerClient &client,
DSandboxInfoPtr sandbox,
bool force /* = false */) {
if (client.isLocal()) {
client.error("Local script doesn't have sandbox to attach to.");
return false;
}
CmdMachine cmd;
cmd.m_body = "attach";
cmd.m_sandboxes.push_back(sandbox);
cmd.m_force = force;
client.info("Attaching to %s and pre-loading, please wait...",
sandbox->desc().c_str());
CmdMachinePtr cmdMachine = client.xend<CmdMachine>(&cmd);
if (cmdMachine->m_succeed) {
client.playMacro("startup");
} else {
// Note: it would be nice to give them more info about the process we think
// is debugging this sandbox: what machine it's on, what it's pid is, etc.
// Unfortunately, we don't have any of that data. We'd need a protocol
// change to have the client give us more info when it attaches.
client.error(
"Failed to attach to the sandbox. Maybe another client is debugging, \n"
"or a client failed to detach cleanly.\n"
"You can attach to another sandbox, or exit the other attached client, \n"
"or force this client to take over the sandbox with: \n"
"\n"
"\t[m]achine [a]ttach [f]orce %s %s"
"\n",
sandbox->m_user.c_str(), sandbox->m_name.c_str());
}
return cmdMachine->m_succeed;
}
示例2: AttachSandbox
bool CmdMachine::AttachSandbox(DebuggerClient &client,
DSandboxInfoPtr sandbox,
bool force /* = false */) {
if (client.isLocal()) {
client.error("Local script doesn't have sandbox to attach to.");
return false;
}
CmdMachine cmd;
cmd.m_body = "attach";
cmd.m_sandboxes.push_back(sandbox);
cmd.m_force = force;
client.info("Attaching to %s and pre-loading, please wait...",
sandbox->desc().c_str());
CmdMachinePtr cmdMachine = client.xend<CmdMachine>(&cmd);
if (cmdMachine->m_succeed) {
client.playMacro("startup");
} else {
client.error("failed to attach to sandbox, maybe another client is "
"debugging, \nattach to another sandbox, exit the "
"attached hphpd client, or try \n"
"[m]achine [a]ttach [f]orce [%s] [%s]",
sandbox->m_user.c_str(), sandbox->m_name.c_str());
}
return cmdMachine->m_succeed;
}