mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-04-10 11:41:37 +00:00

Previously parsing of these were all grouped together into a single master class that could parse any type of debug info fragment. With writing forthcoming, the complexity of each individual fragment is enough to warrant them having their own classes so that reading and writing of each fragment type can be grouped together, but isolated from the code for reading and writing other fragment types. In doing so, I found a place where parsing code was duplicated for the FileChecksums fragment, across llvm-readobj and the CodeView library, and one of the implementations had a bug. Now that the codepaths are merged, the bug is resolved. Differential Revision: https://reviews.llvm.org/D32547 llvm-svn: 301557
67 lines
1.7 KiB
C++
67 lines
1.7 KiB
C++
//===- ModuleDebugStream.h - PDB Module Info Stream Access ----------------===//
|
|
//
|
|
// The LLVM Compiler Infrastructure
|
|
//
|
|
// This file is distributed under the University of Illinois Open Source
|
|
// License. See LICENSE.TXT for details.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#ifndef LLVM_DEBUGINFO_PDB_RAW_MODULEDEBUGSTREAM_H
|
|
#define LLVM_DEBUGINFO_PDB_RAW_MODULEDEBUGSTREAM_H
|
|
|
|
#include "llvm/ADT/iterator_range.h"
|
|
#include "llvm/DebugInfo/CodeView/CVRecord.h"
|
|
#include "llvm/DebugInfo/CodeView/ModuleDebugFragmentRecord.h"
|
|
#include "llvm/DebugInfo/CodeView/SymbolRecord.h"
|
|
#include "llvm/DebugInfo/MSF/MappedBlockStream.h"
|
|
#include "llvm/Support/BinaryStreamArray.h"
|
|
#include "llvm/Support/BinaryStreamRef.h"
|
|
#include "llvm/Support/Error.h"
|
|
|
|
namespace llvm {
|
|
namespace pdb {
|
|
class PDBFile;
|
|
class DbiModuleDescriptor;
|
|
|
|
class ModuleDebugStream {
|
|
typedef codeview::ModuleDebugFragmentArray::Iterator
|
|
LinesAndChecksumsIterator;
|
|
|
|
public:
|
|
ModuleDebugStream(const DbiModuleDescriptor &Module,
|
|
std::unique_ptr<msf::MappedBlockStream> Stream);
|
|
~ModuleDebugStream();
|
|
|
|
Error reload();
|
|
|
|
uint32_t signature() const { return Signature; }
|
|
|
|
iterator_range<codeview::CVSymbolArray::Iterator>
|
|
symbols(bool *HadError) const;
|
|
|
|
llvm::iterator_range<LinesAndChecksumsIterator> linesAndChecksums() const;
|
|
|
|
bool hasLineInfo() const;
|
|
|
|
Error commit();
|
|
|
|
private:
|
|
const DbiModuleDescriptor &Mod;
|
|
|
|
uint32_t Signature;
|
|
|
|
std::unique_ptr<msf::MappedBlockStream> Stream;
|
|
|
|
codeview::CVSymbolArray SymbolsSubstream;
|
|
BinaryStreamRef LinesSubstream;
|
|
BinaryStreamRef C13LinesSubstream;
|
|
BinaryStreamRef GlobalRefsSubstream;
|
|
|
|
codeview::ModuleDebugFragmentArray LinesAndChecksums;
|
|
};
|
|
}
|
|
}
|
|
|
|
#endif
|