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


C++ StringExtractorGDBRemote::GetHexU8方法代码示例

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


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

示例1: ShouldStop

bool GDBRemoteClientBase::ShouldStop(const UnixSignals &signals,
                                     StringExtractorGDBRemote &response) {
  std::lock_guard<std::mutex> lock(m_mutex);

  if (m_async_count == 0)
    return true; // We were not interrupted. The process stopped on its own.

  // Older debugserver stubs (before April 2016) can return two
  // stop-reply packets in response to a ^C packet.
  // Additionally, all debugservers still return two stop replies if
  // the inferior stops due to some other reason before the remote
  // stub manages to interrupt it. We need to wait for this
  // additional packet to make sure the packet sequence does not get
  // skewed.
  StringExtractorGDBRemote extra_stop_reply_packet;
  ReadPacket(extra_stop_reply_packet, milliseconds(100), false);

  // Interrupting is typically done using SIGSTOP or SIGINT, so if
  // the process stops with some other signal, we definitely want to
  // stop.
  const uint8_t signo = response.GetHexU8(UINT8_MAX);
  if (signo != signals.GetSignalNumberFromName("SIGSTOP") &&
      signo != signals.GetSignalNumberFromName("SIGINT"))
    return true;

  // We probably only stopped to perform some async processing, so continue
  // after that is done.
  // TODO: This is not 100% correct, as the process may have been stopped with
  // SIGINT or SIGSTOP that was not caused by us (e.g. raise(SIGINT)). This will
  // normally cause a stop, but if it's done concurrently with a async
  // interrupt, that stop will get eaten (llvm.org/pr20231).
  return false;
}
开发者ID:2trill2spill,项目名称:freebsd,代码行数:33,代码来源:GDBRemoteClientBase.cpp


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