llvm.org GIT mirror llvm / 7a32804
[PDB] Implement more find methods for PDB symbols Summary: Add additional find methods on PDB raw symbols. findChildrenByAddr() findChildrenByVA() findInlineFramesByAddr() findInlineFramesByVA() findInlineLines() findInlineLinesByAddr() findInlineLinesByRVA() findInlineLinesByVA() Reviewers: zturner, llvm-commits Reviewed By: zturner Differential Revision: https://reviews.llvm.org/D43637 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325824 91177308-0d34-0410-b5e6-96231b3b80d8 Aaron Smith 2 years ago
6 changed file(s) with 236 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
2929 findChildren(PDB_SymType Type, StringRef Name,
3030 PDB_NameSearchFlags Flags) const override;
3131 std::unique_ptr
32 findChildrenByAddr(PDB_SymType Type, StringRef Name,
33 PDB_NameSearchFlags Flags,
34 uint32_t Section, uint32_t Offset) const override;
35 std::unique_ptr
36 findChildrenByVA(PDB_SymType Type, StringRef Name, PDB_NameSearchFlags Flags,
37 uint64_t VA) const override;
38 std::unique_ptr
3239 findChildrenByRVA(PDB_SymType Type, StringRef Name, PDB_NameSearchFlags Flags,
3340 uint32_t RVA) const override;
41
42 std::unique_ptr
43 findInlineFramesByAddr(uint32_t Section, uint32_t Offset) const override;
3444 std::unique_ptr
3545 findInlineFramesByRVA(uint32_t RVA) const override;
46 std::unique_ptr
47 findInlineFramesByVA(uint64_t VA) const override;
48
49 std::unique_ptr findInlineeLines() const override;
50 std::unique_ptr
51 findInlineeLinesByAddr(uint32_t Section, uint32_t Offset,
52 uint32_t Length) const override;
53 std::unique_ptr
54 findInlineeLinesByRVA(uint32_t RVA, uint32_t Length) const override;
55 std::unique_ptr
56 findInlineeLinesByVA(uint64_t VA, uint32_t Length) const override;
3657
3758 void getDataBytes(llvm::SmallVector &bytes) const override;
3859 void getFrontEndVersion(VersionInfo &Version) const override;
4141 findChildren(PDB_SymType Type, StringRef Name,
4242 PDB_NameSearchFlags Flags) const = 0;
4343 virtual std::unique_ptr
44 findChildrenByAddr(PDB_SymType Type, StringRef Name,
45 PDB_NameSearchFlags Flags,
46 uint32_t Section, uint32_t Offset) const = 0;
47 virtual std::unique_ptr
48 findChildrenByVA(PDB_SymType Type, StringRef Name, PDB_NameSearchFlags Flags,
49 uint64_t VA) const = 0;
50 virtual std::unique_ptr
4451 findChildrenByRVA(PDB_SymType Type, StringRef Name, PDB_NameSearchFlags Flags,
4552 uint32_t RVA) const = 0;
53
54 virtual std::unique_ptr
55 findInlineFramesByAddr(uint32_t Section, uint32_t Offset) const = 0;
4656 virtual std::unique_ptr
4757 findInlineFramesByRVA(uint32_t RVA) const = 0;
58 virtual std::unique_ptr
59 findInlineFramesByVA(uint64_t VA) const = 0;
60
61 virtual std::unique_ptr findInlineeLines() const = 0;
62 virtual std::unique_ptr
63 findInlineeLinesByAddr(uint32_t Section, uint32_t Offset,
64 uint32_t Length) const = 0;
65 virtual std::unique_ptr
66 findInlineeLinesByRVA(uint32_t RVA, uint32_t Length) const = 0;
67 virtual std::unique_ptr
68 findInlineeLinesByVA(uint64_t VA, uint32_t Length) const = 0;
4869
4970 virtual void getDataBytes(llvm::SmallVector &bytes) const = 0;
5071 virtual void getBackEndVersion(VersionInfo &Version) const = 0;
3434 findChildren(PDB_SymType Type, StringRef Name,
3535 PDB_NameSearchFlags Flags) const override;
3636 std::unique_ptr
37 findChildrenByAddr(PDB_SymType Type, StringRef Name,
38 PDB_NameSearchFlags Flags,
39 uint32_t Section, uint32_t Offset) const override;
40 std::unique_ptr
41 findChildrenByVA(PDB_SymType Type, StringRef Name, PDB_NameSearchFlags Flags,
42 uint64_t VA) const override;
43 std::unique_ptr
3744 findChildrenByRVA(PDB_SymType Type, StringRef Name, PDB_NameSearchFlags Flags,
3845 uint32_t RVA) const override;
46
47 std::unique_ptr
48 findInlineFramesByAddr(uint32_t Section, uint32_t Offset) const override;
3949 std::unique_ptr
4050 findInlineFramesByRVA(uint32_t RVA) const override;
51 std::unique_ptr
52 findInlineFramesByVA(uint64_t VA) const override;
53
54 std::unique_ptr findInlineeLines() const override;
55 std::unique_ptr
56 findInlineeLinesByAddr(uint32_t Section, uint32_t Offset,
57 uint32_t Length) const override;
58 std::unique_ptr
59 findInlineeLinesByRVA(uint32_t RVA, uint32_t Length) const override;
60 std::unique_ptr
61 findInlineeLinesByVA(uint64_t VA, uint32_t Length) const override;
4162
4263 void getDataBytes(SmallVector &Bytes) const override;
4364 void getFrontEndVersion(VersionInfo &Version) const override;
399399 }
400400
401401 std::unique_ptr
402 DIARawSymbol::findChildrenByAddr(PDB_SymType Type, StringRef Name,
403 PDB_NameSearchFlags Flags, uint32_t Section,
404 uint32_t Offset) const {
405 llvm::SmallVector Name16;
406 llvm::convertUTF8ToUTF16String(Name, Name16);
407
408 enum SymTagEnum EnumVal = static_cast(Type);
409
410 DWORD CompareFlags = static_cast(Flags);
411 wchar_t *Name16Str = reinterpret_cast(Name16.data());
412
413 CComPtr DiaEnumerator;
414 if (S_OK !=
415 Symbol->findChildrenExByAddr(EnumVal, Name16Str, CompareFlags, Section,
416 Offset, &DiaEnumerator))
417 return nullptr;
418
419 return llvm::make_unique(Session, DiaEnumerator);
420 }
421
422 std::unique_ptr
423 DIARawSymbol::findChildrenByVA(PDB_SymType Type, StringRef Name,
424 PDB_NameSearchFlags Flags, uint64_t VA) const {
425 llvm::SmallVector Name16;
426 llvm::convertUTF8ToUTF16String(Name, Name16);
427
428 enum SymTagEnum EnumVal = static_cast(Type);
429
430 DWORD CompareFlags = static_cast(Flags);
431 wchar_t *Name16Str = reinterpret_cast(Name16.data());
432
433 CComPtr DiaEnumerator;
434 if (S_OK !=
435 Symbol->findChildrenExByVA(EnumVal, Name16Str, CompareFlags, VA,
436 &DiaEnumerator))
437 return nullptr;
438
439 return llvm::make_unique(Session, DiaEnumerator);
440 }
441
442 std::unique_ptr
402443 DIARawSymbol::findChildrenByRVA(PDB_SymType Type, StringRef Name,
403444 PDB_NameSearchFlags Flags, uint32_t RVA) const {
404445 llvm::SmallVector Name16;
418459 }
419460
420461 std::unique_ptr
462 DIARawSymbol::findInlineFramesByAddr(uint32_t Section, uint32_t Offset) const {
463 CComPtr DiaEnumerator;
464 if (S_OK != Symbol->findInlineFramesByAddr(Section, Offset, &DiaEnumerator))
465 return nullptr;
466
467 return llvm::make_unique(Session, DiaEnumerator);
468 }
469
470 std::unique_ptr
421471 DIARawSymbol::findInlineFramesByRVA(uint32_t RVA) const {
422472 CComPtr DiaEnumerator;
423473 if (S_OK != Symbol->findInlineFramesByRVA(RVA, &DiaEnumerator))
424474 return nullptr;
425475
426476 return llvm::make_unique(Session, DiaEnumerator);
477 }
478
479 std::unique_ptr
480 DIARawSymbol::findInlineFramesByVA(uint64_t VA) const {
481 CComPtr DiaEnumerator;
482 if (S_OK != Symbol->findInlineFramesByVA(VA, &DiaEnumerator))
483 return nullptr;
484
485 return llvm::make_unique(Session, DiaEnumerator);
486 }
487
488 std::unique_ptr DIARawSymbol::findInlineeLines() const {
489 CComPtr DiaEnumerator;
490 if (S_OK != Symbol->findInlineeLines(&DiaEnumerator))
491 return nullptr;
492
493 return llvm::make_unique(DiaEnumerator);
494 }
495
496 std::unique_ptr
497 DIARawSymbol::findInlineeLinesByAddr(uint32_t Section, uint32_t Offset,
498 uint32_t Length) const {
499 CComPtr DiaEnumerator;
500 if (S_OK != Symbol->findInlineeLinesByAddr(Section, Offset, Length, &DiaEnumerator))
501 return nullptr;
502
503 return llvm::make_unique(DiaEnumerator);
504 }
505
506 std::unique_ptr
507 DIARawSymbol::findInlineeLinesByRVA(uint32_t RVA, uint32_t Length) const {
508 CComPtr DiaEnumerator;
509 if (S_OK != Symbol->findInlineeLinesByRVA(RVA, Length, &DiaEnumerator))
510 return nullptr;
511
512 return llvm::make_unique(DiaEnumerator);
513 }
514
515 std::unique_ptr
516 DIARawSymbol::findInlineeLinesByVA(uint64_t VA, uint32_t Length) const {
517 CComPtr DiaEnumerator;
518 if (S_OK != Symbol->findInlineeLinesByVA(VA, Length, &DiaEnumerator))
519 return nullptr;
520
521 return llvm::make_unique(DiaEnumerator);
427522 }
428523
429524 void DIARawSymbol::getDataBytes(llvm::SmallVector &bytes) const {
2929 }
3030
3131 std::unique_ptr
32 NativeRawSymbol::findChildrenByAddr(PDB_SymType Type, StringRef Name,
33 PDB_NameSearchFlags Flags, uint32_t Section, uint32_t Offset) const {
34 return nullptr;
35 }
36
37 std::unique_ptr
38 NativeRawSymbol::findChildrenByVA(PDB_SymType Type, StringRef Name,
39 PDB_NameSearchFlags Flags, uint64_t VA) const {
40 return nullptr;
41 }
42
43 std::unique_ptr
3244 NativeRawSymbol::findChildrenByRVA(PDB_SymType Type, StringRef Name,
3345 PDB_NameSearchFlags Flags, uint32_t RVA) const {
3446 return nullptr;
3547 }
3648
3749 std::unique_ptr
50 NativeRawSymbol::findInlineFramesByAddr(uint32_t Section,
51 uint32_t Offset) const {
52 return nullptr;
53 }
54
55 std::unique_ptr
3856 NativeRawSymbol::findInlineFramesByRVA(uint32_t RVA) const {
57 return nullptr;
58 }
59
60 std::unique_ptr
61 NativeRawSymbol::findInlineFramesByVA(uint64_t VA) const {
62 return nullptr;
63 }
64
65 std::unique_ptr
66 NativeRawSymbol::findInlineeLines() const {
67 return nullptr;
68 }
69
70 std::unique_ptr
71 NativeRawSymbol::findInlineeLinesByAddr(uint32_t Section, uint32_t Offset,
72 uint32_t Length) const {
73 return nullptr;
74 }
75
76 std::unique_ptr
77 NativeRawSymbol::findInlineeLinesByRVA(uint32_t RVA, uint32_t Length) const {
78 return nullptr;
79 }
80
81 std::unique_ptr
82 NativeRawSymbol::findInlineeLinesByVA(uint64_t VA, uint32_t Length) const {
3983 return nullptr;
4084 }
4185
141141 return nullptr;
142142 }
143143 std::unique_ptr
144 findChildrenByAddr(PDB_SymType Type, StringRef Name, PDB_NameSearchFlags Flags,
145 uint32_t Section, uint32_t Offset) const {
146 return nullptr;
147 }
148 std::unique_ptr
149 findChildrenByVA(PDB_SymType Type, StringRef Name, PDB_NameSearchFlags Flags,
150 uint64_t VA) const override {
151 return nullptr;
152 }
153 std::unique_ptr
144154 findChildrenByRVA(PDB_SymType Type, StringRef Name, PDB_NameSearchFlags Flags,
145155 uint32_t RVA) const override {
146156 return nullptr;
147157 }
148158 std::unique_ptr
159 findInlineFramesByAddr(uint32_t Section, uint32_t Offset) const override {
160 return nullptr;
161 }
162 std::unique_ptr
149163 findInlineFramesByRVA(uint32_t RVA) const override {
164 return nullptr;
165 }
166 std::unique_ptr
167 findInlineFramesByVA(uint64_t VA) const override {
168 return nullptr;
169 }
170 std::unique_ptr findInlineeLines() const override {
171 return nullptr;
172 }
173 std::unique_ptr
174 findInlineeLinesByAddr(uint32_t Section, uint32_t Offset,
175 uint32_t Length) const override {
176 return nullptr;
177 }
178 std::unique_ptr
179 findInlineeLinesByRVA(uint32_t RVA, uint32_t Length) const override {
180 return nullptr;
181 }
182 std::unique_ptr
183 findInlineeLinesByVA(uint64_t VA, uint32_t Length) const override {
150184 return nullptr;
151185 }
152186