当前位置: 首页>>代码示例>>C++>>正文


C++ DebuggerClient::isLocal方法代码示例

本文整理汇总了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;
}
开发者ID:MarkTseng,项目名称:hiphop-php,代码行数:35,代码来源:cmd_machine.cpp

示例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;
}
开发者ID:kodypeterson,项目名称:hiphop-php,代码行数:27,代码来源:cmd_machine.cpp


注:本文中的DebuggerClient::isLocal方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。