Ejemplo n.º 1
0
void CmdEval::onClient(DebuggerClient &client) {
  m_body = client.getCode();
  m_frame = client.getFrame();
  m_bypassAccessCheck = client.getDebuggerClientBypassCheck();
  auto res =
     client.xendWithNestedExecution<CmdEval>(this);
  res->handleReply(client);
  m_failed = res->m_failed;
}
Ejemplo n.º 2
0
void CmdEval::onClient(DebuggerClient &client) {
  m_body = client.getCode();
  m_frame = client.getFrame();
  m_bypassAccessCheck = client.getDebuggerClientBypassCheck();
  auto res = client.xendWithNestedExecution<CmdEval>(this);
  assertx(res->is(DebuggerCommand::KindOfEval));
  auto eval = std::static_pointer_cast<CmdEval>(res);
  eval->handleReply(client);
  m_failed = eval->m_failed;
}
Ejemplo n.º 3
0
// If there is no current file, print the desired range of eval code
// or give an error message if the debugger is not currently performing
// an eval command.
void CmdList::listEvalCode(DebuggerClient &client) {
  assert(m_file.empty());

  std::string evalCode = client.getCode();
  if (evalCode.empty()) {
    client.error("There is no current source file.");
  } else {
    client.print(highlight_php(evalCode));
  }
}
Ejemplo n.º 4
0
void CmdEval::onClientImpl(DebuggerClient &client) {
  m_body = client.getCode();
  m_frame = client.getFrame();
  m_bypassAccessCheck = client.getDebuggerBypassCheck();
  DebuggerCommandPtr res =
    client.xendWithNestedExecution<DebuggerCommand>(this);
  if (!res->is(m_type)) {
    assert(client.isApiMode());
    m_incomplete = true;
    res->setClientOutput(client);
  } else {
    res->handleReply(client);
  }
}
Ejemplo n.º 5
0
void CmdEval::onClientImpl(DebuggerClient &client) {
  m_body = client.getCode();
  m_frame = client.getFrame();
  m_bypassAccessCheck = client.getDebuggerBypassCheck();
  client.sendToServer(this);
  DebuggerCommandPtr res = client.recvFromServer(m_type);
  if (!res->is(m_type)) {
    assert(client.isApiMode());
    m_incomplete = true;
    res->setClientOutput(client);
  } else {
    res->handleReply(client);
  }
}
Ejemplo n.º 6
0
void CmdZend::onClientImpl(DebuggerClient &client) {
  if (DebuggerCommand::displayedHelp(client)) return;

  if (client.argCount() == 0) {
    const std::string &code = client.getCode();
    if (!code.empty()) {
      const std::string zendExe = client.getZendExecutable();
      client.info("Executing last PHP block with \"%s\"...", zendExe.c_str());
      string out;
      Process::Exec(zendExe.c_str(), nullptr, code.c_str(), out, &out, true);
      client.print(out);
      return;
    }
  }
  help(client);
}