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


C++ Extension::debuggerSupport方法代码示例

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


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

示例1: onServer

bool CmdExtension::onServer(DebuggerProxy *proxy) {
  if (m_args.size() <= 1) {
    return processList(proxy);
  }

  string name = m_args[1];
  Extension *ext = Extension::GetExtension(name);
  if (ext) {
    if (m_args.size() == 2) {
      if (ext->debuggerSupport() & IDebuggable::SupportInfo) {
        IDebuggable::InfoVec info;
        ext->debuggerInfo(info);
        m_out = DebuggerClient::FormatInfoVec(info);
      } else {
        m_err = "Extension doesn't have summary information.";
      }
    } else if (DebuggerClient::Match(m_args[2].c_str(), "dump")) {
      if (ext->debuggerSupport() & IDebuggable::SupportDump) {
        m_out = ext->debuggerDump();
        m_out += "\n";
      } else {
        m_err = "Extension doesn't have detailed dumps.";
      }
    } else {
      if (ext->debuggerSupport() & IDebuggable::SupportVerb) {
        string verb = m_args[2];
        StringVec args;
        if (m_args.size() > 3) {
          args.insert(args.end(), m_args.begin() + 3, m_args.end());
        }
        m_out = ext->debuggerVerb(verb, args);
        m_out += "\n";
      } else {
        m_err = "Extension doesn't support any debugger actions.";
      }
    }
  } else {
    m_err = "Unable to find the specified extension: ";
    m_err += String(name);
  }
  return proxy->send(this);
}
开发者ID:AviMoto,项目名称:hiphop-php,代码行数:42,代码来源:cmd_extension.cpp

示例2: processList

bool CmdExtension::processList(DebuggerProxy *proxy) {
  IDebuggable::InfoVec info;

  Array exts = Extension::GetLoadedExtensions();
  typedef std::set<std::string, string_lessi> sorted_iset;
  sorted_iset names;
  for (ArrayIter iter(exts); iter; ++iter) {
    names.insert(iter.second().toString().data());
  }
  for (sorted_iset::const_iterator iter = names.begin();
       iter != names.end(); ++iter) {
    Extension *ext = Extension::GetExtension(*iter);
    ASSERT(ext);
    if (ext) {
      int support = ext->debuggerSupport();
      string line;
      line += (support & IDebuggable::SupportInfo) ? "Yes     " : "        ";
      line += (support & IDebuggable::SupportDump) ? "Yes     " : "        ";
      line += (support & IDebuggable::SupportVerb) ? "Yes     " : "        ";
      line += ext->getVersion();
      IDebuggable::Add(info, iter->c_str(), line);
    }
  }
  int nameLen;
  String body = DebuggerClient::FormatInfoVec(info, &nameLen);
  int hrLen = nameLen + 42;
  if (hrLen > DebuggerClient::LineWidth) hrLen = DebuggerClient::LineWidth;

  StringBuffer sb;
  for (int i = 0; i < hrLen; i++) sb.append(BOX_H); sb.append("\n");
  sb.append(StringUtil::Pad("Name\\Support", nameLen));
  sb.append("Info    Dump    Verb    Version\n");
  for (int i = 0; i < hrLen; i++) sb.append(BOX_H); sb.append("\n");
  sb.append(body);
  for (int i = 0; i < hrLen; i++) sb.append(BOX_H); sb.append("\n");

  m_out = sb.detach();
  return proxy->send(this);
}
开发者ID:AviMoto,项目名称:hiphop-php,代码行数:39,代码来源:cmd_extension.cpp


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