NativeRawSymbol.cpp 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733
  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. #include "llvm/DebugInfo/PDB/Native/NativeRawSymbol.h"
  9. #include "llvm/DebugInfo/PDB/IPDBLineNumber.h"
  10. #include "llvm/DebugInfo/PDB/Native/NativeSession.h"
  11. #include "llvm/DebugInfo/PDB/PDBSymbolTypeBuiltin.h"
  12. using namespace llvm;
  13. using namespace llvm::pdb;
  14. NativeRawSymbol::NativeRawSymbol(NativeSession &PDBSession, PDB_SymType Tag,
  15. SymIndexId SymbolId)
  16. : Session(PDBSession), Tag(Tag), SymbolId(SymbolId) {}
  17. void NativeRawSymbol::dump(raw_ostream &OS, int Indent,
  18. PdbSymbolIdField ShowIdFields,
  19. PdbSymbolIdField RecurseIdFields) const {
  20. dumpSymbolIdField(OS, "symIndexId", SymbolId, Indent, Session,
  21. PdbSymbolIdField::SymIndexId, ShowIdFields,
  22. RecurseIdFields);
  23. dumpSymbolField(OS, "symTag", Tag, Indent);
  24. }
  25. std::unique_ptr<IPDBEnumSymbols>
  26. NativeRawSymbol::findChildren(PDB_SymType Type) const {
  27. return std::make_unique<NullEnumerator<PDBSymbol>>();
  28. }
  29. std::unique_ptr<IPDBEnumSymbols>
  30. NativeRawSymbol::findChildren(PDB_SymType Type, StringRef Name,
  31. PDB_NameSearchFlags Flags) const {
  32. return std::make_unique<NullEnumerator<PDBSymbol>>();
  33. }
  34. std::unique_ptr<IPDBEnumSymbols>
  35. NativeRawSymbol::findChildrenByAddr(PDB_SymType Type, StringRef Name,
  36. PDB_NameSearchFlags Flags, uint32_t Section, uint32_t Offset) const {
  37. return std::make_unique<NullEnumerator<PDBSymbol>>();
  38. }
  39. std::unique_ptr<IPDBEnumSymbols>
  40. NativeRawSymbol::findChildrenByVA(PDB_SymType Type, StringRef Name,
  41. PDB_NameSearchFlags Flags, uint64_t VA) const {
  42. return std::make_unique<NullEnumerator<PDBSymbol>>();
  43. }
  44. std::unique_ptr<IPDBEnumSymbols>
  45. NativeRawSymbol::findChildrenByRVA(PDB_SymType Type, StringRef Name,
  46. PDB_NameSearchFlags Flags, uint32_t RVA) const {
  47. return std::make_unique<NullEnumerator<PDBSymbol>>();
  48. }
  49. std::unique_ptr<IPDBEnumSymbols>
  50. NativeRawSymbol::findInlineFramesByAddr(uint32_t Section,
  51. uint32_t Offset) const {
  52. return std::make_unique<NullEnumerator<PDBSymbol>>();
  53. }
  54. std::unique_ptr<IPDBEnumSymbols>
  55. NativeRawSymbol::findInlineFramesByRVA(uint32_t RVA) const {
  56. return std::make_unique<NullEnumerator<PDBSymbol>>();
  57. }
  58. std::unique_ptr<IPDBEnumSymbols>
  59. NativeRawSymbol::findInlineFramesByVA(uint64_t VA) const {
  60. return std::make_unique<NullEnumerator<PDBSymbol>>();
  61. }
  62. std::unique_ptr<IPDBEnumLineNumbers>
  63. NativeRawSymbol::findInlineeLines() const {
  64. return std::make_unique<NullEnumerator<IPDBLineNumber>>();
  65. }
  66. std::unique_ptr<IPDBEnumLineNumbers>
  67. NativeRawSymbol::findInlineeLinesByAddr(uint32_t Section, uint32_t Offset,
  68. uint32_t Length) const {
  69. return std::make_unique<NullEnumerator<IPDBLineNumber>>();
  70. }
  71. std::unique_ptr<IPDBEnumLineNumbers>
  72. NativeRawSymbol::findInlineeLinesByRVA(uint32_t RVA, uint32_t Length) const {
  73. return std::make_unique<NullEnumerator<IPDBLineNumber>>();
  74. }
  75. std::unique_ptr<IPDBEnumLineNumbers>
  76. NativeRawSymbol::findInlineeLinesByVA(uint64_t VA, uint32_t Length) const {
  77. return std::make_unique<NullEnumerator<IPDBLineNumber>>();
  78. }
  79. void NativeRawSymbol::getDataBytes(SmallVector<uint8_t, 32> &bytes) const {
  80. bytes.clear();
  81. }
  82. PDB_MemberAccess NativeRawSymbol::getAccess() const {
  83. return PDB_MemberAccess::Private;
  84. }
  85. uint32_t NativeRawSymbol::getAddressOffset() const {
  86. return 0;
  87. }
  88. uint32_t NativeRawSymbol::getAddressSection() const {
  89. return 0;
  90. }
  91. uint32_t NativeRawSymbol::getAge() const {
  92. return 0;
  93. }
  94. SymIndexId NativeRawSymbol::getArrayIndexTypeId() const { return 0; }
  95. void NativeRawSymbol::getBackEndVersion(VersionInfo &Version) const {
  96. Version.Major = 0;
  97. Version.Minor = 0;
  98. Version.Build = 0;
  99. Version.QFE = 0;
  100. }
  101. uint32_t NativeRawSymbol::getBaseDataOffset() const {
  102. return 0;
  103. }
  104. uint32_t NativeRawSymbol::getBaseDataSlot() const {
  105. return 0;
  106. }
  107. SymIndexId NativeRawSymbol::getBaseSymbolId() const { return 0; }
  108. PDB_BuiltinType NativeRawSymbol::getBuiltinType() const {
  109. return PDB_BuiltinType::None;
  110. }
  111. uint32_t NativeRawSymbol::getBitPosition() const {
  112. return 0;
  113. }
  114. PDB_CallingConv NativeRawSymbol::getCallingConvention() const {
  115. return PDB_CallingConv::FarStdCall;
  116. }
  117. SymIndexId NativeRawSymbol::getClassParentId() const { return 0; }
  118. std::string NativeRawSymbol::getCompilerName() const {
  119. return {};
  120. }
  121. uint32_t NativeRawSymbol::getCount() const {
  122. return 0;
  123. }
  124. uint32_t NativeRawSymbol::getCountLiveRanges() const {
  125. return 0;
  126. }
  127. void NativeRawSymbol::getFrontEndVersion(VersionInfo &Version) const {
  128. Version.Major = 0;
  129. Version.Minor = 0;
  130. Version.Build = 0;
  131. Version.QFE = 0;
  132. }
  133. PDB_Lang NativeRawSymbol::getLanguage() const {
  134. return PDB_Lang::Cobol;
  135. }
  136. SymIndexId NativeRawSymbol::getLexicalParentId() const { return 0; }
  137. std::string NativeRawSymbol::getLibraryName() const {
  138. return {};
  139. }
  140. uint32_t NativeRawSymbol::getLiveRangeStartAddressOffset() const {
  141. return 0;
  142. }
  143. uint32_t NativeRawSymbol::getLiveRangeStartAddressSection() const {
  144. return 0;
  145. }
  146. uint32_t NativeRawSymbol::getLiveRangeStartRelativeVirtualAddress() const {
  147. return 0;
  148. }
  149. codeview::RegisterId NativeRawSymbol::getLocalBasePointerRegisterId() const {
  150. return codeview::RegisterId::EAX;
  151. }
  152. SymIndexId NativeRawSymbol::getLowerBoundId() const { return 0; }
  153. uint32_t NativeRawSymbol::getMemorySpaceKind() const {
  154. return 0;
  155. }
  156. std::string NativeRawSymbol::getName() const {
  157. return {};
  158. }
  159. uint32_t NativeRawSymbol::getNumberOfAcceleratorPointerTags() const {
  160. return 0;
  161. }
  162. uint32_t NativeRawSymbol::getNumberOfColumns() const {
  163. return 0;
  164. }
  165. uint32_t NativeRawSymbol::getNumberOfModifiers() const {
  166. return 0;
  167. }
  168. uint32_t NativeRawSymbol::getNumberOfRegisterIndices() const {
  169. return 0;
  170. }
  171. uint32_t NativeRawSymbol::getNumberOfRows() const {
  172. return 0;
  173. }
  174. std::string NativeRawSymbol::getObjectFileName() const {
  175. return {};
  176. }
  177. uint32_t NativeRawSymbol::getOemId() const {
  178. return 0;
  179. }
  180. SymIndexId NativeRawSymbol::getOemSymbolId() const { return 0; }
  181. uint32_t NativeRawSymbol::getOffsetInUdt() const {
  182. return 0;
  183. }
  184. PDB_Cpu NativeRawSymbol::getPlatform() const {
  185. return PDB_Cpu::Intel8080;
  186. }
  187. uint32_t NativeRawSymbol::getRank() const {
  188. return 0;
  189. }
  190. codeview::RegisterId NativeRawSymbol::getRegisterId() const {
  191. return codeview::RegisterId::EAX;
  192. }
  193. uint32_t NativeRawSymbol::getRegisterType() const {
  194. return 0;
  195. }
  196. uint32_t NativeRawSymbol::getRelativeVirtualAddress() const {
  197. return 0;
  198. }
  199. uint32_t NativeRawSymbol::getSamplerSlot() const {
  200. return 0;
  201. }
  202. uint32_t NativeRawSymbol::getSignature() const {
  203. return 0;
  204. }
  205. uint32_t NativeRawSymbol::getSizeInUdt() const {
  206. return 0;
  207. }
  208. uint32_t NativeRawSymbol::getSlot() const {
  209. return 0;
  210. }
  211. std::string NativeRawSymbol::getSourceFileName() const {
  212. return {};
  213. }
  214. std::unique_ptr<IPDBLineNumber>
  215. NativeRawSymbol::getSrcLineOnTypeDefn() const {
  216. return nullptr;
  217. }
  218. uint32_t NativeRawSymbol::getStride() const {
  219. return 0;
  220. }
  221. SymIndexId NativeRawSymbol::getSubTypeId() const { return 0; }
  222. std::string NativeRawSymbol::getSymbolsFileName() const { return {}; }
  223. SymIndexId NativeRawSymbol::getSymIndexId() const { return SymbolId; }
  224. uint32_t NativeRawSymbol::getTargetOffset() const {
  225. return 0;
  226. }
  227. uint32_t NativeRawSymbol::getTargetRelativeVirtualAddress() const {
  228. return 0;
  229. }
  230. uint64_t NativeRawSymbol::getTargetVirtualAddress() const {
  231. return 0;
  232. }
  233. uint32_t NativeRawSymbol::getTargetSection() const {
  234. return 0;
  235. }
  236. uint32_t NativeRawSymbol::getTextureSlot() const {
  237. return 0;
  238. }
  239. uint32_t NativeRawSymbol::getTimeStamp() const {
  240. return 0;
  241. }
  242. uint32_t NativeRawSymbol::getToken() const {
  243. return 0;
  244. }
  245. SymIndexId NativeRawSymbol::getTypeId() const { return 0; }
  246. uint32_t NativeRawSymbol::getUavSlot() const {
  247. return 0;
  248. }
  249. std::string NativeRawSymbol::getUndecoratedName() const {
  250. return {};
  251. }
  252. std::string NativeRawSymbol::getUndecoratedNameEx(
  253. PDB_UndnameFlags Flags) const {
  254. return {};
  255. }
  256. SymIndexId NativeRawSymbol::getUnmodifiedTypeId() const { return 0; }
  257. SymIndexId NativeRawSymbol::getUpperBoundId() const { return 0; }
  258. Variant NativeRawSymbol::getValue() const {
  259. return Variant();
  260. }
  261. uint32_t NativeRawSymbol::getVirtualBaseDispIndex() const {
  262. return 0;
  263. }
  264. uint32_t NativeRawSymbol::getVirtualBaseOffset() const {
  265. return 0;
  266. }
  267. SymIndexId NativeRawSymbol::getVirtualTableShapeId() const { return 0; }
  268. std::unique_ptr<PDBSymbolTypeBuiltin>
  269. NativeRawSymbol::getVirtualBaseTableType() const {
  270. return nullptr;
  271. }
  272. PDB_DataKind NativeRawSymbol::getDataKind() const {
  273. return PDB_DataKind::Unknown;
  274. }
  275. PDB_SymType NativeRawSymbol::getSymTag() const { return Tag; }
  276. codeview::GUID NativeRawSymbol::getGuid() const { return codeview::GUID{{0}}; }
  277. int32_t NativeRawSymbol::getOffset() const {
  278. return 0;
  279. }
  280. int32_t NativeRawSymbol::getThisAdjust() const {
  281. return 0;
  282. }
  283. int32_t NativeRawSymbol::getVirtualBasePointerOffset() const {
  284. return 0;
  285. }
  286. PDB_LocType NativeRawSymbol::getLocationType() const {
  287. return PDB_LocType::Null;
  288. }
  289. PDB_Machine NativeRawSymbol::getMachineType() const {
  290. return PDB_Machine::Invalid;
  291. }
  292. codeview::ThunkOrdinal NativeRawSymbol::getThunkOrdinal() const {
  293. return codeview::ThunkOrdinal::Standard;
  294. }
  295. uint64_t NativeRawSymbol::getLength() const {
  296. return 0;
  297. }
  298. uint64_t NativeRawSymbol::getLiveRangeLength() const {
  299. return 0;
  300. }
  301. uint64_t NativeRawSymbol::getVirtualAddress() const {
  302. return 0;
  303. }
  304. PDB_UdtType NativeRawSymbol::getUdtKind() const {
  305. return PDB_UdtType::Struct;
  306. }
  307. bool NativeRawSymbol::hasConstructor() const {
  308. return false;
  309. }
  310. bool NativeRawSymbol::hasCustomCallingConvention() const {
  311. return false;
  312. }
  313. bool NativeRawSymbol::hasFarReturn() const {
  314. return false;
  315. }
  316. bool NativeRawSymbol::isCode() const {
  317. return false;
  318. }
  319. bool NativeRawSymbol::isCompilerGenerated() const {
  320. return false;
  321. }
  322. bool NativeRawSymbol::isConstType() const {
  323. return false;
  324. }
  325. bool NativeRawSymbol::isEditAndContinueEnabled() const {
  326. return false;
  327. }
  328. bool NativeRawSymbol::isFunction() const {
  329. return false;
  330. }
  331. bool NativeRawSymbol::getAddressTaken() const {
  332. return false;
  333. }
  334. bool NativeRawSymbol::getNoStackOrdering() const {
  335. return false;
  336. }
  337. bool NativeRawSymbol::hasAlloca() const {
  338. return false;
  339. }
  340. bool NativeRawSymbol::hasAssignmentOperator() const {
  341. return false;
  342. }
  343. bool NativeRawSymbol::hasCTypes() const {
  344. return false;
  345. }
  346. bool NativeRawSymbol::hasCastOperator() const {
  347. return false;
  348. }
  349. bool NativeRawSymbol::hasDebugInfo() const {
  350. return false;
  351. }
  352. bool NativeRawSymbol::hasEH() const {
  353. return false;
  354. }
  355. bool NativeRawSymbol::hasEHa() const {
  356. return false;
  357. }
  358. bool NativeRawSymbol::hasInlAsm() const {
  359. return false;
  360. }
  361. bool NativeRawSymbol::hasInlineAttribute() const {
  362. return false;
  363. }
  364. bool NativeRawSymbol::hasInterruptReturn() const {
  365. return false;
  366. }
  367. bool NativeRawSymbol::hasFramePointer() const {
  368. return false;
  369. }
  370. bool NativeRawSymbol::hasLongJump() const {
  371. return false;
  372. }
  373. bool NativeRawSymbol::hasManagedCode() const {
  374. return false;
  375. }
  376. bool NativeRawSymbol::hasNestedTypes() const {
  377. return false;
  378. }
  379. bool NativeRawSymbol::hasNoInlineAttribute() const {
  380. return false;
  381. }
  382. bool NativeRawSymbol::hasNoReturnAttribute() const {
  383. return false;
  384. }
  385. bool NativeRawSymbol::hasOptimizedCodeDebugInfo() const {
  386. return false;
  387. }
  388. bool NativeRawSymbol::hasOverloadedOperator() const {
  389. return false;
  390. }
  391. bool NativeRawSymbol::hasSEH() const {
  392. return false;
  393. }
  394. bool NativeRawSymbol::hasSecurityChecks() const {
  395. return false;
  396. }
  397. bool NativeRawSymbol::hasSetJump() const {
  398. return false;
  399. }
  400. bool NativeRawSymbol::hasStrictGSCheck() const {
  401. return false;
  402. }
  403. bool NativeRawSymbol::isAcceleratorGroupSharedLocal() const {
  404. return false;
  405. }
  406. bool NativeRawSymbol::isAcceleratorPointerTagLiveRange() const {
  407. return false;
  408. }
  409. bool NativeRawSymbol::isAcceleratorStubFunction() const {
  410. return false;
  411. }
  412. bool NativeRawSymbol::isAggregated() const {
  413. return false;
  414. }
  415. bool NativeRawSymbol::isIntroVirtualFunction() const {
  416. return false;
  417. }
  418. bool NativeRawSymbol::isCVTCIL() const {
  419. return false;
  420. }
  421. bool NativeRawSymbol::isConstructorVirtualBase() const {
  422. return false;
  423. }
  424. bool NativeRawSymbol::isCxxReturnUdt() const {
  425. return false;
  426. }
  427. bool NativeRawSymbol::isDataAligned() const {
  428. return false;
  429. }
  430. bool NativeRawSymbol::isHLSLData() const {
  431. return false;
  432. }
  433. bool NativeRawSymbol::isHotpatchable() const {
  434. return false;
  435. }
  436. bool NativeRawSymbol::isIndirectVirtualBaseClass() const {
  437. return false;
  438. }
  439. bool NativeRawSymbol::isInterfaceUdt() const {
  440. return false;
  441. }
  442. bool NativeRawSymbol::isIntrinsic() const {
  443. return false;
  444. }
  445. bool NativeRawSymbol::isLTCG() const {
  446. return false;
  447. }
  448. bool NativeRawSymbol::isLocationControlFlowDependent() const {
  449. return false;
  450. }
  451. bool NativeRawSymbol::isMSILNetmodule() const {
  452. return false;
  453. }
  454. bool NativeRawSymbol::isMatrixRowMajor() const {
  455. return false;
  456. }
  457. bool NativeRawSymbol::isManagedCode() const {
  458. return false;
  459. }
  460. bool NativeRawSymbol::isMSILCode() const {
  461. return false;
  462. }
  463. bool NativeRawSymbol::isMultipleInheritance() const {
  464. return false;
  465. }
  466. bool NativeRawSymbol::isNaked() const {
  467. return false;
  468. }
  469. bool NativeRawSymbol::isNested() const {
  470. return false;
  471. }
  472. bool NativeRawSymbol::isOptimizedAway() const {
  473. return false;
  474. }
  475. bool NativeRawSymbol::isPacked() const {
  476. return false;
  477. }
  478. bool NativeRawSymbol::isPointerBasedOnSymbolValue() const {
  479. return false;
  480. }
  481. bool NativeRawSymbol::isPointerToDataMember() const {
  482. return false;
  483. }
  484. bool NativeRawSymbol::isPointerToMemberFunction() const {
  485. return false;
  486. }
  487. bool NativeRawSymbol::isPureVirtual() const {
  488. return false;
  489. }
  490. bool NativeRawSymbol::isRValueReference() const {
  491. return false;
  492. }
  493. bool NativeRawSymbol::isRefUdt() const {
  494. return false;
  495. }
  496. bool NativeRawSymbol::isReference() const {
  497. return false;
  498. }
  499. bool NativeRawSymbol::isRestrictedType() const {
  500. return false;
  501. }
  502. bool NativeRawSymbol::isReturnValue() const {
  503. return false;
  504. }
  505. bool NativeRawSymbol::isSafeBuffers() const {
  506. return false;
  507. }
  508. bool NativeRawSymbol::isScoped() const {
  509. return false;
  510. }
  511. bool NativeRawSymbol::isSdl() const {
  512. return false;
  513. }
  514. bool NativeRawSymbol::isSingleInheritance() const {
  515. return false;
  516. }
  517. bool NativeRawSymbol::isSplitted() const {
  518. return false;
  519. }
  520. bool NativeRawSymbol::isStatic() const {
  521. return false;
  522. }
  523. bool NativeRawSymbol::hasPrivateSymbols() const {
  524. return false;
  525. }
  526. bool NativeRawSymbol::isUnalignedType() const {
  527. return false;
  528. }
  529. bool NativeRawSymbol::isUnreached() const {
  530. return false;
  531. }
  532. bool NativeRawSymbol::isValueUdt() const {
  533. return false;
  534. }
  535. bool NativeRawSymbol::isVirtual() const {
  536. return false;
  537. }
  538. bool NativeRawSymbol::isVirtualBaseClass() const {
  539. return false;
  540. }
  541. bool NativeRawSymbol::isVirtualInheritance() const {
  542. return false;
  543. }
  544. bool NativeRawSymbol::isVolatileType() const {
  545. return false;
  546. }
  547. bool NativeRawSymbol::wasInlined() const {
  548. return false;
  549. }
  550. std::string NativeRawSymbol::getUnused() const {
  551. return {};
  552. }