1//===- NativeRawSymbol.cpp - Native implementation of IPDBRawSymbol -------===// 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/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" 14 15using namespace llvm; 16using namespace llvm::pdb; 17 18NativeRawSymbol::NativeRawSymbol(NativeSession &PDBSession, PDB_SymType Tag, 19 SymIndexId SymbolId) 20 : Session(PDBSession), Tag(Tag), SymbolId(SymbolId) {} 21 22void 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, 27 RecurseIdFields); 28 dumpSymbolField(OS, "symTag", Tag, Indent); 29} 30 31std::unique_ptr<IPDBEnumSymbols> 32NativeRawSymbol::findChildren(PDB_SymType Type) const { 33 return std::make_unique<NullEnumerator<PDBSymbol>>(); 34} 35 36std::unique_ptr<IPDBEnumSymbols> 37NativeRawSymbol::findChildren(PDB_SymType Type, StringRef Name, 38 PDB_NameSearchFlags Flags) const { 39 return std::make_unique<NullEnumerator<PDBSymbol>>(); 40} 41 42std::unique_ptr<IPDBEnumSymbols> 43NativeRawSymbol::findChildrenByAddr(PDB_SymType Type, StringRef Name, 44 PDB_NameSearchFlags Flags, uint32_t Section, uint32_t Offset) const { 45 return std::make_unique<NullEnumerator<PDBSymbol>>(); 46} 47 48std::unique_ptr<IPDBEnumSymbols> 49NativeRawSymbol::findChildrenByVA(PDB_SymType Type, StringRef Name, 50 PDB_NameSearchFlags Flags, uint64_t VA) const { 51 return std::make_unique<NullEnumerator<PDBSymbol>>(); 52} 53 54std::unique_ptr<IPDBEnumSymbols> 55NativeRawSymbol::findChildrenByRVA(PDB_SymType Type, StringRef Name, 56 PDB_NameSearchFlags Flags, uint32_t RVA) const { 57 return std::make_unique<NullEnumerator<PDBSymbol>>(); 58} 59 60std::unique_ptr<IPDBEnumSymbols> 61NativeRawSymbol::findInlineFramesByAddr(uint32_t Section, 62 uint32_t Offset) const { 63 return std::make_unique<NullEnumerator<PDBSymbol>>(); 64} 65 66std::unique_ptr<IPDBEnumSymbols> 67NativeRawSymbol::findInlineFramesByRVA(uint32_t RVA) const { 68 return std::make_unique<NullEnumerator<PDBSymbol>>(); 69} 70 71std::unique_ptr<IPDBEnumSymbols> 72NativeRawSymbol::findInlineFramesByVA(uint64_t VA) const { 73 return std::make_unique<NullEnumerator<PDBSymbol>>(); 74} 75 76std::unique_ptr<IPDBEnumLineNumbers> 77NativeRawSymbol::findInlineeLines() const { 78 return std::make_unique<NullEnumerator<IPDBLineNumber>>(); 79} 80 81std::unique_ptr<IPDBEnumLineNumbers> 82NativeRawSymbol::findInlineeLinesByAddr(uint32_t Section, uint32_t Offset, 83 uint32_t Length) const { 84 return std::make_unique<NullEnumerator<IPDBLineNumber>>(); 85} 86 87std::unique_ptr<IPDBEnumLineNumbers> 88NativeRawSymbol::findInlineeLinesByRVA(uint32_t RVA, uint32_t Length) const { 89 return std::make_unique<NullEnumerator<IPDBLineNumber>>(); 90} 91 92std::unique_ptr<IPDBEnumLineNumbers> 93NativeRawSymbol::findInlineeLinesByVA(uint64_t VA, uint32_t Length) const { 94 return std::make_unique<NullEnumerator<IPDBLineNumber>>(); 95} 96 97void NativeRawSymbol::getDataBytes(SmallVector<uint8_t, 32> &bytes) const { 98 bytes.clear(); 99} 100 101PDB_MemberAccess NativeRawSymbol::getAccess() const { 102 return PDB_MemberAccess::Private; 103} 104 105uint32_t NativeRawSymbol::getAddressOffset() const { 106 return 0; 107} 108 109uint32_t NativeRawSymbol::getAddressSection() const { 110 return 0; 111} 112 113uint32_t NativeRawSymbol::getAge() const { 114 return 0; 115} 116 117SymIndexId NativeRawSymbol::getArrayIndexTypeId() const { return 0; } 118 119void NativeRawSymbol::getBackEndVersion(VersionInfo &Version) const { 120 Version.Major = 0; 121 Version.Minor = 0; 122 Version.Build = 0; 123 Version.QFE = 0; 124} 125 126uint32_t NativeRawSymbol::getBaseDataOffset() const { 127 return 0; 128} 129 130uint32_t NativeRawSymbol::getBaseDataSlot() const { 131 return 0; 132} 133 134SymIndexId NativeRawSymbol::getBaseSymbolId() const { return 0; } 135 136PDB_BuiltinType NativeRawSymbol::getBuiltinType() const { 137 return PDB_BuiltinType::None; 138} 139 140uint32_t NativeRawSymbol::getBitPosition() const { 141 return 0; 142} 143 144PDB_CallingConv NativeRawSymbol::getCallingConvention() const { 145 return PDB_CallingConv::FarStdCall; 146} 147 148SymIndexId NativeRawSymbol::getClassParentId() const { return 0; } 149 150std::string NativeRawSymbol::getCompilerName() const { 151 return {}; 152} 153 154uint32_t NativeRawSymbol::getCount() const { 155 return 0; 156} 157 158uint32_t NativeRawSymbol::getCountLiveRanges() const { 159 return 0; 160} 161 162void NativeRawSymbol::getFrontEndVersion(VersionInfo &Version) const { 163 Version.Major = 0; 164 Version.Minor = 0; 165 Version.Build = 0; 166 Version.QFE = 0; 167} 168 169PDB_Lang NativeRawSymbol::getLanguage() const { 170 return PDB_Lang::Cobol; 171} 172 173SymIndexId NativeRawSymbol::getLexicalParentId() const { return 0; } 174 175std::string NativeRawSymbol::getLibraryName() const { 176 return {}; 177} 178 179uint32_t NativeRawSymbol::getLiveRangeStartAddressOffset() const { 180 return 0; 181} 182 183uint32_t NativeRawSymbol::getLiveRangeStartAddressSection() const { 184 return 0; 185} 186 187uint32_t NativeRawSymbol::getLiveRangeStartRelativeVirtualAddress() const { 188 return 0; 189} 190 191codeview::RegisterId NativeRawSymbol::getLocalBasePointerRegisterId() const { 192 return codeview::RegisterId::EAX; 193} 194 195SymIndexId NativeRawSymbol::getLowerBoundId() const { return 0; } 196 197uint32_t NativeRawSymbol::getMemorySpaceKind() const { 198 return 0; 199} 200 201std::string NativeRawSymbol::getName() const { 202 return {}; 203} 204 205uint32_t NativeRawSymbol::getNumberOfAcceleratorPointerTags() const { 206 return 0; 207} 208 209uint32_t NativeRawSymbol::getNumberOfColumns() const { 210 return 0; 211} 212 213uint32_t NativeRawSymbol::getNumberOfModifiers() const { 214 return 0; 215} 216 217uint32_t NativeRawSymbol::getNumberOfRegisterIndices() const { 218 return 0; 219} 220 221uint32_t NativeRawSymbol::getNumberOfRows() const { 222 return 0; 223} 224 225std::string NativeRawSymbol::getObjectFileName() const { 226 return {}; 227} 228 229uint32_t NativeRawSymbol::getOemId() const { 230 return 0; 231} 232 233SymIndexId NativeRawSymbol::getOemSymbolId() const { return 0; } 234 235uint32_t NativeRawSymbol::getOffsetInUdt() const { 236 return 0; 237} 238 239PDB_Cpu NativeRawSymbol::getPlatform() const { 240 return PDB_Cpu::Intel8080; 241} 242 243uint32_t NativeRawSymbol::getRank() const { 244 return 0; 245} 246 247codeview::RegisterId NativeRawSymbol::getRegisterId() const { 248 return codeview::RegisterId::EAX; 249} 250 251uint32_t NativeRawSymbol::getRegisterType() const { 252 return 0; 253} 254 255uint32_t NativeRawSymbol::getRelativeVirtualAddress() const { 256 return 0; 257} 258 259uint32_t NativeRawSymbol::getSamplerSlot() const { 260 return 0; 261} 262 263uint32_t NativeRawSymbol::getSignature() const { 264 return 0; 265} 266 267uint32_t NativeRawSymbol::getSizeInUdt() const { 268 return 0; 269} 270 271uint32_t NativeRawSymbol::getSlot() const { 272 return 0; 273} 274 275std::string NativeRawSymbol::getSourceFileName() const { 276 return {}; 277} 278 279std::unique_ptr<IPDBLineNumber> 280NativeRawSymbol::getSrcLineOnTypeDefn() const { 281 return nullptr; 282} 283 284uint32_t NativeRawSymbol::getStride() const { 285 return 0; 286} 287 288SymIndexId NativeRawSymbol::getSubTypeId() const { return 0; } 289 290std::string NativeRawSymbol::getSymbolsFileName() const { return {}; } 291 292SymIndexId NativeRawSymbol::getSymIndexId() const { return SymbolId; } 293 294uint32_t NativeRawSymbol::getTargetOffset() const { 295 return 0; 296} 297 298uint32_t NativeRawSymbol::getTargetRelativeVirtualAddress() const { 299 return 0; 300} 301 302uint64_t NativeRawSymbol::getTargetVirtualAddress() const { 303 return 0; 304} 305 306uint32_t NativeRawSymbol::getTargetSection() const { 307 return 0; 308} 309 310uint32_t NativeRawSymbol::getTextureSlot() const { 311 return 0; 312} 313 314uint32_t NativeRawSymbol::getTimeStamp() const { 315 return 0; 316} 317 318uint32_t NativeRawSymbol::getToken() const { 319 return 0; 320} 321 322SymIndexId NativeRawSymbol::getTypeId() const { return 0; } 323 324uint32_t NativeRawSymbol::getUavSlot() const { 325 return 0; 326} 327 328std::string NativeRawSymbol::getUndecoratedName() const { 329 return {}; 330} 331 332std::string NativeRawSymbol::getUndecoratedNameEx( 333 PDB_UndnameFlags Flags) const { 334 return {}; 335} 336 337SymIndexId NativeRawSymbol::getUnmodifiedTypeId() const { return 0; } 338 339SymIndexId NativeRawSymbol::getUpperBoundId() const { return 0; } 340 341Variant NativeRawSymbol::getValue() const { 342 return Variant(); 343} 344 345uint32_t NativeRawSymbol::getVirtualBaseDispIndex() const { 346 return 0; 347} 348 349uint32_t NativeRawSymbol::getVirtualBaseOffset() const { 350 return 0; 351} 352 353SymIndexId NativeRawSymbol::getVirtualTableShapeId() const { return 0; } 354 355std::unique_ptr<PDBSymbolTypeBuiltin> 356NativeRawSymbol::getVirtualBaseTableType() const { 357 return nullptr; 358} 359 360PDB_DataKind NativeRawSymbol::getDataKind() const { 361 return PDB_DataKind::Unknown; 362} 363 364PDB_SymType NativeRawSymbol::getSymTag() const { return Tag; } 365 366codeview::GUID NativeRawSymbol::getGuid() const { return codeview::GUID{{0}}; } 367 368int32_t NativeRawSymbol::getOffset() const { 369 return 0; 370} 371 372int32_t NativeRawSymbol::getThisAdjust() const { 373 return 0; 374} 375 376int32_t NativeRawSymbol::getVirtualBasePointerOffset() const { 377 return 0; 378} 379 380PDB_LocType NativeRawSymbol::getLocationType() const { 381 return PDB_LocType::Null; 382} 383 384PDB_Machine NativeRawSymbol::getMachineType() const { 385 return PDB_Machine::Invalid; 386} 387 388codeview::ThunkOrdinal NativeRawSymbol::getThunkOrdinal() const { 389 return codeview::ThunkOrdinal::Standard; 390} 391 392uint64_t NativeRawSymbol::getLength() const { 393 return 0; 394} 395 396uint64_t NativeRawSymbol::getLiveRangeLength() const { 397 return 0; 398} 399 400uint64_t NativeRawSymbol::getVirtualAddress() const { 401 return 0; 402} 403 404PDB_UdtType NativeRawSymbol::getUdtKind() const { 405 return PDB_UdtType::Struct; 406} 407 408bool NativeRawSymbol::hasConstructor() const { 409 return false; 410} 411 412bool NativeRawSymbol::hasCustomCallingConvention() const { 413 return false; 414} 415 416bool NativeRawSymbol::hasFarReturn() const { 417 return false; 418} 419 420bool NativeRawSymbol::isCode() const { 421 return false; 422} 423 424bool NativeRawSymbol::isCompilerGenerated() const { 425 return false; 426} 427 428bool NativeRawSymbol::isConstType() const { 429 return false; 430} 431 432bool NativeRawSymbol::isEditAndContinueEnabled() const { 433 return false; 434} 435 436bool NativeRawSymbol::isFunction() const { 437 return false; 438} 439 440bool NativeRawSymbol::getAddressTaken() const { 441 return false; 442} 443 444bool NativeRawSymbol::getNoStackOrdering() const { 445 return false; 446} 447 448bool NativeRawSymbol::hasAlloca() const { 449 return false; 450} 451 452bool NativeRawSymbol::hasAssignmentOperator() const { 453 return false; 454} 455 456bool NativeRawSymbol::hasCTypes() const { 457 return false; 458} 459 460bool NativeRawSymbol::hasCastOperator() const { 461 return false; 462} 463 464bool NativeRawSymbol::hasDebugInfo() const { 465 return false; 466} 467 468bool NativeRawSymbol::hasEH() const { 469 return false; 470} 471 472bool NativeRawSymbol::hasEHa() const { 473 return false; 474} 475 476bool NativeRawSymbol::hasInlAsm() const { 477 return false; 478} 479 480bool NativeRawSymbol::hasInlineAttribute() const { 481 return false; 482} 483 484bool NativeRawSymbol::hasInterruptReturn() const { 485 return false; 486} 487 488bool NativeRawSymbol::hasFramePointer() const { 489 return false; 490} 491 492bool NativeRawSymbol::hasLongJump() const { 493 return false; 494} 495 496bool NativeRawSymbol::hasManagedCode() const { 497 return false; 498} 499 500bool NativeRawSymbol::hasNestedTypes() const { 501 return false; 502} 503 504bool NativeRawSymbol::hasNoInlineAttribute() const { 505 return false; 506} 507 508bool NativeRawSymbol::hasNoReturnAttribute() const { 509 return false; 510} 511 512bool NativeRawSymbol::hasOptimizedCodeDebugInfo() const { 513 return false; 514} 515 516bool NativeRawSymbol::hasOverloadedOperator() const { 517 return false; 518} 519 520bool NativeRawSymbol::hasSEH() const { 521 return false; 522} 523 524bool NativeRawSymbol::hasSecurityChecks() const { 525 return false; 526} 527 528bool NativeRawSymbol::hasSetJump() const { 529 return false; 530} 531 532bool NativeRawSymbol::hasStrictGSCheck() const { 533 return false; 534} 535 536bool NativeRawSymbol::isAcceleratorGroupSharedLocal() const { 537 return false; 538} 539 540bool NativeRawSymbol::isAcceleratorPointerTagLiveRange() const { 541 return false; 542} 543 544bool NativeRawSymbol::isAcceleratorStubFunction() const { 545 return false; 546} 547 548bool NativeRawSymbol::isAggregated() const { 549 return false; 550} 551 552bool NativeRawSymbol::isIntroVirtualFunction() const { 553 return false; 554} 555 556bool NativeRawSymbol::isCVTCIL() const { 557 return false; 558} 559 560bool NativeRawSymbol::isConstructorVirtualBase() const { 561 return false; 562} 563 564bool NativeRawSymbol::isCxxReturnUdt() const { 565 return false; 566} 567 568bool NativeRawSymbol::isDataAligned() const { 569 return false; 570} 571 572bool NativeRawSymbol::isHLSLData() const { 573 return false; 574} 575 576bool NativeRawSymbol::isHotpatchable() const { 577 return false; 578} 579 580bool NativeRawSymbol::isIndirectVirtualBaseClass() const { 581 return false; 582} 583 584bool NativeRawSymbol::isInterfaceUdt() const { 585 return false; 586} 587 588bool NativeRawSymbol::isIntrinsic() const { 589 return false; 590} 591 592bool NativeRawSymbol::isLTCG() const { 593 return false; 594} 595 596bool NativeRawSymbol::isLocationControlFlowDependent() const { 597 return false; 598} 599 600bool NativeRawSymbol::isMSILNetmodule() const { 601 return false; 602} 603 604bool NativeRawSymbol::isMatrixRowMajor() const { 605 return false; 606} 607 608bool NativeRawSymbol::isManagedCode() const { 609 return false; 610} 611 612bool NativeRawSymbol::isMSILCode() const { 613 return false; 614} 615 616bool NativeRawSymbol::isMultipleInheritance() const { 617 return false; 618} 619 620bool NativeRawSymbol::isNaked() const { 621 return false; 622} 623 624bool NativeRawSymbol::isNested() const { 625 return false; 626} 627 628bool NativeRawSymbol::isOptimizedAway() const { 629 return false; 630} 631 632bool NativeRawSymbol::isPacked() const { 633 return false; 634} 635 636bool NativeRawSymbol::isPointerBasedOnSymbolValue() const { 637 return false; 638} 639 640bool NativeRawSymbol::isPointerToDataMember() const { 641 return false; 642} 643 644bool NativeRawSymbol::isPointerToMemberFunction() const { 645 return false; 646} 647 648bool NativeRawSymbol::isPureVirtual() const { 649 return false; 650} 651 652bool NativeRawSymbol::isRValueReference() const { 653 return false; 654} 655 656bool NativeRawSymbol::isRefUdt() const { 657 return false; 658} 659 660bool NativeRawSymbol::isReference() const { 661 return false; 662} 663 664bool NativeRawSymbol::isRestrictedType() const { 665 return false; 666} 667 668bool NativeRawSymbol::isReturnValue() const { 669 return false; 670} 671 672bool NativeRawSymbol::isSafeBuffers() const { 673 return false; 674} 675 676bool NativeRawSymbol::isScoped() const { 677 return false; 678} 679 680bool NativeRawSymbol::isSdl() const { 681 return false; 682} 683 684bool NativeRawSymbol::isSingleInheritance() const { 685 return false; 686} 687 688bool NativeRawSymbol::isSplitted() const { 689 return false; 690} 691 692bool NativeRawSymbol::isStatic() const { 693 return false; 694} 695 696bool NativeRawSymbol::hasPrivateSymbols() const { 697 return false; 698} 699 700bool NativeRawSymbol::isUnalignedType() const { 701 return false; 702} 703 704bool NativeRawSymbol::isUnreached() const { 705 return false; 706} 707 708bool NativeRawSymbol::isValueUdt() const { 709 return false; 710} 711 712bool NativeRawSymbol::isVirtual() const { 713 return false; 714} 715 716bool NativeRawSymbol::isVirtualBaseClass() const { 717 return false; 718} 719 720bool NativeRawSymbol::isVirtualInheritance() const { 721 return false; 722} 723 724bool NativeRawSymbol::isVolatileType() const { 725 return false; 726} 727 728bool NativeRawSymbol::wasInlined() const { 729 return false; 730} 731 732std::string NativeRawSymbol::getUnused() const { 733 return {}; 734} 735