1 //===- NativeRawSymbol.cpp - Native implementation of IPDBRawSymbol -*- C++ -*-===//
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/ADT/ArrayRef.h"
12 #include "llvm/ADT/STLExtras.h"
13 #include "llvm/DebugInfo/PDB/IPDBEnumChildren.h"
14 #include "llvm/DebugInfo/PDB/Native/NativeSession.h"
15 #include "llvm/DebugInfo/PDB/PDBExtras.h"
16 #include "llvm/DebugInfo/PDB/PDBSymbolTypeBuiltin.h"
17 #include "llvm/DebugInfo/PDB/PDBSymbolTypeVTable.h"
18 #include "llvm/DebugInfo/PDB/PDBSymbolTypeVTableShape.h"
19 #include "llvm/Support/ConvertUTF.h"
20 #include "llvm/Support/raw_ostream.h"
23 using namespace llvm::pdb;
25 NativeRawSymbol::NativeRawSymbol(NativeSession &PDBSession, uint32_t SymbolId)
26 : Session(PDBSession), SymbolId(SymbolId) {}
28 void NativeRawSymbol::dump(raw_ostream &OS, int Indent) const {}
30 std::unique_ptr<IPDBEnumSymbols>
31 NativeRawSymbol::findChildren(PDB_SymType Type) const {
35 std::unique_ptr<IPDBEnumSymbols>
36 NativeRawSymbol::findChildren(PDB_SymType Type, StringRef Name,
37 PDB_NameSearchFlags Flags) const {
41 std::unique_ptr<IPDBEnumSymbols>
42 NativeRawSymbol::findChildrenByRVA(PDB_SymType Type, StringRef Name,
43 PDB_NameSearchFlags Flags, uint32_t RVA) const {
47 std::unique_ptr<IPDBEnumSymbols>
48 NativeRawSymbol::findInlineFramesByRVA(uint32_t RVA) const {
52 void NativeRawSymbol::getDataBytes(llvm::SmallVector<uint8_t, 32> &bytes) const {
56 PDB_MemberAccess NativeRawSymbol::getAccess() const {
57 return PDB_MemberAccess::Private;
60 uint32_t NativeRawSymbol::getAddressOffset() const {
64 uint32_t NativeRawSymbol::getAddressSection() const {
68 uint32_t NativeRawSymbol::getAge() const {
72 uint32_t NativeRawSymbol::getArrayIndexTypeId() const {
76 void NativeRawSymbol::getBackEndVersion(VersionInfo &Version) const {
83 uint32_t NativeRawSymbol::getBaseDataOffset() const {
87 uint32_t NativeRawSymbol::getBaseDataSlot() const {
91 uint32_t NativeRawSymbol::getBaseSymbolId() const {
95 PDB_BuiltinType NativeRawSymbol::getBuiltinType() const {
96 return PDB_BuiltinType::None;
99 uint32_t NativeRawSymbol::getBitPosition() const {
103 PDB_CallingConv NativeRawSymbol::getCallingConvention() const {
104 return PDB_CallingConv::FarStdCall;
107 uint32_t NativeRawSymbol::getClassParentId() const {
111 std::string NativeRawSymbol::getCompilerName() const {
115 uint32_t NativeRawSymbol::getCount() const {
119 uint32_t NativeRawSymbol::getCountLiveRanges() const {
123 void NativeRawSymbol::getFrontEndVersion(VersionInfo &Version) const {
130 PDB_Lang NativeRawSymbol::getLanguage() const {
131 return PDB_Lang::Cobol;
134 uint32_t NativeRawSymbol::getLexicalParentId() const {
138 std::string NativeRawSymbol::getLibraryName() const {
142 uint32_t NativeRawSymbol::getLiveRangeStartAddressOffset() const {
146 uint32_t NativeRawSymbol::getLiveRangeStartAddressSection() const {
150 uint32_t NativeRawSymbol::getLiveRangeStartRelativeVirtualAddress() const {
154 codeview::RegisterId NativeRawSymbol::getLocalBasePointerRegisterId() const {
155 return codeview::RegisterId::EAX;
158 uint32_t NativeRawSymbol::getLowerBoundId() const {
162 uint32_t NativeRawSymbol::getMemorySpaceKind() const {
166 std::string NativeRawSymbol::getName() const {
170 uint32_t NativeRawSymbol::getNumberOfAcceleratorPointerTags() const {
174 uint32_t NativeRawSymbol::getNumberOfColumns() const {
178 uint32_t NativeRawSymbol::getNumberOfModifiers() const {
182 uint32_t NativeRawSymbol::getNumberOfRegisterIndices() const {
186 uint32_t NativeRawSymbol::getNumberOfRows() const {
190 std::string NativeRawSymbol::getObjectFileName() const {
194 uint32_t NativeRawSymbol::getOemId() const {
198 uint32_t NativeRawSymbol::getOemSymbolId() const {
202 uint32_t NativeRawSymbol::getOffsetInUdt() const {
206 PDB_Cpu NativeRawSymbol::getPlatform() const {
207 return PDB_Cpu::Intel8080;
210 uint32_t NativeRawSymbol::getRank() const {
214 codeview::RegisterId NativeRawSymbol::getRegisterId() const {
215 return codeview::RegisterId::EAX;
218 uint32_t NativeRawSymbol::getRegisterType() const {
222 uint32_t NativeRawSymbol::getRelativeVirtualAddress() const {
226 uint32_t NativeRawSymbol::getSamplerSlot() const {
230 uint32_t NativeRawSymbol::getSignature() const {
234 uint32_t NativeRawSymbol::getSizeInUdt() const {
238 uint32_t NativeRawSymbol::getSlot() const {
242 std::string NativeRawSymbol::getSourceFileName() const {
246 uint32_t NativeRawSymbol::getStride() const {
250 uint32_t NativeRawSymbol::getSubTypeId() const {
254 std::string NativeRawSymbol::getSymbolsFileName() const { return ""; }
256 uint32_t NativeRawSymbol::getSymIndexId() const { return SymbolId; }
258 uint32_t NativeRawSymbol::getTargetOffset() const {
262 uint32_t NativeRawSymbol::getTargetRelativeVirtualAddress() const {
266 uint64_t NativeRawSymbol::getTargetVirtualAddress() const {
270 uint32_t NativeRawSymbol::getTargetSection() const {
274 uint32_t NativeRawSymbol::getTextureSlot() const {
278 uint32_t NativeRawSymbol::getTimeStamp() const {
282 uint32_t NativeRawSymbol::getToken() const {
286 uint32_t NativeRawSymbol::getTypeId() const {
290 uint32_t NativeRawSymbol::getUavSlot() const {
294 std::string NativeRawSymbol::getUndecoratedName() const {
298 uint32_t NativeRawSymbol::getUnmodifiedTypeId() const {
302 uint32_t NativeRawSymbol::getUpperBoundId() const {
306 Variant NativeRawSymbol::getValue() const {
310 uint32_t NativeRawSymbol::getVirtualBaseDispIndex() const {
314 uint32_t NativeRawSymbol::getVirtualBaseOffset() const {
318 uint32_t NativeRawSymbol::getVirtualTableShapeId() const {
322 std::unique_ptr<PDBSymbolTypeBuiltin>
323 NativeRawSymbol::getVirtualBaseTableType() const {
327 PDB_DataKind NativeRawSymbol::getDataKind() const {
328 return PDB_DataKind::Unknown;
331 PDB_SymType NativeRawSymbol::getSymTag() const {
332 return PDB_SymType::None;
335 PDB_UniqueId NativeRawSymbol::getGuid() const {
336 return PDB_UniqueId{{0}};
339 int32_t NativeRawSymbol::getOffset() const {
343 int32_t NativeRawSymbol::getThisAdjust() const {
347 int32_t NativeRawSymbol::getVirtualBasePointerOffset() const {
351 PDB_LocType NativeRawSymbol::getLocationType() const {
352 return PDB_LocType::Null;
355 PDB_Machine NativeRawSymbol::getMachineType() const {
356 return PDB_Machine::Invalid;
359 codeview::ThunkOrdinal NativeRawSymbol::getThunkOrdinal() const {
360 return codeview::ThunkOrdinal::Standard;
363 uint64_t NativeRawSymbol::getLength() const {
367 uint64_t NativeRawSymbol::getLiveRangeLength() const {
371 uint64_t NativeRawSymbol::getVirtualAddress() const {
375 PDB_UdtType NativeRawSymbol::getUdtKind() const {
376 return PDB_UdtType::Struct;
379 bool NativeRawSymbol::hasConstructor() const {
383 bool NativeRawSymbol::hasCustomCallingConvention() const {
387 bool NativeRawSymbol::hasFarReturn() const {
391 bool NativeRawSymbol::isCode() const {
395 bool NativeRawSymbol::isCompilerGenerated() const {
399 bool NativeRawSymbol::isConstType() const {
403 bool NativeRawSymbol::isEditAndContinueEnabled() const {
407 bool NativeRawSymbol::isFunction() const {
411 bool NativeRawSymbol::getAddressTaken() const {
415 bool NativeRawSymbol::getNoStackOrdering() const {
419 bool NativeRawSymbol::hasAlloca() const {
423 bool NativeRawSymbol::hasAssignmentOperator() const {
427 bool NativeRawSymbol::hasCTypes() const {
431 bool NativeRawSymbol::hasCastOperator() const {
435 bool NativeRawSymbol::hasDebugInfo() const {
439 bool NativeRawSymbol::hasEH() const {
443 bool NativeRawSymbol::hasEHa() const {
447 bool NativeRawSymbol::hasInlAsm() const {
451 bool NativeRawSymbol::hasInlineAttribute() const {
455 bool NativeRawSymbol::hasInterruptReturn() const {
459 bool NativeRawSymbol::hasFramePointer() const {
463 bool NativeRawSymbol::hasLongJump() const {
467 bool NativeRawSymbol::hasManagedCode() const {
471 bool NativeRawSymbol::hasNestedTypes() const {
475 bool NativeRawSymbol::hasNoInlineAttribute() const {
479 bool NativeRawSymbol::hasNoReturnAttribute() const {
483 bool NativeRawSymbol::hasOptimizedCodeDebugInfo() const {
487 bool NativeRawSymbol::hasOverloadedOperator() const {
491 bool NativeRawSymbol::hasSEH() const {
495 bool NativeRawSymbol::hasSecurityChecks() const {
499 bool NativeRawSymbol::hasSetJump() const {
503 bool NativeRawSymbol::hasStrictGSCheck() const {
507 bool NativeRawSymbol::isAcceleratorGroupSharedLocal() const {
511 bool NativeRawSymbol::isAcceleratorPointerTagLiveRange() const {
515 bool NativeRawSymbol::isAcceleratorStubFunction() const {
519 bool NativeRawSymbol::isAggregated() const {
523 bool NativeRawSymbol::isIntroVirtualFunction() const {
527 bool NativeRawSymbol::isCVTCIL() const {
531 bool NativeRawSymbol::isConstructorVirtualBase() const {
535 bool NativeRawSymbol::isCxxReturnUdt() const {
539 bool NativeRawSymbol::isDataAligned() const {
543 bool NativeRawSymbol::isHLSLData() const {
547 bool NativeRawSymbol::isHotpatchable() const {
551 bool NativeRawSymbol::isIndirectVirtualBaseClass() const {
555 bool NativeRawSymbol::isInterfaceUdt() const {
559 bool NativeRawSymbol::isIntrinsic() const {
563 bool NativeRawSymbol::isLTCG() const {
567 bool NativeRawSymbol::isLocationControlFlowDependent() const {
571 bool NativeRawSymbol::isMSILNetmodule() const {
575 bool NativeRawSymbol::isMatrixRowMajor() const {
579 bool NativeRawSymbol::isManagedCode() const {
583 bool NativeRawSymbol::isMSILCode() const {
587 bool NativeRawSymbol::isMultipleInheritance() const {
591 bool NativeRawSymbol::isNaked() const {
595 bool NativeRawSymbol::isNested() const {
599 bool NativeRawSymbol::isOptimizedAway() const {
603 bool NativeRawSymbol::isPacked() const {
607 bool NativeRawSymbol::isPointerBasedOnSymbolValue() const {
611 bool NativeRawSymbol::isPointerToDataMember() const {
615 bool NativeRawSymbol::isPointerToMemberFunction() const {
619 bool NativeRawSymbol::isPureVirtual() const {
623 bool NativeRawSymbol::isRValueReference() const {
627 bool NativeRawSymbol::isRefUdt() const {
631 bool NativeRawSymbol::isReference() const {
635 bool NativeRawSymbol::isRestrictedType() const {
639 bool NativeRawSymbol::isReturnValue() const {
643 bool NativeRawSymbol::isSafeBuffers() const {
647 bool NativeRawSymbol::isScoped() const {
651 bool NativeRawSymbol::isSdl() const {
655 bool NativeRawSymbol::isSingleInheritance() const {
659 bool NativeRawSymbol::isSplitted() const {
663 bool NativeRawSymbol::isStatic() const {
667 bool NativeRawSymbol::hasPrivateSymbols() const {
671 bool NativeRawSymbol::isUnalignedType() const {
675 bool NativeRawSymbol::isUnreached() const {
679 bool NativeRawSymbol::isValueUdt() const {
683 bool NativeRawSymbol::isVirtual() const {
687 bool NativeRawSymbol::isVirtualBaseClass() const {
691 bool NativeRawSymbol::isVirtualInheritance() const {
695 bool NativeRawSymbol::isVolatileType() const {
699 bool NativeRawSymbol::wasInlined() const {
703 std::string NativeRawSymbol::getUnused() const {