MCPcopy Create free account
hub / github.com/Codeya-IDE/deepin-ide / sendBreakpoints

Method sendBreakpoints

src/plugins/debugger/dap/debugsession.cpp:500–535  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

498}
499
500void 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
537void DebugSession::sendFunctionBreakpoints(dap::array<IFunctionBreakpoint> &fbpts)
538{

Callers

nothing calls this directly

Calls 12

readyForBreakpointsMethod · 0.80
has_valueMethod · 0.80
insertMethod · 0.80
toStringMethod · 0.45
removeBreakpointMethod · 0.45
setBreakpointsMethod · 0.45
validMethod · 0.45
waitMethod · 0.45
sizeMethod · 0.45
getMethod · 0.45
getIdMethod · 0.45

Tested by

no test coverage detected