| 498 | } |
| 499 | |
| 500 | void DebugSession::sendBreakpoints(const QString &sourcePath, dap::array<IBreakpoint> &breakpointsToSend) |
| 501 | { |
| 502 | if (!raw || !raw->readyForBreakpoints()) |
| 503 | return; |
| 504 | SetBreakpointsRequest request; |
| 505 | request.source.path = sourcePath.toStdString(); |
| 506 | dap::array<SourceBreakpoint> breakpoints; |
| 507 | for (auto it : breakpointsToSend) { |
| 508 | dap::Source source; |
| 509 | source.path = isRemote ? transformLocalPath(it.uri.toString()).toStdString() : it.uri.toString().toStdString(); |
| 510 | source.name = undefined; |
| 511 | request.source = source; |
| 512 | SourceBreakpoint bt; |
| 513 | bt.line = it.lineNumber; |
| 514 | bt.condition = it.condition; |
| 515 | if (it.hitCondition.has_value()) { |
| 516 | bt.hitCondition = it.hitCondition; |
| 517 | model->removeBreakpoint(sourcePath, bt.line); |
| 518 | } |
| 519 | breakpoints.push_back(bt); |
| 520 | } |
| 521 | |
| 522 | request.breakpoints = breakpoints; |
| 523 | auto response = raw->setBreakpoints(request); |
| 524 | if (response.valid()) { |
| 525 | response.wait(); |
| 526 | |
| 527 | auto data = std::map<dap::string, dap::Breakpoint>(); |
| 528 | for (size_t i = 0; i < breakpointsToSend.size(); ++i) { |
| 529 | if (response.get().response.breakpoints.size() > i) |
| 530 | data.insert(std::pair<dap::string, dap::Breakpoint>(breakpointsToSend[i].getId(), response.get().response.breakpoints[i])); |
| 531 | } |
| 532 | |
| 533 | model->setBreakpointSessionData(id, capabilities(), data); |
| 534 | } |
| 535 | } |
| 536 | |
| 537 | void DebugSession::sendFunctionBreakpoints(dap::array<IFunctionBreakpoint> &fbpts) |
| 538 | { |
nothing calls this directly
no test coverage detected