preventBreakingAndResume method

Future<void> preventBreakingAndResume()

Removes any breakpoints or pause behaviour and resumes any paused isolates.

This is useful when detaching from a process that was attached to, where the user would not expect the script to continue to pause on breakpoints the had set while attached.

Implementation

Future<void> preventBreakingAndResume() async {
  await _withErrorHandling(() async {
    // Remove anything that may cause us to pause again.
    await Future.wait([
      isolateManager.clearAllBreakpoints(),
      isolateManager.setExceptionPauseMode('None'),
    ]);
    // Once those have completed, it's safe to resume anything paused.
    await isolateManager.resumeAll();
  });
}