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