MCPcopy Create free account
hub / github.com/Kitware/CMake / OnBeginFunctionCall

Method OnBeginFunctionCall

Source/cmDebuggerAdapter.cxx:371–422  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

369}
370
371void cmDebuggerAdapter::OnBeginFunctionCall(cmMakefile* mf,
372 std::string const& sourcePath,
373 cmListFileFunction const& lff)
374{
375 std::unique_lock<std::mutex> lock(Mutex);
376 DefaultThread->PushStackFrame(mf, sourcePath, lff);
377
378 if (lff.Line() == 0) {
379 // File just loaded, continue to first valid function call.
380 return;
381 }
382
383 auto hits = BreakpointManager->GetBreakpoints(sourcePath, lff.Line());
384 lock.unlock();
385
386 bool waitSem = false;
387 dap::StoppedEvent stoppedEvent;
388 stoppedEvent.allThreadsStopped = true;
389 stoppedEvent.threadId = DefaultThread->GetId();
390 if (!hits.empty()) {
391 ClearStepRequests();
392 waitSem = true;
393
394 dap::array<dap::integer> hitBreakpoints;
395 hitBreakpoints.resize(hits.size());
396 std::transform(hits.begin(), hits.end(), hitBreakpoints.begin(),
397 [&](int64_t id) { return dap::integer(id); });
398 stoppedEvent.reason = "breakpoint";
399 stoppedEvent.hitBreakpointIds = hitBreakpoints;
400 }
401
402 if (long(DefaultThread->GetStackFrameSize()) <= NextStepFrom.load() ||
403 StepInRequest.load() ||
404 long(DefaultThread->GetStackFrameSize()) <= StepOutDepth.load()) {
405 ClearStepRequests();
406 waitSem = true;
407
408 stoppedEvent.reason = "step";
409 }
410
411 if (PauseRequest.load()) {
412 ClearStepRequests();
413 waitSem = true;
414
415 stoppedEvent.reason = "pause";
416 }
417
418 if (waitSem) {
419 Session->send(stoppedEvent);
420 ContinueSem->Wait();
421 }
422}
423
424void cmDebuggerAdapter::OnEndFunctionCall()
425{

Callers 1

CallScopeMethod · 0.80

Calls 14

transformFunction · 0.85
integerClass · 0.85
PushStackFrameMethod · 0.80
LineMethod · 0.80
GetBreakpointsMethod · 0.80
GetStackFrameSizeMethod · 0.80
GetIdMethod · 0.45
emptyMethod · 0.45
resizeMethod · 0.45
sizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected