MCPcopy Create free account
hub / github.com/HaxeFoundation/hxcpp / Delete

Method Delete

src/hx/Debugger.cpp:466–494  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

464 }
465
466 static void Delete(int number)
467 {
468 gMutex.lock();
469
470 if (gBreakpoints->HasBreakpoint(number)) {
471 // Replace mBreakpoints with a copy and remove the breakpoint
472 // from it
473 Breakpoints *newBreakpoints = new Breakpoints(gBreakpoints, number);
474 Breakpoints *toRelease = gBreakpoints;
475 gBreakpoints = newBreakpoints;
476
477 // Write memory barrier ensures that newBreakpoints values are
478 // updated before gBreakpoints is assigned to it
479 write_memory_barrier();
480
481 // Only release after gBreakpoints is set
482 toRelease->RemoveRef();
483
484
485 if (gBreakpoints->IsEmpty()) {
486 // Don't need a write memory barrier here, it's harmless to
487 // see gShouldCallHandleBreakpoints update before gStepType
488 // has updated
489 gShouldCallHandleBreakpoints = (gStepType != STEP_NONE) || (sExecutionTrace==exeTraceLines);
490 }
491 }
492
493 gMutex.unlock();
494 }
495
496 static void BreakNow(bool wait)
497 {

Callers

nothing calls this directly

Calls 4

write_memory_barrierFunction · 0.85
HasBreakpointMethod · 0.80
RemoveRefMethod · 0.80
IsEmptyMethod · 0.80

Tested by

no test coverage detected