Movatterモバイル変換


[0]ホーム

URL:


LLVM 20.0.0git
InputFile.cpp
Go to the documentation of this file.
1//===- InputFile.cpp ------------------------------------------ *- C++ --*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9#include "llvm/DebugInfo/PDB/Native/InputFile.h"
10
11#include "llvm/ADT/StringExtras.h"
12#include "llvm/BinaryFormat/Magic.h"
13#include "llvm/DebugInfo/CodeView/CodeView.h"
14#include "llvm/DebugInfo/CodeView/LazyRandomTypeCollection.h"
15#include "llvm/DebugInfo/CodeView/StringsAndChecksums.h"
16#include "llvm/DebugInfo/MSF/MappedBlockStream.h"
17#include "llvm/DebugInfo/PDB/Native/DbiStream.h"
18#include "llvm/DebugInfo/PDB/Native/FormatUtil.h"
19#include "llvm/DebugInfo/PDB/Native/LinePrinter.h"
20#include "llvm/DebugInfo/PDB/Native/NativeSession.h"
21#include "llvm/DebugInfo/PDB/Native/PDBFile.h"
22#include "llvm/DebugInfo/PDB/Native/PDBStringTable.h"
23#include "llvm/DebugInfo/PDB/Native/RawError.h"
24#include "llvm/DebugInfo/PDB/Native/TpiStream.h"
25#include "llvm/DebugInfo/PDB/PDB.h"
26#include "llvm/Object/COFF.h"
27#include "llvm/Support/FileSystem.h"
28#include "llvm/Support/FormatVariadic.h"
29
30using namespacellvm;
31using namespacellvm::codeview;
32using namespacellvm::object;
33using namespacellvm::pdb;
34
35InputFile::InputFile() =default;
36InputFile::~InputFile() =default;
37
38Expected<ModuleDebugStreamRef>
39llvm::pdb::getModuleDebugStream(PDBFile &File,StringRef &ModuleName,
40uint32_t Index) {
41Expected<DbiStream &> DbiOrErr = File.getPDBDbiStream();
42if (!DbiOrErr)
43return DbiOrErr.takeError();
44DbiStream &Dbi = *DbiOrErr;
45constauto &Modules = Dbi.modules();
46if (Index >= Modules.getModuleCount())
47return make_error<RawError>(raw_error_code::index_out_of_bounds,
48"Invalid module index");
49
50auto Modi = Modules.getModuleDescriptor(Index);
51
52ModuleName = Modi.getModuleName();
53
54uint16_t ModiStream = Modi.getModuleStreamIndex();
55if (ModiStream ==kInvalidStreamIndex)
56return make_error<RawError>(raw_error_code::no_stream,
57"Module stream not present");
58
59auto ModStreamData = File.createIndexedStream(ModiStream);
60
61ModuleDebugStreamRef ModS(Modi, std::move(ModStreamData));
62if (autoEC = ModS.reload())
63return make_error<RawError>(raw_error_code::corrupt_file,
64"Invalid module stream");
65
66return std::move(ModS);
67}
68
69Expected<ModuleDebugStreamRef>llvm::pdb::getModuleDebugStream(PDBFile &File,
70uint32_t Index) {
71Expected<DbiStream &> DbiOrErr = File.getPDBDbiStream();
72if (!DbiOrErr)
73return DbiOrErr.takeError();
74DbiStream &Dbi = *DbiOrErr;
75constauto &Modules = Dbi.modules();
76auto Modi = Modules.getModuleDescriptor(Index);
77
78uint16_t ModiStream = Modi.getModuleStreamIndex();
79if (ModiStream ==kInvalidStreamIndex)
80return make_error<RawError>(raw_error_code::no_stream,
81"Module stream not present");
82
83auto ModStreamData = File.createIndexedStream(ModiStream);
84
85ModuleDebugStreamRef ModS(Modi, std::move(ModStreamData));
86if (Error Err = ModS.reload())
87return make_error<RawError>(raw_error_code::corrupt_file,
88"Invalid module stream");
89
90return std::move(ModS);
91}
92
93staticinlineboolisCodeViewDebugSubsection(object::SectionRef Section,
94StringRefName,
95BinaryStreamReader &Reader) {
96if (Expected<StringRef> NameOrErr = Section.getName()) {
97if (*NameOrErr !=Name)
98returnfalse;
99 }else {
100consumeError(NameOrErr.takeError());
101returnfalse;
102 }
103
104Expected<StringRef> ContentsOrErr = Section.getContents();
105if (!ContentsOrErr) {
106consumeError(ContentsOrErr.takeError());
107returnfalse;
108 }
109
110 Reader =BinaryStreamReader(*ContentsOrErr,llvm::endianness::little);
111uint32_t Magic;
112if (Reader.bytesRemaining() <sizeof(uint32_t))
113returnfalse;
114cantFail(Reader.readInteger(Magic));
115if (Magic !=COFF::DEBUG_SECTION_MAGIC)
116returnfalse;
117returntrue;
118}
119
120staticinlineboolisDebugSSection(object::SectionRef Section,
121DebugSubsectionArray &Subsections) {
122BinaryStreamReader Reader;
123if (!isCodeViewDebugSubsection(Section,".debug$S", Reader))
124returnfalse;
125
126cantFail(Reader.readArray(Subsections, Reader.bytesRemaining()));
127returntrue;
128}
129
130staticboolisDebugTSection(SectionRef Section,CVTypeArray &Types) {
131BinaryStreamReader Reader;
132if (!isCodeViewDebugSubsection(Section,".debug$T", Reader) &&
133 !isCodeViewDebugSubsection(Section,".debug$P", Reader))
134returnfalse;
135cantFail(Reader.readArray(Types, Reader.bytesRemaining()));
136returntrue;
137}
138
139static std::stringformatChecksumKind(FileChecksumKindKind) {
140switch (Kind) {
141RETURN_CASE(FileChecksumKind,None,"None");
142RETURN_CASE(FileChecksumKind,MD5,"MD5");
143RETURN_CASE(FileChecksumKind,SHA1,"SHA-1");
144RETURN_CASE(FileChecksumKind,SHA256,"SHA-256");
145 }
146returnformatUnknownEnum(Kind);
147}
148
149template <typename...Args>
150staticvoidformatInternal(LinePrinter &Printer,bool Append, Args &&...args) {
151if (Append)
152Printer.format(std::forward<Args>(args)...);
153else
154Printer.formatLine(std::forward<Args>(args)...);
155}
156
157SymbolGroup::SymbolGroup(InputFile *File,uint32_t GroupIndex) : File(File) {
158if (!File)
159return;
160
161if (File->isPdb())
162 initializeForPdb(GroupIndex);
163else {
164 Name =".debug$S";
165uint32_tI = 0;
166for (constauto &S : File->obj().sections()) {
167DebugSubsectionArray SS;
168if (!isDebugSSection(S, SS))
169continue;
170
171if (!SC.hasChecksums() || !SC.hasStrings())
172 SC.initialize(SS);
173
174if (I == GroupIndex)
175 Subsections = SS;
176
177if (SC.hasChecksums() && SC.hasStrings())
178break;
179 }
180 rebuildChecksumMap();
181 }
182}
183
184StringRefSymbolGroup::name() const{return Name; }
185
186void SymbolGroup::updateDebugS(constcodeview::DebugSubsectionArray &SS) {
187 Subsections = SS;
188}
189
190void SymbolGroup::updatePdbModi(uint32_t Modi) { initializeForPdb(Modi); }
191
192void SymbolGroup::initializeForPdb(uint32_t Modi) {
193assert(File && File->isPdb());
194
195// PDB always uses the same string table, but each module has its own
196// checksums. So we only set the strings if they're not already set.
197if (!SC.hasStrings()) {
198autoStringTable = File->pdb().getStringTable();
199if (StringTable)
200 SC.setStrings(StringTable->getStringTable());
201else
202consumeError(StringTable.takeError());
203 }
204
205 SC.resetChecksums();
206auto MDS =getModuleDebugStream(File->pdb(), Name, Modi);
207if (!MDS) {
208consumeError(MDS.takeError());
209return;
210 }
211
212 DebugStream = std::make_shared<ModuleDebugStreamRef>(std::move(*MDS));
213 Subsections = DebugStream->getSubsectionsArray();
214 SC.initialize(Subsections);
215 rebuildChecksumMap();
216}
217
218void SymbolGroup::rebuildChecksumMap() {
219if (!SC.hasChecksums())
220return;
221
222for (constauto &Entry : SC.checksums()) {
223auto S = SC.strings().getString(Entry.FileNameOffset);
224if (!S)
225continue;
226 ChecksumsByFile[*S] =Entry;
227 }
228}
229
230constModuleDebugStreamRef &SymbolGroup::getPdbModuleStream() const{
231assert(File && File->isPdb() && DebugStream);
232return *DebugStream;
233}
234
235Expected<StringRef>SymbolGroup::getNameFromStringTable(uint32_tOffset) const{
236return SC.strings().getString(Offset);
237}
238
239Expected<StringRef>SymbolGroup::getNameFromChecksums(uint32_tOffset) const{
240StringRef Name;
241if (!SC.hasChecksums()) {
242return std::move(Name);
243 }
244
245auto Iter = SC.checksums().getArray().at(Offset);
246if (Iter == SC.checksums().getArray().end()) {
247return std::move(Name);
248 }
249
250uint32_t FO = Iter->FileNameOffset;
251auto ExpectedFile =getNameFromStringTable(FO);
252if (!ExpectedFile) {
253return std::move(Name);
254 }
255
256return *ExpectedFile;
257}
258
259voidSymbolGroup::formatFromFileName(LinePrinter &Printer,StringRef File,
260bool Append) const{
261auto FC = ChecksumsByFile.find(File);
262if (FC == ChecksumsByFile.end()) {
263formatInternal(Printer, Append,"- (no checksum) {0}", File);
264return;
265 }
266
267formatInternal(Printer, Append,"- ({0}: {1}) {2}",
268formatChecksumKind(FC->getValue().Kind),
269 toHex(FC->getValue().Checksum), File);
270}
271
272voidSymbolGroup::formatFromChecksumsOffset(LinePrinter &Printer,
273uint32_tOffset,
274bool Append) const{
275if (!SC.hasChecksums()) {
276formatInternal(Printer, Append,"(unknown file name offset {0})",Offset);
277return;
278 }
279
280auto Iter = SC.checksums().getArray().at(Offset);
281if (Iter == SC.checksums().getArray().end()) {
282formatInternal(Printer, Append,"(unknown file name offset {0})",Offset);
283return;
284 }
285
286uint32_t FO = Iter->FileNameOffset;
287auto ExpectedFile =getNameFromStringTable(FO);
288if (!ExpectedFile) {
289formatInternal(Printer, Append,"(unknown file name offset {0})",Offset);
290consumeError(ExpectedFile.takeError());
291return;
292 }
293if (Iter->Kind == FileChecksumKind::None) {
294formatInternal(Printer, Append,"{0} (no checksum)", *ExpectedFile);
295 }else {
296formatInternal(Printer, Append,"{0} ({1}: {2})", *ExpectedFile,
297formatChecksumKind(Iter->Kind), toHex(Iter->Checksum));
298 }
299}
300
301Expected<InputFile>InputFile::open(StringRefPath,bool AllowUnknownFile) {
302InputFile IF;
303if (!llvm::sys::fs::exists(Path))
304return make_error<StringError>(formatv("File {0} not found",Path),
305inconvertibleErrorCode());
306
307file_magic Magic;
308if (autoEC =identify_magic(Path, Magic))
309return make_error<StringError>(
310formatv("Unable to identify file type for file {0}",Path),EC);
311
312if (Magic ==file_magic::coff_object) {
313Expected<OwningBinary<Binary>> BinaryOrErr =createBinary(Path);
314if (!BinaryOrErr)
315return BinaryOrErr.takeError();
316
317 IF.CoffObject = std::move(*BinaryOrErr);
318 IF.PdbOrObj = llvm::cast<COFFObjectFile>(IF.CoffObject.getBinary());
319return std::move(IF);
320 }
321
322if (Magic ==file_magic::pdb) {
323 std::unique_ptr<IPDBSession> Session;
324if (auto Err =loadDataForPDB(PDB_ReaderType::Native,Path, Session))
325return std::move(Err);
326
327 IF.PdbSession.reset(static_cast<NativeSession *>(Session.release()));
328 IF.PdbOrObj = &IF.PdbSession->getPDBFile();
329
330return std::move(IF);
331 }
332
333if (!AllowUnknownFile)
334return make_error<StringError>(
335formatv("File {0} is not a supported file type",Path),
336inconvertibleErrorCode());
337
338auto Result =MemoryBuffer::getFile(Path,/*IsText=*/false,
339/*RequiresNullTerminator=*/false);
340if (!Result)
341return make_error<StringError>(
342formatv("File {0} could not be opened",Path), Result.getError());
343
344 IF.UnknownFile = std::move(*Result);
345 IF.PdbOrObj = IF.UnknownFile.get();
346return std::move(IF);
347}
348
349PDBFile &InputFile::pdb() {
350assert(isPdb());
351return *cast<PDBFile *>(PdbOrObj);
352}
353
354constPDBFile &InputFile::pdb() const{
355assert(isPdb());
356return *cast<PDBFile *>(PdbOrObj);
357}
358
359object::COFFObjectFile &InputFile::obj() {
360assert(isObj());
361return *cast<object::COFFObjectFile *>(PdbOrObj);
362}
363
364constobject::COFFObjectFile &InputFile::obj() const{
365assert(isObj());
366return *cast<object::COFFObjectFile *>(PdbOrObj);
367}
368
369MemoryBuffer &InputFile::unknown() {
370assert(isUnknown());
371return *cast<MemoryBuffer *>(PdbOrObj);
372}
373
374constMemoryBuffer &InputFile::unknown() const{
375assert(isUnknown());
376return *cast<MemoryBuffer *>(PdbOrObj);
377}
378
379StringRefInputFile::getFilePath() const{
380if (isPdb())
381returnpdb().getFilePath();
382if (isObj())
383returnobj().getFileName();
384assert(isUnknown());
385returnunknown().getBufferIdentifier();
386}
387
388boolInputFile::hasTypes() const{
389if (isPdb())
390returnpdb().hasPDBTpiStream();
391
392for (constauto &Section :obj().sections()) {
393CVTypeArray Types;
394if (isDebugTSection(Section, Types))
395returntrue;
396 }
397returnfalse;
398}
399
400boolInputFile::hasIds() const{
401if (isObj())
402returnfalse;
403returnpdb().hasPDBIpiStream();
404}
405
406boolInputFile::isPdb() const{return isa<PDBFile *>(PdbOrObj); }
407
408boolInputFile::isObj() const{
409return isa<object::COFFObjectFile *>(PdbOrObj);
410}
411
412boolInputFile::isUnknown() const{return isa<MemoryBuffer *>(PdbOrObj); }
413
414codeview::LazyRandomTypeCollection &
415InputFile::getOrCreateTypeCollection(TypeCollectionKindKind) {
416if (Types &&Kind == kTypes)
417return *Types;
418if (Ids &&Kind == kIds)
419return *Ids;
420
421if (Kind == kIds) {
422assert(isPdb() &&pdb().hasPDBIpiStream());
423 }
424
425// If the collection was already initialized, we should have just returned it
426// in step 1.
427if (isPdb()) {
428 TypeCollectionPtr &Collection = (Kind == kIds) ? Ids : Types;
429auto &Stream =cantFail((Kind == kIds) ?pdb().getPDBIpiStream()
430 :pdb().getPDBTpiStream());
431
432auto &Array = Stream.typeArray();
433uint32_t Count = Stream.getNumTypeRecords();
434auto Offsets = Stream.getTypeIndexOffsets();
435 Collection =
436 std::make_unique<LazyRandomTypeCollection>(Array, Count, Offsets);
437return *Collection;
438 }
439
440assert(isObj());
441assert(Kind == kTypes);
442assert(!Types);
443
444for (constauto &Section :obj().sections()) {
445CVTypeArray Records;
446if (!isDebugTSection(Section, Records))
447continue;
448
449 Types = std::make_unique<LazyRandomTypeCollection>(Records, 100);
450return *Types;
451 }
452
453 Types = std::make_unique<LazyRandomTypeCollection>(100);
454return *Types;
455}
456
457codeview::LazyRandomTypeCollection &InputFile::types() {
458return getOrCreateTypeCollection(kTypes);
459}
460
461codeview::LazyRandomTypeCollection &InputFile::ids() {
462// Object files have only one type stream that contains both types and ids.
463// Similarly, some PDBs don't contain an IPI stream, and for those both types
464// and IDs are in the same stream.
465if (isObj() || !pdb().hasPDBIpiStream())
466returntypes();
467
468return getOrCreateTypeCollection(kIds);
469}
470
471iterator_range<SymbolGroupIterator>InputFile::symbol_groups() {
472return make_range<SymbolGroupIterator>(symbol_groups_begin(),
473symbol_groups_end());
474}
475
476SymbolGroupIteratorInputFile::symbol_groups_begin() {
477returnSymbolGroupIterator(*this);
478}
479
480SymbolGroupIteratorInputFile::symbol_groups_end() {
481returnSymbolGroupIterator();
482}
483
484SymbolGroupIterator::SymbolGroupIterator() :Value(nullptr) {}
485
486SymbolGroupIterator::SymbolGroupIterator(InputFile &File) :Value(&File) {
487if (File.isObj()) {
488 SectionIter = File.obj().section_begin();
489 scanToNextDebugS();
490 }
491}
492
493boolSymbolGroupIterator::operator==(constSymbolGroupIterator &R) const{
494bool E = isEnd();
495bool RE = R.isEnd();
496if (E || RE)
497return E == RE;
498
499if (Value.File != R.Value.File)
500returnfalse;
501return Index == R.Index;
502}
503
504constSymbolGroup &SymbolGroupIterator::operator*() const{
505assert(!isEnd());
506returnValue;
507}
508SymbolGroup &SymbolGroupIterator::operator*() {
509assert(!isEnd());
510returnValue;
511}
512
513SymbolGroupIterator &SymbolGroupIterator::operator++() {
514assert(Value.File && !isEnd());
515 ++Index;
516if (isEnd())
517return *this;
518
519if (Value.File->isPdb()) {
520Value.updatePdbModi(Index);
521return *this;
522 }
523
524 scanToNextDebugS();
525return *this;
526}
527
528void SymbolGroupIterator::scanToNextDebugS() {
529assert(SectionIter);
530autoEnd =Value.File->obj().section_end();
531auto &Iter = *SectionIter;
532assert(!isEnd());
533
534while (++Iter !=End) {
535DebugSubsectionArray SS;
536SectionRef SR = *Iter;
537if (!isDebugSSection(SR, SS))
538continue;
539
540Value.updateDebugS(SS);
541return;
542 }
543}
544
545bool SymbolGroupIterator::isEnd() const{
546if (!Value.File)
547returntrue;
548if (Value.File->isPdb()) {
549DbiStream &Dbi =cantFail(Value.File->pdb().getPDBDbiStream());
550uint32_t Count = Dbi.modules().getModuleCount();
551assert(Index <= Count);
552return Index == Count;
553 }
554
555assert(SectionIter);
556return *SectionIter ==Value.File->obj().section_end();
557}
558
559staticboolisMyCode(constSymbolGroup &Group) {
560if (Group.getFile().isObj())
561returntrue;
562
563StringRefName = Group.name();
564if (Name.starts_with("Import:"))
565returnfalse;
566if (Name.ends_with_insensitive(".dll"))
567returnfalse;
568if (Name.equals_insensitive("* linker *"))
569returnfalse;
570if (Name.starts_with_insensitive("f:\\binaries\\Intermediate\\vctools"))
571returnfalse;
572if (Name.starts_with_insensitive("f:\\dd\\vctools\\crt"))
573returnfalse;
574returntrue;
575}
576
577boolllvm::pdb::shouldDumpSymbolGroup(uint32_tIdx,constSymbolGroup &Group,
578constFilterOptions &Filters) {
579if (Filters.JustMyCode && !isMyCode(Group))
580returnfalse;
581
582// If the arg was not specified on the command line, always dump all modules.
583if (!Filters.DumpModi)
584returntrue;
585
586// Otherwise, only dump if this is the same module specified.
587return (Filters.DumpModi ==Idx);
588}
sections
bbsections Prepares for basic block sections
Definition:BasicBlockSections.cpp:139
CodeView.h
Printer
dxil pretty DXIL Metadata Pretty Printer
Definition:DXILPrettyPrinter.cpp:305
DbiStream.h
Idx
Returns the sub type a function will return at a given Idx Should correspond to the result type of an ExtractValue instruction executed with just that one unsigned Idx
Definition:DeadArgumentElimination.cpp:353
Name
std::string Name
Definition:ELFObjHandler.cpp:77
End
bool End
Definition:ELF_riscv.cpp:480
FileSystem.h
FormatUtil.h
RETURN_CASE
#define RETURN_CASE(Enum, X, Ret)
Definition:FormatUtil.h:33
FormatVariadic.h
isDebugSSection
static bool isDebugSSection(object::SectionRef Section, DebugSubsectionArray &Subsections)
Definition:InputFile.cpp:120
formatInternal
static void formatInternal(LinePrinter &Printer, bool Append, Args &&...args)
Definition:InputFile.cpp:150
isDebugTSection
static bool isDebugTSection(SectionRef Section, CVTypeArray &Types)
Definition:InputFile.cpp:130
isCodeViewDebugSubsection
static bool isCodeViewDebugSubsection(object::SectionRef Section, StringRef Name, BinaryStreamReader &Reader)
Definition:InputFile.cpp:93
formatChecksumKind
static std::string formatChecksumKind(FileChecksumKind Kind)
Definition:InputFile.cpp:139
isMyCode
static bool isMyCode(const SymbolGroup &Group)
Definition:InputFile.cpp:559
InputFile.h
LazyRandomTypeCollection.h
LinePrinter.h
I
#define I(x, y, z)
Definition:MD5.cpp:58
Magic.h
MappedBlockStream.h
args
nvptx lower args
Definition:NVPTXLowerArgs.cpp:199
NativeSession.h
COFF.h
PDBFile.h
PDBStringTable.h
PDB.h
RawError.h
assert
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
StringExtras.h
This file contains some functions that are useful when dealing with strings.
StringsAndChecksums.h
TpiStream.h
llvm::BinaryStreamReader
Provides read only access to a subclass of BinaryStream.
Definition:BinaryStreamReader.h:29
llvm::BinaryStreamReader::readInteger
Error readInteger(T &Dest)
Read an integer of the specified endianness into Dest and update the stream's offset.
Definition:BinaryStreamReader.h:67
llvm::BinaryStreamReader::bytesRemaining
uint64_t bytesRemaining() const
Definition:BinaryStreamReader.h:248
llvm::BinaryStreamReader::readArray
Error readArray(ArrayRef< T > &Array, uint32_t NumElements)
Get a reference to a NumElements element array of objects of type T from the underlying stream as if ...
Definition:BinaryStreamReader.h:178
llvm::Error
Lightweight error class with error context and mandatory checking.
Definition:Error.h:160
llvm::Expected
Tagged union holding either a T or a Error.
Definition:Error.h:481
llvm::Expected::takeError
Error takeError()
Take ownership of the stored error.
Definition:Error.h:608
llvm::MD5
Definition:MD5.h:41
llvm::MemoryBuffer
This interface provides simple read-only access to a block of memory, and provides simple methods for...
Definition:MemoryBuffer.h:51
llvm::MemoryBuffer::getBufferIdentifier
virtual StringRef getBufferIdentifier() const
Return an identifier for this buffer, typically the filename it was read from.
Definition:MemoryBuffer.h:76
llvm::MemoryBuffer::getFile
static ErrorOr< std::unique_ptr< MemoryBuffer > > getFile(const Twine &Filename, bool IsText=false, bool RequiresNullTerminator=true, bool IsVolatile=false, std::optional< Align > Alignment=std::nullopt)
Open the specified file as a MemoryBuffer, returning a new MemoryBuffer if successful,...
Definition:MemoryBuffer.cpp:260
llvm::SHA1
A class that wrap the SHA1 algorithm.
Definition:SHA1.h:26
llvm::SHA256
Definition:SHA256.h:33
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition:StringRef.h:51
llvm::StringTable
A table of densely packed, null-terminated strings indexed by offset.
Definition:StringTable.h:33
llvm::Value
LLVM Value Representation.
Definition:Value.h:74
llvm::VarStreamArray< DebugSubsectionRecord >
llvm::VarStreamArray::at
Iterator at(uint32_t Offset) const
given an offset into the array's underlying stream, return an iterator to the record at that offset.
Definition:BinaryStreamArray.h:134
llvm::VarStreamArray::end
Iterator end() const
Definition:BinaryStreamArray.h:117
llvm::codeview::DebugChecksumsSubsectionRef::getArray
const FileChecksumArray & getArray() const
Definition:DebugChecksumsSubsection.h:71
llvm::codeview::DebugStringTableSubsectionRef::getString
Expected< StringRef > getString(uint32_t Offset) const
Definition:DebugStringTableSubsection.cpp:34
llvm::codeview::LazyRandomTypeCollection
Provides amortized O(1) random access to a CodeView type stream.
Definition:LazyRandomTypeCollection.h:48
llvm::codeview::StringsAndChecksumsRef::setStrings
void setStrings(const DebugStringTableSubsectionRef &Strings)
Definition:StringsAndChecksums.cpp:56
llvm::codeview::StringsAndChecksumsRef::hasStrings
bool hasStrings() const
Definition:StringsAndChecksums.h:69
llvm::codeview::StringsAndChecksumsRef::strings
const DebugStringTableSubsectionRef & strings() const
Definition:StringsAndChecksums.h:66
llvm::codeview::StringsAndChecksumsRef::hasChecksums
bool hasChecksums() const
Definition:StringsAndChecksums.h:70
llvm::codeview::StringsAndChecksumsRef::initialize
void initialize(T &&FragmentRange)
Definition:StringsAndChecksums.h:42
llvm::codeview::StringsAndChecksumsRef::checksums
const DebugChecksumsSubsectionRef & checksums() const
Definition:StringsAndChecksums.h:67
llvm::codeview::StringsAndChecksumsRef::resetChecksums
void resetChecksums()
Definition:StringsAndChecksums.cpp:51
llvm::iterator_range
A range adaptor for a pair of iterators.
Definition:iterator_range.h:42
llvm::object::Binary::getFileName
StringRef getFileName() const
Definition:Binary.cpp:41
llvm::object::COFFObjectFile
Definition:COFF.h:879
llvm::object::SectionRef
This is a value type class that represents a single section in the list of sections in the object fil...
Definition:ObjectFile.h:81
llvm::pdb::DbiModuleList::getModuleDescriptor
DbiModuleDescriptor getModuleDescriptor(uint32_t Modi) const
Definition:DbiModuleList.cpp:255
llvm::pdb::DbiModuleList::getModuleCount
uint32_t getModuleCount() const
Definition:DbiModuleList.cpp:241
llvm::pdb::DbiStream
Definition:DbiStream.h:39
llvm::pdb::DbiStream::modules
const DbiModuleList & modules() const
Definition:DbiStream.cpp:215
llvm::pdb::InputFile
Definition:InputFile.h:39
llvm::pdb::InputFile::hasIds
bool hasIds() const
Definition:InputFile.cpp:400
llvm::pdb::InputFile::unknown
MemoryBuffer & unknown()
Definition:InputFile.cpp:369
llvm::pdb::InputFile::~InputFile
~InputFile()
llvm::pdb::InputFile::symbol_groups_begin
SymbolGroupIterator symbol_groups_begin()
Definition:InputFile.cpp:476
llvm::pdb::InputFile::symbol_groups
iterator_range< SymbolGroupIterator > symbol_groups()
Definition:InputFile.cpp:471
llvm::pdb::InputFile::getFilePath
StringRef getFilePath() const
Definition:InputFile.cpp:379
llvm::pdb::InputFile::types
codeview::LazyRandomTypeCollection & types()
Definition:InputFile.cpp:457
llvm::pdb::InputFile::open
static Expected< InputFile > open(StringRef Path, bool AllowUnknownFile=false)
Definition:InputFile.cpp:301
llvm::pdb::InputFile::symbol_groups_end
SymbolGroupIterator symbol_groups_end()
Definition:InputFile.cpp:480
llvm::pdb::InputFile::isUnknown
bool isUnknown() const
Definition:InputFile.cpp:412
llvm::pdb::InputFile::pdb
PDBFile & pdb()
Definition:InputFile.cpp:349
llvm::pdb::InputFile::hasTypes
bool hasTypes() const
Definition:InputFile.cpp:388
llvm::pdb::InputFile::ids
codeview::LazyRandomTypeCollection & ids()
Definition:InputFile.cpp:461
llvm::pdb::InputFile::obj
object::COFFObjectFile & obj()
Definition:InputFile.cpp:359
llvm::pdb::InputFile::isObj
bool isObj() const
Definition:InputFile.cpp:408
llvm::pdb::InputFile::isPdb
bool isPdb() const
Definition:InputFile.cpp:406
llvm::pdb::LinePrinter
Definition:LinePrinter.h:50
llvm::pdb::ModuleDebugStreamRef
Definition:ModuleDebugStream.h:31
llvm::pdb::ModuleDebugStreamRef::reload
Error reload()
Definition:ModuleDebugStream.cpp:36
llvm::pdb::NativeSession
Definition:NativeSession.h:32
llvm::pdb::PDBFile
Definition:PDBFile.h:40
llvm::pdb::PDBFile::hasPDBTpiStream
bool hasPDBTpiStream() const
Definition:PDBFile.cpp:454
llvm::pdb::PDBFile::hasPDBIpiStream
bool hasPDBIpiStream() const
Definition:PDBFile.cpp:427
llvm::pdb::PDBFile::getFilePath
StringRef getFilePath() const
Definition:PDBFile.cpp:48
llvm::pdb::PDBFile::getStringTable
Expected< PDBStringTable & > getStringTable()
Definition:PDBFile.cpp:366
llvm::pdb::SymbolGroupIterator
Definition:InputFile.h:133
llvm::pdb::SymbolGroupIterator::operator++
SymbolGroupIterator & operator++()
Definition:InputFile.cpp:513
llvm::pdb::SymbolGroupIterator::operator*
const SymbolGroup & operator*() const
Definition:InputFile.cpp:504
llvm::pdb::SymbolGroupIterator::SymbolGroupIterator
SymbolGroupIterator()
Definition:InputFile.cpp:484
llvm::pdb::SymbolGroupIterator::operator==
bool operator==(const SymbolGroupIterator &R) const
Definition:InputFile.cpp:493
llvm::pdb::SymbolGroup
Definition:InputFile.h:90
llvm::pdb::SymbolGroup::getNameFromChecksums
Expected< StringRef > getNameFromChecksums(uint32_t Offset) const
Definition:InputFile.cpp:239
llvm::pdb::SymbolGroup::getNameFromStringTable
Expected< StringRef > getNameFromStringTable(uint32_t Offset) const
Definition:InputFile.cpp:235
llvm::pdb::SymbolGroup::SymbolGroup
SymbolGroup(InputFile *File, uint32_t GroupIndex=0)
Definition:InputFile.cpp:157
llvm::pdb::SymbolGroup::formatFromFileName
void formatFromFileName(LinePrinter &Printer, StringRef File, bool Append=false) const
Definition:InputFile.cpp:259
llvm::pdb::SymbolGroup::getPdbModuleStream
const ModuleDebugStreamRef & getPdbModuleStream() const
Definition:InputFile.cpp:230
llvm::pdb::SymbolGroup::formatFromChecksumsOffset
void formatFromChecksumsOffset(LinePrinter &Printer, uint32_t Offset, bool Append=false) const
Definition:InputFile.cpp:272
llvm::pdb::SymbolGroup::name
StringRef name() const
Definition:InputFile.cpp:184
llvm::pdb::SymbolGroup::getFile
const InputFile & getFile() const
Definition:InputFile.h:112
uint16_t
uint32_t
llvm::AMDGPU::HSAMD::Kernel::Key::Args
constexpr char Args[]
Key for Kernel::Metadata::mArgs.
Definition:AMDGPUMetadata.h:395
llvm::COFF::DEBUG_SECTION_MAGIC
@ DEBUG_SECTION_MAGIC
Definition:COFF.h:821
llvm::COFF::Entry
@ Entry
Definition:COFF.h:844
llvm::codeview
Definition:AppendingTypeTableBuilder.h:22
llvm::codeview::CompileSym2Flags::EC
@ EC
llvm::codeview::FileChecksumKind
FileChecksumKind
Definition:CodeView.h:576
llvm::object
Definition:DWARFDebugLoc.h:24
llvm::object::Kind
Kind
Definition:COFFModuleDefinition.cpp:31
llvm::object::createBinary
Expected< std::unique_ptr< Binary > > createBinary(MemoryBufferRef Source, LLVMContext *Context=nullptr, bool InitContent=true)
Create a Binary from Source, autodetecting the file type.
Definition:Binary.cpp:45
llvm::pdb
Definition:LVCodeViewReader.h:44
llvm::pdb::shouldDumpSymbolGroup
bool shouldDumpSymbolGroup(uint32_t Idx, const SymbolGroup &Group, const FilterOptions &Filters)
Definition:InputFile.cpp:577
llvm::pdb::kInvalidStreamIndex
const uint16_t kInvalidStreamIndex
Definition:RawConstants.h:19
llvm::pdb::formatUnknownEnum
std::string formatUnknownEnum(T Value)
Definition:FormatUtil.h:37
llvm::pdb::getModuleDebugStream
Expected< ModuleDebugStreamRef > getModuleDebugStream(PDBFile &File, StringRef &ModuleName, uint32_t Index)
Definition:InputFile.cpp:39
llvm::pdb::PDB_ReaderType::Native
@ Native
llvm::pdb::PDB_ColorItem::Path
@ Path
llvm::pdb::PDB_ColorItem::Offset
@ Offset
llvm::pdb::loadDataForPDB
Error loadDataForPDB(PDB_ReaderType Type, StringRef Path, std::unique_ptr< IPDBSession > &Session)
Definition:PDB.cpp:22
llvm::sys::fs::exists
bool exists(const basic_file_status &status)
Does file exist?
Definition:Path.cpp:1077
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition:AddressRanges.h:18
llvm::identify_magic
file_magic identify_magic(StringRef magic)
Identify the type of a binary file based on how magical it is.
Definition:Magic.cpp:33
llvm::inconvertibleErrorCode
std::error_code inconvertibleErrorCode()
The value returned by this function can be returned from convertToErrorCode for Error values where no...
Definition:Error.cpp:98
llvm::formatv
auto formatv(bool Validate, const char *Fmt, Ts &&...Vals)
Definition:FormatVariadic.h:252
llvm::None
@ None
Definition:CodeGenData.h:106
llvm::cantFail
void cantFail(Error Err, const char *Msg=nullptr)
Report a fatal error if Err is a failure value.
Definition:Error.h:756
llvm::endianness::little
@ little
llvm::consumeError
void consumeError(Error Err)
Consume a Error without doing anything.
Definition:Error.h:1069
FilterOptions
Definition:LinePrinter.h:24
FilterOptions::DumpModi
std::optional< uint32_t > DumpModi
Definition:LinePrinter.h:33
FilterOptions::JustMyCode
bool JustMyCode
Definition:LinePrinter.h:37
ModuleName
Definition:ItaniumDemangle.h:1097
llvm::file_magic
file_magic - An "enum class" enumeration of file types based on magic (the first N bytes of the file)...
Definition:Magic.h:20
llvm::file_magic::pdb
@ pdb
Windows PDB debug info file.
Definition:Magic.h:54
llvm::file_magic::coff_object
@ coff_object
COFF object file.
Definition:Magic.h:47

Generated on Fri Jul 18 2025 11:16:53 for LLVM by doxygen 1.9.6
[8]ページ先頭

©2009-2025 Movatter.jp