--------------------------------------------------------------------------
| 131 | |
| 132 | //-------------------------------------------------------------------------- |
| 133 | void |
| 134 | MonitoredLineRegister::OnSourceFile(const std::filesystem::path& path, |
| 135 | const std::vector<Line>& lines) |
| 136 | { |
| 137 | std::vector<FileFilter::LineInfo> lineInfos; |
| 138 | |
| 139 | for (const auto& line : lines) |
| 140 | { |
| 141 | lineInfos.emplace_back( |
| 142 | line.lineNumber_, line.virtualAddress_, line.symbolIndex_); |
| 143 | } |
| 144 | |
| 145 | FileFilter::FileInfo fileInfo{path, std::move(lineInfos)}; |
| 146 | const auto& moduleInfo = GetModuleInfo(); |
| 147 | |
| 148 | std::vector<DWORD64> addresses; |
| 149 | LineNumberByAddress lineNumberByAddress; |
| 150 | |
| 151 | for (const auto& lineInfo : fileInfo.lineInfoColllection_) |
| 152 | { |
| 153 | auto lineNumber = lineInfo.lineNumber_; |
| 154 | if (coverageFilterManager_->IsLineSelected( |
| 155 | moduleInfo, fileInfo, lineInfo)) |
| 156 | { |
| 157 | auto addressValue = |
| 158 | lineInfo.virtualAddress_ + |
| 159 | reinterpret_cast<DWORD64>(moduleInfo.baseOfImage_); |
| 160 | |
| 161 | lineNumberByAddress[addressValue].push_back(lineNumber); |
| 162 | addresses.push_back(addressValue); |
| 163 | } |
| 164 | } |
| 165 | SetBreakPoint(path, |
| 166 | moduleInfo.hProcess_, |
| 167 | std::move(addresses), |
| 168 | lineNumberByAddress); |
| 169 | } |
| 170 | |
| 171 | //-------------------------------------------------------------------------- |
| 172 | void MonitoredLineRegister::SetBreakPoint( |
no test coverage detected