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


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

本文整理汇总了C++中DebuggerClient::isStackTraceAsync方法的典型用法代码示例。如果您正苦于以下问题:C++ DebuggerClient::isStackTraceAsync方法的具体用法?C++ DebuggerClient::isStackTraceAsync怎么用?C++ DebuggerClient::isStackTraceAsync使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DebuggerClient的用法示例。


在下文中一共展示了DebuggerClient::isStackTraceAsync方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: onClient

void CmdVariable::onClient(DebuggerClient &client) {
  if (DebuggerCommand::displayedHelp(client)) return;

  String text;
  if (client.argCount() == 1) {
    text = client.argValue(1);
  } else if (client.argCount() != 0) {
    help(client);
    return;
  }

  if (client.isStackTraceAsync()) {
    m_type = KindOfVariableAsync;
  }

  m_frame = client.getFrame();

  auto cmd = client.xend<CmdVariable>(this);
  if (cmd->m_variables.empty()) {
    client.info("(no variable was defined)");
  } else {
    PrintVariables(client, cmd->m_variables, cmd->m_global ? -1 : m_frame,
        text, cmd->m_version);
  }
}
开发者ID:Fininvest,项目名称:hhvm,代码行数:25,代码来源:cmd_variable.cpp

示例2: PrintVariable

void CmdVariable::PrintVariable(DebuggerClient &client, const String& varName) {
  CmdVariable cmd(client.isStackTraceAsync()
                  ? KindOfVariableAsync : KindOfVariable);
  auto charCount = client.getDebuggerClientShortPrintCharCount();
  cmd.m_frame = client.getFrame();
  auto rcmd = client.xend<CmdVariable>(&cmd);

  always_assert(rcmd->m_version == 2);

  // Using the new protocol.  rcmd contains a list of variables only.  Fetch
  // value of varName only, so that we can recover nicely when its value is too
  // large to serialize.
  cmd.m_varName = varName;
  cmd.m_variables.reset();
  cmd.m_formatMaxLen = charCount;
  cmd.m_version = 2;
  rcmd = client.xend<CmdVariable>(&cmd);

  if (rcmd->m_variables.empty()) {
    // Perhaps the value is too large? See recvImpl.  Retry the command with
    // version 1, in which case values are omitted.
    cmd.m_version = 1;
    rcmd = client.xend<CmdVariable>(&cmd);
    if (!rcmd->m_variables.empty()) {
      // It's there without values, and gone with values, so it is too large.
      client.output(s_omitted);
    }
    return;
  }

  auto const get_var = [varName] (const CmdVariable& cmd) {
    assert(cmd.m_variables.size() == 1);
    assert(cmd.m_variables.exists(varName, true /* isKey */));
    assert(cmd.m_variables[varName].isString());
    return cmd.m_variables[varName].toString();
  };

  auto const value = get_var(*rcmd);
  if (charCount <= 0 || value.size() <= charCount) {
    client.output(value);
    return;
  }

  // Don't show the "omitted" suffix.
  client.output(StringSlice(value.data(), charCount));
  if (client.ask("There are more characters. Continue? [y/N]") == 'y') {
    // Now we get the full value, and show the rest.
    cmd.m_variables.reset();
    cmd.m_formatMaxLen = -1;
    rcmd = client.xend<CmdVariable>(&cmd);

    auto value = get_var(*rcmd);
    auto rest = StringSlice(value.data() + charCount, value.size() - charCount);
    client.output(rest);
    client.tutorial("You can use 'set cc n' to increase the character"
                    " limit. 'set cc -1' will remove the limit.");
  }
}
开发者ID:Globalcherry,项目名称:hhvm,代码行数:58,代码来源:cmd_variable.cpp

示例3: fetchStackTrace

Array CmdWhere::fetchStackTrace(DebuggerClient &client) {
  Array st = client.getStackTrace();
  // Only grab a new stack trace if we don't have one cached, or if
  // the one cached does not match the type of stack trace being
  // requested.
  bool isAsync = m_type == KindOfWhereAsync;
  if (st.isNull() || (isAsync != client.isStackTraceAsync())) {
    m_stackArgs = client.getDebuggerClientStackArgs();
    auto cmd = client.xend<CmdWhere>(this);
    st = cmd->m_stacktrace;
    client.setStackTrace(st, isAsync);
  }
  return st;
}
开发者ID:stone54321277,项目名称:hhvm,代码行数:14,代码来源:cmd_where.cpp

示例4: onClient

void CmdDown::onClient(DebuggerClient &client) {
  if (DebuggerCommand::displayedHelp(client)) return;
  if (client.argCount() > 1) {
    help(client);
  } else {
    if (client.isStackTraceAsync()) {
      CmdWhere(KindOfWhereAsync).fetchStackTrace(client);
    } else {
      CmdWhere().fetchStackTrace(client);
    }

    client.moveToFrame(client.getFrame() - CmdUp::ParseNumber(client));
  }
}
开发者ID:1mr3yn,项目名称:hhvm,代码行数:14,代码来源:cmd_down.cpp

示例5: PrintVariable

void CmdVariable::PrintVariable(DebuggerClient &client, const String& varName) {
  CmdVariable cmd(client.isStackTraceAsync()
                  ? KindOfVariableAsync : KindOfVariable);
  auto charCount = client.getDebuggerClientShortPrintCharCount();
  cmd.m_frame = client.getFrame();
  auto rcmd = client.xend<CmdVariable>(&cmd);
  if (rcmd->m_version == 2) {
    // Using the new protocol. rcmd contains a list of variables only.
    // Fetch value of varName only, so that we can recover nicely when its
    // value is too large to serialize.
    cmd.m_varName = varName;
    cmd.m_variables.reset();
    cmd.m_version = 2;
    rcmd = client.xend<CmdVariable>(&cmd);
    if (rcmd->m_variables.empty()) {
      // Perhaps the value is too large? See recvImpl.
      // Retry the command with version 1, in which case values are omitted.
      cmd.m_version = 1;
      rcmd = client.xend<CmdVariable>(&cmd);
      if (!rcmd->m_variables.empty()) {
        // It's there without values, and gone with values, so it is too large.
        client.output("...(omitted)");
        return;
      }
    }
  }
  if (!rcmd->m_variables.empty()) {
    for (ArrayIter iter(rcmd->m_variables); iter; ++iter) {
      String name = iter.first().toString();
      if (!name.equal(varName)) continue;
      String value = DebuggerClient::FormatVariable(iter.second(), -1);
      auto excess = value.length() - charCount;
      if (charCount <= 0 || excess <= 0) {
        client.output("%s", value.data());
      } else {
        client.output("%s", value.substr(0, charCount).data());
        if (client.ask("There are %d more characters. Continue? [y/N]", excess)
            == 'y') {
          client.output("%s", value.substr(charCount).data());
          client.tutorial("You can use 'set cc n' to increase the character"
              " limit. 'set cc -1' will remove the limit.");
        }
      }
    }
  }
}
开发者ID:Fininvest,项目名称:hhvm,代码行数:46,代码来源:cmd_variable.cpp

示例6: PrintVariables

void CmdVariable::PrintVariables(DebuggerClient &client, const Array& variables,
                                 int frame, const String& text, int version) {
  bool global = frame == -1; // I.e. we were called from CmdGlobal, or the
  //client's current frame is the global frame, according to OnServer
  bool system = true;
  int i = 0;
  bool found = false;
  for (ArrayIter iter(variables); iter; ++iter) {
    String name = iter.first().toString();
    String value;
    if (version == 2) {
      // Using the new protocol, so variables contain only names.
      // Fetch the value separately.
      CmdVariable cmd(client.isStackTraceAsync()
        ? KindOfVariableAsync : KindOfVariable);
      cmd.m_frame = frame;
      cmd.m_variables = null_array;
      cmd.m_varName = name;
      cmd.m_filter = text;
      cmd.m_version = 2;
      auto rcmd = client.xend<CmdVariable>(&cmd);
      if (!rcmd->m_variables.empty()) {
        value = DebuggerClient::FormatVariable(rcmd->m_variables[name], 200);
        found = true;
      } else if (text.empty()) {
        // Not missing because filtered out, assume the value is too large.
        value = s_omitted;
        found = true;
      } else {
        if (name.find(text, 0, false) >= 0) {
          // Server should have matched it.
          // Assume missing because value is too large.
          value = s_omitted;
          found = true;
        } else {
          // The variable was filtered out on the server, using text.
          // Or it was just too large. Either way we let skip over it.
          continue;
        }
      }
    } else {
      value = DebuggerClient::FormatVariable(iter.second(), 200);
    }
    if (version == 0 && !text.empty()) {
      if (name.find(text, 0, false) >= 0) {
        client.print("%s = %s", name.data(), value.data());
        found = true;
      } else {
        String fullvalue = DebuggerClient::FormatVariable(value, -1);
        if (fullvalue.find(text, 0, false) >= 0) {
          client.print("%s = %s", name.data(), value.data());
          found = true;
        }
      }
    } else {
      if (global && system) {
        client.print("$%s = %s", name.data(), value.data());
      } else {
        client.output("$%s = %s", name.data(), value.data());
      }

      // we know s_HTTP_RAW_POST_DATA is the last system global
      if (global && name == s_HTTP_RAW_POST_DATA) {
        client.output("%s", "");
        system = false;
      }

      ++i;
      if (i % DebuggerClient::ScrollBlockSize == 0 &&
          client.ask("There are %zd more variables. Continue? [Y/n]",
                      variables.size() - i) == 'n') {
        break;
      }
    }
  }

  if (!text.empty() && !found) {
    client.info("(unable to find specified text in any variables)");
  }
}
开发者ID:Fininvest,项目名称:hhvm,代码行数:80,代码来源:cmd_variable.cpp


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