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


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

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


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

示例1: setClientOutput

void CmdInterrupt::setClientOutput(DebuggerClient &client) {
  client.setOutputType(DebuggerClient::OTCodeLoc);
  client.setOTFileLine(m_bpi->m_file, m_bpi->m_line1);
  Array values;
  DebuggerClient::WatchPtrVec &watches = client.getWatches();
  for (int i = 0; i < (int)watches.size(); i++) {
    ArrayInit watch(3);
    watch.set(s_format, watches[i]->first);
    watch.set(s_php, watches[i]->second);
    Variant v = CmdPrint().processWatch(client, watches[i]->first,
                                        watches[i]->second);
    watch.set(s_value, CmdPrint::FormatResult(watches[i]->first, v));
    values.append(watch.create());
  }
  client.setOTValues(values);
}
开发者ID:MarkTseng,项目名称:hiphop-php,代码行数:16,代码来源:cmd_interrupt.cpp

示例2: processList

void CmdPrint::processList(DebuggerClient &client) {
  DebuggerClient::WatchPtrVec &watches = client.getWatches();
  for (int i = 0; i < (int)watches.size(); i++) {
    client.print("  %d %s  %s", i + 1,
                  StringUtil::Pad(watches[i]->first, 8, " ",
                                  StringUtil::PadType::Left).data(),
                  watches[i]->second.c_str());
  }
  if (watches.empty()) {
    client.tutorial(
      "Use '[p]rint [a]lways ...' to set new watch expressions. "
      "Use '[p]rint ?|[h]elp' to read how to set them. "
    );
  } else {
    client.tutorial(
      "Use '[p]rint [c]lear {index}|[a]ll' to remove watch expression(s). "
    );
  }
}
开发者ID:360buyliulei,项目名称:hiphop-php,代码行数:19,代码来源:cmd_print.cpp

示例3: processClear

void CmdPrint::processClear(DebuggerClient &client) {
  DebuggerClient::WatchPtrVec &watches = client.getWatches();
  if (watches.empty()) {
    client.error("There is no watch expression to clear.");
    client.tutorial(
      "Use '[p]rint [a]lways ...' to set new watch expressions. "
      "Use '[p]rint ?|[h]elp' to read how to set them. "
    );
    return;
  }

  if (client.arg(2, "all")) {
    watches.clear();
    client.info("All watch expressions are cleared.");
    return;
  }

  string snum = client.argValue(2);
  if (!DebuggerClient::IsValidNumber(snum)) {
    client.error("'[p]rint [c]lear' needs an {index} argument.");
    client.tutorial(
      "You will have to run '[p]rint [l]ist' first to see a list of valid "
      "numbers or indices to specify."
    );
    return;
  }

  int num = atoi(snum.c_str()) - 1;
  if (num < 0 || num >= (int)watches.size()) {
    client.error("\"%s\" is not a valid index. Choose one from this list:",
                  snum.c_str());
    processList(client);
    return;
  }

  watches.erase(watches.begin() + num);
}
开发者ID:360buyliulei,项目名称:hiphop-php,代码行数:37,代码来源:cmd_print.cpp

示例4: setClientOutput

void CmdPrint::setClientOutput(DebuggerClient &client) {
  client.setOutputType(DebuggerClient::OTValues);
  Array values;
  if (m_isForWatch) {
    // Manipulating the watch list, output the current list
    DebuggerClient::WatchPtrVec &watches = client.getWatches();
    for (int i = 0; i < (int)watches.size(); i++) {
      ArrayInit watch(2);
      watch.set(s_format, watches[i]->first);
      watch.set(s_php, watches[i]->second);
      values.append(watch.create());
    }
  } else {
    // Just print an expression, do similar output as eval
    values.set(s_body, m_body);
    if (client.getDebuggerClientApiModeSerialize()) {
      values.set(s_value_serialize,
                 DebuggerClient::FormatVariable(m_ret, 200));
    } else {
      values.set(s_value, m_ret);
    }
  }
  client.setOTValues(values);
}
开发者ID:kodypeterson,项目名称:hiphop-php,代码行数:24,代码来源:cmd_print.cpp

示例5: onClient


//.........这里部分代码省略.........
        client.info("Web request %s started.", m_program.c_str());
      }
      break;
    case RequestEnded:
      if (!m_program.empty()) {
        client.info("Web request %s ended.", m_program.c_str());
      }
      break;
    case PSPEnded:
      if (!m_program.empty()) {
        client.info("Post-Send Processing for %s was ended.",
                     m_program.c_str());
      }
      break;
    case HardBreakPoint:
    case BreakPointReached:
    case ExceptionThrown: {
      bool found = false;
      bool toggled = false;
      auto *bps = client.getBreakPoints();
      for (unsigned int i = 0; i < m_matched.size(); i++) {
        BreakPointInfoPtr bpm = m_matched[i];
        BreakPointInfoPtr bp;
        int index = 0;
        for (; index < (int)bps->size(); index++) {
          if (bpm->same((*bps)[index])) {
            bp = (*bps)[index];
            break;
          }
        }
        if (bp) {
          found = true;
          if (bp->m_state == BreakPointInfo::Once) {
            bp->m_state = BreakPointInfo::Disabled;
            toggled = true;
          }
          if (m_interrupt == BreakPointReached ||
              m_interrupt == HardBreakPoint) {
            client.info("Breakpoint %d reached %s", bp->index(),
                         m_bpi->site().c_str());
            client.shortCode(m_bpi);
          } else {
            if (m_bpi->m_exceptionClass == BreakPointInfo::ErrorClassName) {
              client.info("Breakpoint %d reached: An error occurred %s",
                           bp->index(), m_bpi->site().c_str());
              client.shortCode(m_bpi);
              client.error("Error Message: %s",
                            m_bpi->m_exceptionObject.c_str());
            } else {
              client.info("Breakpoint %d reached: Throwing %s %s",
                           bp->index(),
                           m_bpi->m_exceptionClass.c_str(),
                           m_bpi->site().c_str());
              client.shortCode(m_bpi);
              if (client.getLogFileHandler()) {
                client.output(m_bpi->m_exceptionObject);
              }
            }
          }
          if (!bpm->m_output.empty()) {
            client.print(bpm->m_output);
          }
        }
      }
      if (toggled) {
        CmdBreak::SendClientBreakpointListToServer(client);
      }
      if (!found) {
        if (m_interrupt == HardBreakPoint) {
          // for HardBreakPoint, default the frame to the caller
          client.setFrame(1);
        }
        client.info("Break %s", m_bpi->site().c_str());
        client.shortCode(m_bpi);
      }
      break;
    }
  }

  if (!m_errorMsg.empty()) {
    client.error(m_errorMsg);
  }

  // watches
  switch (m_interrupt) {
    case SessionStarted:
    case RequestStarted:
      break;
    default: {
      DebuggerClient::WatchPtrVec &watches = client.getWatches();
      for (int i = 0; i < (int)watches.size(); i++) {
        if (i > 0) client.output("%s", "");
        client.info("Watch %d: %s =", i + 1, watches[i]->second.c_str());
        Variant v = CmdPrint().processWatch(client, watches[i]->first,
                                            watches[i]->second);
        client.output(CmdPrint::FormatResult(watches[i]->first, v));
      }
    }
  }
}
开发者ID:191919,项目名称:hhvm,代码行数:101,代码来源:cmd_interrupt.cpp


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