1 //===- NativeRawSymbol.cpp - Native implementation of IPDBRawSymbol -------===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #include "llvm/DebugInfo/PDB/Native/NativeRawSymbol.h"
11 #include "llvm/DebugInfo/PDB/IPDBLineNumber.h"
12 #include "llvm/DebugInfo/PDB/Native/NativeSession.h"
13 #include "llvm/DebugInfo/PDB/PDBSymbolTypeBuiltin.h"
14 #include "llvm/Support/FormatVariadic.h"
17 using namespace llvm::pdb;
19 NativeRawSymbol::NativeRawSymbol(NativeSession &PDBSession, PDB_SymType Tag,
21 : Session(PDBSession), Tag(Tag), SymbolId(SymbolId) {}
23 void NativeRawSymbol::dump(raw_ostream &OS, int Indent,
24 PdbSymbolIdField ShowIdFields,
25 PdbSymbolIdField RecurseIdFields) const {
26 dumpSymbolIdField(OS, "symIndexId", SymbolId, Indent, Session,
27 PdbSymbolIdField::SymIndexId, ShowIdFields,
29 dumpSymbolField(OS, "symTag", Tag, Indent);
32 std::unique_ptr<IPDBEnumSymbols>
33 NativeRawSymbol::findChildren(PDB_SymType Type) const {
34 return llvm::make_unique<NullEnumerator<PDBSymbol>>();
37 std::unique_ptr<IPDBEnumSymbols>
38 NativeRawSymbol::findChildren(PDB_SymType Type, StringRef Name,
39 PDB_NameSearchFlags Flags) const {
40 return llvm::make_unique<NullEnumerator<PDBSymbol>>();
43 std::unique_ptr<IPDBEnumSymbols>
44 NativeRawSymbol::findChildrenByAddr(PDB_SymType Type, StringRef Name,
45 PDB_NameSearchFlags Flags, uint32_t Section, uint32_t Offset) const {
46 return llvm::make_unique<NullEnumerator<PDBSymbol>>();
49 std::unique_ptr<IPDBEnumSymbols>
50 NativeRawSymbol::findChildrenByVA(PDB_SymType Type, StringRef Name,
51 PDB_NameSearchFlags Flags, uint64_t VA) const {
52 return llvm::make_unique<NullEnumerator<PDBSymbol>>();
55 std::unique_ptr<IPDBEnumSymbols>
56 NativeRawSymbol::findChildrenByRVA(PDB_SymType Type, StringRef Name,
57 PDB_NameSearchFlags Flags, uint32_t RVA) const {
58 return llvm::make_unique<NullEnumerator<PDBSymbol>>();
61 std::unique_ptr<IPDBEnumSymbols>
62 NativeRawSymbol::findInlineFramesByAddr(uint32_t Section,
63 uint32_t Offset) const {
64 return llvm::make_unique<NullEnumerator<PDBSymbol>>();
67 std::unique_ptr<IPDBEnumSymbols>
68 NativeRawSymbol::findInlineFramesByRVA(uint32_t RVA) const {
69 return llvm::make_unique<NullEnumerator<PDBSymbol>>();
72 std::unique_ptr<IPDBEnumSymbols>
73 NativeRawSymbol::findInlineFramesByVA(uint64_t VA) const {
74 return llvm::make_unique<NullEnumerator<PDBSymbol>>();
77 std::unique_ptr<IPDBEnumLineNumbers>
78 NativeRawSymbol::findInlineeLines() const {
79 return llvm::make_unique<NullEnumerator<IPDBLineNumber>>();
82 std::unique_ptr<IPDBEnumLineNumbers>
83 NativeRawSymbol::findInlineeLinesByAddr(uint32_t Section, uint32_t Offset,
84 uint32_t Length) const {
85 return llvm::make_unique<NullEnumerator<IPDBLineNumber>>();
88 std::unique_ptr<IPDBEnumLineNumbers>
89 NativeRawSymbol::findInlineeLinesByRVA(uint32_t RVA, uint32_t Length) const {
90 return llvm::make_unique<NullEnumerator<IPDBLineNumber>>();
93 std::unique_ptr<IPDBEnumLineNumbers>
94 NativeRawSymbol::findInlineeLinesByVA(uint64_t VA, uint32_t Length) const {
95 return llvm::make_unique<NullEnumerator<IPDBLineNumber>>();
98 void NativeRawSymbol::getDataBytes(SmallVector<uint8_t, 32> &bytes) const {
102 PDB_MemberAccess NativeRawSymbol::getAccess() const {
103 return PDB_MemberAccess::Private;
106 uint32_t NativeRawSymbol::getAddressOffset() const {
110 uint32_t NativeRawSymbol::getAddressSection() const {
114 uint32_t NativeRawSymbol::getAge() const {
118 SymIndexId NativeRawSymbol::getArrayIndexTypeId() const { return 0; }
120 void NativeRawSymbol::getBackEndVersion(VersionInfo &Version) const {
127 uint32_t NativeRawSymbol::getBaseDataOffset() const {
131 uint32_t NativeRawSymbol::getBaseDataSlot() const {
135 SymIndexId NativeRawSymbol::getBaseSymbolId() const { return 0; }
137 PDB_BuiltinType NativeRawSymbol::getBuiltinType() const {
138 return PDB_BuiltinType::None;
141 uint32_t NativeRawSymbol::getBitPosition() const {
145 PDB_CallingConv NativeRawSymbol::getCallingConvention() const {
146 return PDB_CallingConv::FarStdCall;
149 SymIndexId NativeRawSymbol::getClassParentId() const { return 0; }
151 std::string NativeRawSymbol::getCompilerName() const {
155 uint32_t NativeRawSymbol::getCount() const {
159 uint32_t NativeRawSymbol::getCountLiveRanges() const {
163 void NativeRawSymbol::getFrontEndVersion(VersionInfo &Version) const {
170 PDB_Lang NativeRawSymbol::getLanguage() const {
171 return PDB_Lang::Cobol;
174 SymIndexId NativeRawSymbol::getLexicalParentId() const { return 0; }
176 std::string NativeRawSymbol::getLibraryName() const {
180 uint32_t NativeRawSymbol::getLiveRangeStartAddressOffset() const {
184 uint32_t NativeRawSymbol::getLiveRangeStartAddressSection() const {
188 uint32_t NativeRawSymbol::getLiveRangeStartRelativeVirtualAddress() const {
192 codeview::RegisterId NativeRawSymbol::getLocalBasePointerRegisterId() const {
193 return codeview::RegisterId::EAX;
196 SymIndexId NativeRawSymbol::getLowerBoundId() const { return 0; }
198 uint32_t NativeRawSymbol::getMemorySpaceKind() const {
202 std::string NativeRawSymbol::getName() const {
206 uint32_t NativeRawSymbol::getNumberOfAcceleratorPointerTags() const {
210 uint32_t NativeRawSymbol::getNumberOfColumns() const {
214 uint32_t NativeRawSymbol::getNumberOfModifiers() const {
218 uint32_t NativeRawSymbol::getNumberOfRegisterIndices() const {
222 uint32_t NativeRawSymbol::getNumberOfRows() const {
226 std::string NativeRawSymbol::getObjectFileName() const {
230 uint32_t NativeRawSymbol::getOemId() const {
234 SymIndexId NativeRawSymbol::getOemSymbolId() const { return 0; }
236 uint32_t NativeRawSymbol::getOffsetInUdt() const {
240 PDB_Cpu NativeRawSymbol::getPlatform() const {
241 return PDB_Cpu::Intel8080;
244 uint32_t NativeRawSymbol::getRank() const {
248 codeview::RegisterId NativeRawSymbol::getRegisterId() const {
249 return codeview::RegisterId::EAX;
252 uint32_t NativeRawSymbol::getRegisterType() const {
256 uint32_t NativeRawSymbol::getRelativeVirtualAddress() const {
260 uint32_t NativeRawSymbol::getSamplerSlot() const {
264 uint32_t NativeRawSymbol::getSignature() const {
268 uint32_t NativeRawSymbol::getSizeInUdt() const {
272 uint32_t NativeRawSymbol::getSlot() const {
276 std::string NativeRawSymbol::getSourceFileName() const {
280 std::unique_ptr<IPDBLineNumber>
281 NativeRawSymbol::getSrcLineOnTypeDefn() const {
285 uint32_t NativeRawSymbol::getStride() const {
289 SymIndexId NativeRawSymbol::getSubTypeId() const { return 0; }
291 std::string NativeRawSymbol::getSymbolsFileName() const { return {}; }
293 SymIndexId NativeRawSymbol::getSymIndexId() const { return SymbolId; }
295 uint32_t NativeRawSymbol::getTargetOffset() const {
299 uint32_t NativeRawSymbol::getTargetRelativeVirtualAddress() const {
303 uint64_t NativeRawSymbol::getTargetVirtualAddress() const {
307 uint32_t NativeRawSymbol::getTargetSection() const {
311 uint32_t NativeRawSymbol::getTextureSlot() const {
315 uint32_t NativeRawSymbol::getTimeStamp() const {
319 uint32_t NativeRawSymbol::getToken() const {
323 SymIndexId NativeRawSymbol::getTypeId() const { return 0; }
325 uint32_t NativeRawSymbol::getUavSlot() const {
329 std::string NativeRawSymbol::getUndecoratedName() const {
333 std::string NativeRawSymbol::getUndecoratedNameEx(
334 PDB_UndnameFlags Flags) const {
338 SymIndexId NativeRawSymbol::getUnmodifiedTypeId() const { return 0; }
340 SymIndexId NativeRawSymbol::getUpperBoundId() const { return 0; }
342 Variant NativeRawSymbol::getValue() const {
346 uint32_t NativeRawSymbol::getVirtualBaseDispIndex() const {
350 uint32_t NativeRawSymbol::getVirtualBaseOffset() const {
354 SymIndexId NativeRawSymbol::getVirtualTableShapeId() const { return 0; }
356 std::unique_ptr<PDBSymbolTypeBuiltin>
357 NativeRawSymbol::getVirtualBaseTableType() const {
361 PDB_DataKind NativeRawSymbol::getDataKind() const {
362 return PDB_DataKind::Unknown;
365 PDB_SymType NativeRawSymbol::getSymTag() const { return Tag; }
367 codeview::GUID NativeRawSymbol::getGuid() const { return codeview::GUID{{0}}; }
369 int32_t NativeRawSymbol::getOffset() const {
373 int32_t NativeRawSymbol::getThisAdjust() const {
377 int32_t NativeRawSymbol::getVirtualBasePointerOffset() const {
381 PDB_LocType NativeRawSymbol::getLocationType() const {
382 return PDB_LocType::Null;
385 PDB_Machine NativeRawSymbol::getMachineType() const {
386 return PDB_Machine::Invalid;
389 codeview::ThunkOrdinal NativeRawSymbol::getThunkOrdinal() const {
390 return codeview::ThunkOrdinal::Standard;
393 uint64_t NativeRawSymbol::getLength() const {
397 uint64_t NativeRawSymbol::getLiveRangeLength() const {
401 uint64_t NativeRawSymbol::getVirtualAddress() const {
405 PDB_UdtType NativeRawSymbol::getUdtKind() const {
406 return PDB_UdtType::Struct;
409 bool NativeRawSymbol::hasConstructor() const {
413 bool NativeRawSymbol::hasCustomCallingConvention() const {
417 bool NativeRawSymbol::hasFarReturn() const {
421 bool NativeRawSymbol::isCode() const {
425 bool NativeRawSymbol::isCompilerGenerated() const {
429 bool NativeRawSymbol::isConstType() const {
433 bool NativeRawSymbol::isEditAndContinueEnabled() const {
437 bool NativeRawSymbol::isFunction() const {
441 bool NativeRawSymbol::getAddressTaken() const {
445 bool NativeRawSymbol::getNoStackOrdering() const {
449 bool NativeRawSymbol::hasAlloca() const {
453 bool NativeRawSymbol::hasAssignmentOperator() const {
457 bool NativeRawSymbol::hasCTypes() const {
461 bool NativeRawSymbol::hasCastOperator() const {
465 bool NativeRawSymbol::hasDebugInfo() const {
469 bool NativeRawSymbol::hasEH() const {
473 bool NativeRawSymbol::hasEHa() const {
477 bool NativeRawSymbol::hasInlAsm() const {
481 bool NativeRawSymbol::hasInlineAttribute() const {
485 bool NativeRawSymbol::hasInterruptReturn() const {
489 bool NativeRawSymbol::hasFramePointer() const {
493 bool NativeRawSymbol::hasLongJump() const {
497 bool NativeRawSymbol::hasManagedCode() const {
501 bool NativeRawSymbol::hasNestedTypes() const {
505 bool NativeRawSymbol::hasNoInlineAttribute() const {
509 bool NativeRawSymbol::hasNoReturnAttribute() const {
513 bool NativeRawSymbol::hasOptimizedCodeDebugInfo() const {
517 bool NativeRawSymbol::hasOverloadedOperator() const {
521 bool NativeRawSymbol::hasSEH() const {
525 bool NativeRawSymbol::hasSecurityChecks() const {
529 bool NativeRawSymbol::hasSetJump() const {
533 bool NativeRawSymbol::hasStrictGSCheck() const {
537 bool NativeRawSymbol::isAcceleratorGroupSharedLocal() const {
541 bool NativeRawSymbol::isAcceleratorPointerTagLiveRange() const {
545 bool NativeRawSymbol::isAcceleratorStubFunction() const {
549 bool NativeRawSymbol::isAggregated() const {
553 bool NativeRawSymbol::isIntroVirtualFunction() const {
557 bool NativeRawSymbol::isCVTCIL() const {
561 bool NativeRawSymbol::isConstructorVirtualBase() const {
565 bool NativeRawSymbol::isCxxReturnUdt() const {
569 bool NativeRawSymbol::isDataAligned() const {
573 bool NativeRawSymbol::isHLSLData() const {
577 bool NativeRawSymbol::isHotpatchable() const {
581 bool NativeRawSymbol::isIndirectVirtualBaseClass() const {
585 bool NativeRawSymbol::isInterfaceUdt() const {
589 bool NativeRawSymbol::isIntrinsic() const {
593 bool NativeRawSymbol::isLTCG() const {
597 bool NativeRawSymbol::isLocationControlFlowDependent() const {
601 bool NativeRawSymbol::isMSILNetmodule() const {
605 bool NativeRawSymbol::isMatrixRowMajor() const {
609 bool NativeRawSymbol::isManagedCode() const {
613 bool NativeRawSymbol::isMSILCode() const {
617 bool NativeRawSymbol::isMultipleInheritance() const {
621 bool NativeRawSymbol::isNaked() const {
625 bool NativeRawSymbol::isNested() const {
629 bool NativeRawSymbol::isOptimizedAway() const {
633 bool NativeRawSymbol::isPacked() const {
637 bool NativeRawSymbol::isPointerBasedOnSymbolValue() const {
641 bool NativeRawSymbol::isPointerToDataMember() const {
645 bool NativeRawSymbol::isPointerToMemberFunction() const {
649 bool NativeRawSymbol::isPureVirtual() const {
653 bool NativeRawSymbol::isRValueReference() const {
657 bool NativeRawSymbol::isRefUdt() const {
661 bool NativeRawSymbol::isReference() const {
665 bool NativeRawSymbol::isRestrictedType() const {
669 bool NativeRawSymbol::isReturnValue() const {
673 bool NativeRawSymbol::isSafeBuffers() const {
677 bool NativeRawSymbol::isScoped() const {
681 bool NativeRawSymbol::isSdl() const {
685 bool NativeRawSymbol::isSingleInheritance() const {
689 bool NativeRawSymbol::isSplitted() const {
693 bool NativeRawSymbol::isStatic() const {
697 bool NativeRawSymbol::hasPrivateSymbols() const {
701 bool NativeRawSymbol::isUnalignedType() const {
705 bool NativeRawSymbol::isUnreached() const {
709 bool NativeRawSymbol::isValueUdt() const {
713 bool NativeRawSymbol::isVirtual() const {
717 bool NativeRawSymbol::isVirtualBaseClass() const {
721 bool NativeRawSymbol::isVirtualInheritance() const {
725 bool NativeRawSymbol::isVolatileType() const {
729 bool NativeRawSymbol::wasInlined() const {
733 std::string NativeRawSymbol::getUnused() const {