1 //===- NativeRawSymbol.cpp - Native implementation of IPDBRawSymbol -------===//
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
7 //===----------------------------------------------------------------------===//
9 #include "llvm/DebugInfo/PDB/Native/NativeRawSymbol.h"
10 #include "llvm/DebugInfo/PDB/IPDBLineNumber.h"
11 #include "llvm/DebugInfo/PDB/Native/NativeSession.h"
12 #include "llvm/DebugInfo/PDB/PDBSymbolTypeBuiltin.h"
13 #include "llvm/Support/FormatVariadic.h"
16 using namespace llvm::pdb
;
18 NativeRawSymbol::NativeRawSymbol(NativeSession
&PDBSession
, PDB_SymType Tag
,
20 : Session(PDBSession
), Tag(Tag
), SymbolId(SymbolId
) {}
22 void NativeRawSymbol::dump(raw_ostream
&OS
, int Indent
,
23 PdbSymbolIdField ShowIdFields
,
24 PdbSymbolIdField RecurseIdFields
) const {
25 dumpSymbolIdField(OS
, "symIndexId", SymbolId
, Indent
, Session
,
26 PdbSymbolIdField::SymIndexId
, ShowIdFields
,
28 dumpSymbolField(OS
, "symTag", Tag
, Indent
);
31 std::unique_ptr
<IPDBEnumSymbols
>
32 NativeRawSymbol::findChildren(PDB_SymType Type
) const {
33 return std::make_unique
<NullEnumerator
<PDBSymbol
>>();
36 std::unique_ptr
<IPDBEnumSymbols
>
37 NativeRawSymbol::findChildren(PDB_SymType Type
, StringRef Name
,
38 PDB_NameSearchFlags Flags
) const {
39 return std::make_unique
<NullEnumerator
<PDBSymbol
>>();
42 std::unique_ptr
<IPDBEnumSymbols
>
43 NativeRawSymbol::findChildrenByAddr(PDB_SymType Type
, StringRef Name
,
44 PDB_NameSearchFlags Flags
, uint32_t Section
, uint32_t Offset
) const {
45 return std::make_unique
<NullEnumerator
<PDBSymbol
>>();
48 std::unique_ptr
<IPDBEnumSymbols
>
49 NativeRawSymbol::findChildrenByVA(PDB_SymType Type
, StringRef Name
,
50 PDB_NameSearchFlags Flags
, uint64_t VA
) const {
51 return std::make_unique
<NullEnumerator
<PDBSymbol
>>();
54 std::unique_ptr
<IPDBEnumSymbols
>
55 NativeRawSymbol::findChildrenByRVA(PDB_SymType Type
, StringRef Name
,
56 PDB_NameSearchFlags Flags
, uint32_t RVA
) const {
57 return std::make_unique
<NullEnumerator
<PDBSymbol
>>();
60 std::unique_ptr
<IPDBEnumSymbols
>
61 NativeRawSymbol::findInlineFramesByAddr(uint32_t Section
,
62 uint32_t Offset
) const {
63 return std::make_unique
<NullEnumerator
<PDBSymbol
>>();
66 std::unique_ptr
<IPDBEnumSymbols
>
67 NativeRawSymbol::findInlineFramesByRVA(uint32_t RVA
) const {
68 return std::make_unique
<NullEnumerator
<PDBSymbol
>>();
71 std::unique_ptr
<IPDBEnumSymbols
>
72 NativeRawSymbol::findInlineFramesByVA(uint64_t VA
) const {
73 return std::make_unique
<NullEnumerator
<PDBSymbol
>>();
76 std::unique_ptr
<IPDBEnumLineNumbers
>
77 NativeRawSymbol::findInlineeLines() const {
78 return std::make_unique
<NullEnumerator
<IPDBLineNumber
>>();
81 std::unique_ptr
<IPDBEnumLineNumbers
>
82 NativeRawSymbol::findInlineeLinesByAddr(uint32_t Section
, uint32_t Offset
,
83 uint32_t Length
) const {
84 return std::make_unique
<NullEnumerator
<IPDBLineNumber
>>();
87 std::unique_ptr
<IPDBEnumLineNumbers
>
88 NativeRawSymbol::findInlineeLinesByRVA(uint32_t RVA
, uint32_t Length
) const {
89 return std::make_unique
<NullEnumerator
<IPDBLineNumber
>>();
92 std::unique_ptr
<IPDBEnumLineNumbers
>
93 NativeRawSymbol::findInlineeLinesByVA(uint64_t VA
, uint32_t Length
) const {
94 return std::make_unique
<NullEnumerator
<IPDBLineNumber
>>();
97 void NativeRawSymbol::getDataBytes(SmallVector
<uint8_t, 32> &bytes
) const {
101 PDB_MemberAccess
NativeRawSymbol::getAccess() const {
102 return PDB_MemberAccess::Private
;
105 uint32_t NativeRawSymbol::getAddressOffset() const {
109 uint32_t NativeRawSymbol::getAddressSection() const {
113 uint32_t NativeRawSymbol::getAge() const {
117 SymIndexId
NativeRawSymbol::getArrayIndexTypeId() const { return 0; }
119 void NativeRawSymbol::getBackEndVersion(VersionInfo
&Version
) const {
126 uint32_t NativeRawSymbol::getBaseDataOffset() const {
130 uint32_t NativeRawSymbol::getBaseDataSlot() const {
134 SymIndexId
NativeRawSymbol::getBaseSymbolId() const { return 0; }
136 PDB_BuiltinType
NativeRawSymbol::getBuiltinType() const {
137 return PDB_BuiltinType::None
;
140 uint32_t NativeRawSymbol::getBitPosition() const {
144 PDB_CallingConv
NativeRawSymbol::getCallingConvention() const {
145 return PDB_CallingConv::FarStdCall
;
148 SymIndexId
NativeRawSymbol::getClassParentId() const { return 0; }
150 std::string
NativeRawSymbol::getCompilerName() const {
154 uint32_t NativeRawSymbol::getCount() const {
158 uint32_t NativeRawSymbol::getCountLiveRanges() const {
162 void NativeRawSymbol::getFrontEndVersion(VersionInfo
&Version
) const {
169 PDB_Lang
NativeRawSymbol::getLanguage() const {
170 return PDB_Lang::Cobol
;
173 SymIndexId
NativeRawSymbol::getLexicalParentId() const { return 0; }
175 std::string
NativeRawSymbol::getLibraryName() const {
179 uint32_t NativeRawSymbol::getLiveRangeStartAddressOffset() const {
183 uint32_t NativeRawSymbol::getLiveRangeStartAddressSection() const {
187 uint32_t NativeRawSymbol::getLiveRangeStartRelativeVirtualAddress() const {
191 codeview::RegisterId
NativeRawSymbol::getLocalBasePointerRegisterId() const {
192 return codeview::RegisterId::EAX
;
195 SymIndexId
NativeRawSymbol::getLowerBoundId() const { return 0; }
197 uint32_t NativeRawSymbol::getMemorySpaceKind() const {
201 std::string
NativeRawSymbol::getName() const {
205 uint32_t NativeRawSymbol::getNumberOfAcceleratorPointerTags() const {
209 uint32_t NativeRawSymbol::getNumberOfColumns() const {
213 uint32_t NativeRawSymbol::getNumberOfModifiers() const {
217 uint32_t NativeRawSymbol::getNumberOfRegisterIndices() const {
221 uint32_t NativeRawSymbol::getNumberOfRows() const {
225 std::string
NativeRawSymbol::getObjectFileName() const {
229 uint32_t NativeRawSymbol::getOemId() const {
233 SymIndexId
NativeRawSymbol::getOemSymbolId() const { return 0; }
235 uint32_t NativeRawSymbol::getOffsetInUdt() const {
239 PDB_Cpu
NativeRawSymbol::getPlatform() const {
240 return PDB_Cpu::Intel8080
;
243 uint32_t NativeRawSymbol::getRank() const {
247 codeview::RegisterId
NativeRawSymbol::getRegisterId() const {
248 return codeview::RegisterId::EAX
;
251 uint32_t NativeRawSymbol::getRegisterType() const {
255 uint32_t NativeRawSymbol::getRelativeVirtualAddress() const {
259 uint32_t NativeRawSymbol::getSamplerSlot() const {
263 uint32_t NativeRawSymbol::getSignature() const {
267 uint32_t NativeRawSymbol::getSizeInUdt() const {
271 uint32_t NativeRawSymbol::getSlot() const {
275 std::string
NativeRawSymbol::getSourceFileName() const {
279 std::unique_ptr
<IPDBLineNumber
>
280 NativeRawSymbol::getSrcLineOnTypeDefn() const {
284 uint32_t NativeRawSymbol::getStride() const {
288 SymIndexId
NativeRawSymbol::getSubTypeId() const { return 0; }
290 std::string
NativeRawSymbol::getSymbolsFileName() const { return {}; }
292 SymIndexId
NativeRawSymbol::getSymIndexId() const { return SymbolId
; }
294 uint32_t NativeRawSymbol::getTargetOffset() const {
298 uint32_t NativeRawSymbol::getTargetRelativeVirtualAddress() const {
302 uint64_t NativeRawSymbol::getTargetVirtualAddress() const {
306 uint32_t NativeRawSymbol::getTargetSection() const {
310 uint32_t NativeRawSymbol::getTextureSlot() const {
314 uint32_t NativeRawSymbol::getTimeStamp() const {
318 uint32_t NativeRawSymbol::getToken() const {
322 SymIndexId
NativeRawSymbol::getTypeId() const { return 0; }
324 uint32_t NativeRawSymbol::getUavSlot() const {
328 std::string
NativeRawSymbol::getUndecoratedName() const {
332 std::string
NativeRawSymbol::getUndecoratedNameEx(
333 PDB_UndnameFlags Flags
) const {
337 SymIndexId
NativeRawSymbol::getUnmodifiedTypeId() const { return 0; }
339 SymIndexId
NativeRawSymbol::getUpperBoundId() const { return 0; }
341 Variant
NativeRawSymbol::getValue() const {
345 uint32_t NativeRawSymbol::getVirtualBaseDispIndex() const {
349 uint32_t NativeRawSymbol::getVirtualBaseOffset() const {
353 SymIndexId
NativeRawSymbol::getVirtualTableShapeId() const { return 0; }
355 std::unique_ptr
<PDBSymbolTypeBuiltin
>
356 NativeRawSymbol::getVirtualBaseTableType() const {
360 PDB_DataKind
NativeRawSymbol::getDataKind() const {
361 return PDB_DataKind::Unknown
;
364 PDB_SymType
NativeRawSymbol::getSymTag() const { return Tag
; }
366 codeview::GUID
NativeRawSymbol::getGuid() const { return codeview::GUID
{{0}}; }
368 int32_t NativeRawSymbol::getOffset() const {
372 int32_t NativeRawSymbol::getThisAdjust() const {
376 int32_t NativeRawSymbol::getVirtualBasePointerOffset() const {
380 PDB_LocType
NativeRawSymbol::getLocationType() const {
381 return PDB_LocType::Null
;
384 PDB_Machine
NativeRawSymbol::getMachineType() const {
385 return PDB_Machine::Invalid
;
388 codeview::ThunkOrdinal
NativeRawSymbol::getThunkOrdinal() const {
389 return codeview::ThunkOrdinal::Standard
;
392 uint64_t NativeRawSymbol::getLength() const {
396 uint64_t NativeRawSymbol::getLiveRangeLength() const {
400 uint64_t NativeRawSymbol::getVirtualAddress() const {
404 PDB_UdtType
NativeRawSymbol::getUdtKind() const {
405 return PDB_UdtType::Struct
;
408 bool NativeRawSymbol::hasConstructor() const {
412 bool NativeRawSymbol::hasCustomCallingConvention() const {
416 bool NativeRawSymbol::hasFarReturn() const {
420 bool NativeRawSymbol::isCode() const {
424 bool NativeRawSymbol::isCompilerGenerated() const {
428 bool NativeRawSymbol::isConstType() const {
432 bool NativeRawSymbol::isEditAndContinueEnabled() const {
436 bool NativeRawSymbol::isFunction() const {
440 bool NativeRawSymbol::getAddressTaken() const {
444 bool NativeRawSymbol::getNoStackOrdering() const {
448 bool NativeRawSymbol::hasAlloca() const {
452 bool NativeRawSymbol::hasAssignmentOperator() const {
456 bool NativeRawSymbol::hasCTypes() const {
460 bool NativeRawSymbol::hasCastOperator() const {
464 bool NativeRawSymbol::hasDebugInfo() const {
468 bool NativeRawSymbol::hasEH() const {
472 bool NativeRawSymbol::hasEHa() const {
476 bool NativeRawSymbol::hasInlAsm() const {
480 bool NativeRawSymbol::hasInlineAttribute() const {
484 bool NativeRawSymbol::hasInterruptReturn() const {
488 bool NativeRawSymbol::hasFramePointer() const {
492 bool NativeRawSymbol::hasLongJump() const {
496 bool NativeRawSymbol::hasManagedCode() const {
500 bool NativeRawSymbol::hasNestedTypes() const {
504 bool NativeRawSymbol::hasNoInlineAttribute() const {
508 bool NativeRawSymbol::hasNoReturnAttribute() const {
512 bool NativeRawSymbol::hasOptimizedCodeDebugInfo() const {
516 bool NativeRawSymbol::hasOverloadedOperator() const {
520 bool NativeRawSymbol::hasSEH() const {
524 bool NativeRawSymbol::hasSecurityChecks() const {
528 bool NativeRawSymbol::hasSetJump() const {
532 bool NativeRawSymbol::hasStrictGSCheck() const {
536 bool NativeRawSymbol::isAcceleratorGroupSharedLocal() const {
540 bool NativeRawSymbol::isAcceleratorPointerTagLiveRange() const {
544 bool NativeRawSymbol::isAcceleratorStubFunction() const {
548 bool NativeRawSymbol::isAggregated() const {
552 bool NativeRawSymbol::isIntroVirtualFunction() const {
556 bool NativeRawSymbol::isCVTCIL() const {
560 bool NativeRawSymbol::isConstructorVirtualBase() const {
564 bool NativeRawSymbol::isCxxReturnUdt() const {
568 bool NativeRawSymbol::isDataAligned() const {
572 bool NativeRawSymbol::isHLSLData() const {
576 bool NativeRawSymbol::isHotpatchable() const {
580 bool NativeRawSymbol::isIndirectVirtualBaseClass() const {
584 bool NativeRawSymbol::isInterfaceUdt() const {
588 bool NativeRawSymbol::isIntrinsic() const {
592 bool NativeRawSymbol::isLTCG() const {
596 bool NativeRawSymbol::isLocationControlFlowDependent() const {
600 bool NativeRawSymbol::isMSILNetmodule() const {
604 bool NativeRawSymbol::isMatrixRowMajor() const {
608 bool NativeRawSymbol::isManagedCode() const {
612 bool NativeRawSymbol::isMSILCode() const {
616 bool NativeRawSymbol::isMultipleInheritance() const {
620 bool NativeRawSymbol::isNaked() const {
624 bool NativeRawSymbol::isNested() const {
628 bool NativeRawSymbol::isOptimizedAway() const {
632 bool NativeRawSymbol::isPacked() const {
636 bool NativeRawSymbol::isPointerBasedOnSymbolValue() const {
640 bool NativeRawSymbol::isPointerToDataMember() const {
644 bool NativeRawSymbol::isPointerToMemberFunction() const {
648 bool NativeRawSymbol::isPureVirtual() const {
652 bool NativeRawSymbol::isRValueReference() const {
656 bool NativeRawSymbol::isRefUdt() const {
660 bool NativeRawSymbol::isReference() const {
664 bool NativeRawSymbol::isRestrictedType() const {
668 bool NativeRawSymbol::isReturnValue() const {
672 bool NativeRawSymbol::isSafeBuffers() const {
676 bool NativeRawSymbol::isScoped() const {
680 bool NativeRawSymbol::isSdl() const {
684 bool NativeRawSymbol::isSingleInheritance() const {
688 bool NativeRawSymbol::isSplitted() const {
692 bool NativeRawSymbol::isStatic() const {
696 bool NativeRawSymbol::hasPrivateSymbols() const {
700 bool NativeRawSymbol::isUnalignedType() const {
704 bool NativeRawSymbol::isUnreached() const {
708 bool NativeRawSymbol::isValueUdt() const {
712 bool NativeRawSymbol::isVirtual() const {
716 bool NativeRawSymbol::isVirtualBaseClass() const {
720 bool NativeRawSymbol::isVirtualInheritance() const {
724 bool NativeRawSymbol::isVolatileType() const {
728 bool NativeRawSymbol::wasInlined() const {
732 std::string
NativeRawSymbol::getUnused() const {