| 90 | } |
| 91 | |
| 92 | void CollectSymbols() |
| 93 | { |
| 94 | CComPtr<IDiaSymbol> pglobal; |
| 95 | if (FAILED(session_->get_globalScope(&pglobal))) |
| 96 | { |
| 97 | std::cout << "get_globalScope failed" << std::endl; |
| 98 | return; |
| 99 | } |
| 100 | |
| 101 | CollectSymbols(pglobal); |
| 102 | |
| 103 | std::sort(symbols_.begin(), symbols_.end(), [](Symbol const& a, Symbol const& b) { |
| 104 | return a.rva < b.rva; |
| 105 | }); |
| 106 | |
| 107 | uint64_t lastVa{ 0 }; |
| 108 | for (auto const& sym : symbols_) { |
| 109 | if (sym.rva > lastVa) { |
| 110 | lastVa = sym.rva; |
| 111 | filteredSymbols_.push_back(sym); |
| 112 | } |
| 113 | } |
| 114 | } |
| 115 | |
| 116 | static void TrimOccurrences(std::string& s, std::string_view f) |
| 117 | { |