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
void CmdPrint::onClient(DebuggerClient &client) {
  if (DebuggerCommand::displayedHelp(client)) return;
  if (client.argCount() == 0) {
    help(client);
    return;
  }

  int index = 1;
  if (client.arg(1, "always")) {
    m_isForWatch = true;
    if (client.argCount() == 1) {
      client.error("'[p]rint [a]lways' needs an expression to watch.");
      return;
    }
    index++;
  } else if (client.arg(1, "list")) {
    m_isForWatch = true;
    processList(client);
    return;
  } else if (client.arg(1, "clear")) {
    m_isForWatch = true;
    processClear(client);
    return;
  }

  const char *format = nullptr;
  for (const char **fmt = Formats; *fmt; fmt++) {
    if (client.arg(index, *fmt)) {
      format = *fmt;
      index++;
      break;
    }
  }
  m_body = client.lineRest(index);
  if (m_isForWatch) {
    client.addWatch(format, m_body);
    return;
  }
  m_bypassAccessCheck = client.getDebuggerClientBypassCheck();
  m_printLevel = client.getDebuggerClientPrintLevel();
  assert(m_printLevel <= 0 || m_printLevel >= DebuggerClient::MinPrintLevel);
  m_frame = client.getFrame();
  CmdPrintPtr res = client.xendWithNestedExecution<CmdPrint>(this);
  m_output = res->m_output;
  m_ret = res->m_ret;
  if (!m_output.empty()) {
    client.output(m_output);
  }
  client.output(FormatResult(format, m_ret));
}
Ejemplo n.º 4
0
void CmdConfig::listVars(DebuggerClient &client) {
  std::string LogFile = client.getLogFile();
  client.print("LogFile(lf) %s", LogFile == "" ?
                                    "off" : LogFile.c_str());
  client.print("BypassAccessCheck(bac) %s",
                client.getDebuggerClientBypassCheck() ? "on" : "off");
  client.print("PrintLevel(pl) %d", client.getDebuggerClientPrintLevel());
  client.print("ShortPrintCharCount(cc) %d",
               client.getDebuggerClientShortPrintCharCount());
  client.print("SmallStep(ss) %s",
                client.getDebuggerClientSmallStep() ? "on" : "off");
  client.print("StackArgs(sa) %s",
                client.getDebuggerClientStackArgs() ? "on" : "off");
  client.print("MaxCodeLines(mcl) %d",
                client.getDebuggerClientMaxCodeLines());
}