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


C++ PDBFile::getNumStreams方法代码示例

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


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

示例1: dumpStreamData

static void dumpStreamData(ScopedPrinter &P, PDBFile &File) {
  uint32_t StreamCount = File.getNumStreams();
  StringRef DumpStreamStr = opts::DumpStreamData;
  uint32_t DumpStreamNum;
  if (DumpStreamStr.getAsInteger(/*Radix=*/0U, DumpStreamNum) ||
      DumpStreamNum >= StreamCount)
    return;

  uint32_t StreamBytesRead = 0;
  uint32_t StreamSize = File.getStreamByteSize(DumpStreamNum);
  auto StreamBlocks = File.getStreamBlockList(DumpStreamNum);

  for (uint32_t StreamBlockAddr : StreamBlocks) {
    uint32_t BytesLeftToReadInStream = StreamSize - StreamBytesRead;
    if (BytesLeftToReadInStream == 0)
      break;

    uint32_t BytesToReadInBlock = std::min(
        BytesLeftToReadInStream, static_cast<uint32_t>(File.getBlockSize()));
    auto StreamBlockData =
        File.getBlockData(StreamBlockAddr, BytesToReadInBlock);

    outs() << StreamBlockData;
    StreamBytesRead += StreamBlockData.size();
  }
}
开发者ID:wgbwgb,项目名称:llvm,代码行数:26,代码来源:llvm-pdbdump.cpp

示例2: dumpStreamSizes

static void dumpStreamSizes(ScopedPrinter &P, PDBFile &File) {
  if (!opts::DumpStreamSizes)
    return;

  ListScope L(P, "StreamSizes");
  uint32_t StreamCount = File.getNumStreams();
  for (uint32_t StreamIdx = 0; StreamIdx < StreamCount; ++StreamIdx) {
    std::string Name("Stream ");
    Name += to_string(StreamIdx);
    P.printNumber(Name, File.getStreamByteSize(StreamIdx));
  }
}
开发者ID:wgbwgb,项目名称:llvm,代码行数:12,代码来源:llvm-pdbdump.cpp

示例3: dumpStreamBlocks

static void dumpStreamBlocks(ScopedPrinter &P, PDBFile &File) {
  if (!opts::DumpStreamBlocks)
    return;

  ListScope L(P, "StreamBlocks");
  uint32_t StreamCount = File.getNumStreams();
  for (uint32_t StreamIdx = 0; StreamIdx < StreamCount; ++StreamIdx) {
    std::string Name("Stream ");
    Name += to_string(StreamIdx);
    auto StreamBlocks = File.getStreamBlockList(StreamIdx);
    P.printList(Name, StreamBlocks);
  }
}
开发者ID:wgbwgb,项目名称:llvm,代码行数:13,代码来源:llvm-pdbdump.cpp

示例4: dumpFileHeaders

static void dumpFileHeaders(ScopedPrinter &P, PDBFile &File) {
  if (!opts::DumpHeaders)
    return;
  DictScope D(P, "FileHeaders");
  P.printNumber("BlockSize", File.getBlockSize());
  P.printNumber("Unknown0", File.getUnknown0());
  P.printNumber("NumBlocks", File.getBlockCount());
  P.printNumber("NumDirectoryBytes", File.getNumDirectoryBytes());
  P.printNumber("Unknown1", File.getUnknown1());
  P.printNumber("BlockMapAddr", File.getBlockMapIndex());
  P.printNumber("NumDirectoryBlocks", File.getNumDirectoryBlocks());
  P.printNumber("BlockMapOffset", File.getBlockMapOffset());

  // The directory is not contiguous.  Instead, the block map contains a
  // contiguous list of block numbers whose contents, when concatenated in
  // order, make up the directory.
  P.printList("DirectoryBlocks", File.getDirectoryBlockArray());
  P.printNumber("NumStreams", File.getNumStreams());
}
开发者ID:wgbwgb,项目名称:llvm,代码行数:19,代码来源:llvm-pdbdump.cpp


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