MCPcopy Create free account
hub / github.com/OpenCppCoverage/OpenCppCoverage / SetBreakPoint

Method SetBreakPoint

CppCoverage/MonitoredLineRegister.cpp:172–204  ·  view source on GitHub ↗

--------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

170
171 //--------------------------------------------------------------------------
172 void MonitoredLineRegister::SetBreakPoint(
173 const std::filesystem::path& path,
174 HANDLE hProcess,
175 std::vector<DWORD64>&& addressCollection,
176 const LineNumberByAddress& lineNumberByAddress)
177 {
178 auto oldInstructions =
179 breakPoint_->SetBreakPoints(hProcess, std::move(addressCollection));
180 for (const auto& value : oldInstructions)
181 {
182 auto oldInstruction = value.first;
183 const auto& addressValue = value.second;
184
185 auto it = lineNumberByAddress.find(addressValue);
186 if (it != lineNumberByAddress.end())
187 {
188 Address address{hProcess,
189 reinterpret_cast<void*>(addressValue)};
190 const auto& lineNumbers = it->second;
191 for (auto lineNumber : lineNumbers)
192 {
193 if (!executedAddressManager_->RegisterAddress(
194 address,
195 path.wstring(),
196 lineNumber,
197 oldInstruction))
198 {
199 breakPoint_->RemoveBreakPoint(address, oldInstruction);
200 }
201 }
202 }
203 }
204 }
205
206 //--------------------------------------------------------------------------
207 const FileFilter::ModuleInfo& MonitoredLineRegister::GetModuleInfo() const

Callers

nothing calls this directly

Calls 3

SetBreakPointsMethod · 0.80
RegisterAddressMethod · 0.80
RemoveBreakPointMethod · 0.80

Tested by

no test coverage detected