use of org.dartlang.vm.service.element.Success in project flutter-intellij by flutter.
the class CanonicalBreakpoint method attachIsolate.
public void attachIsolate(@NotNull IsolateRef isolateRef, @NotNull Isolate isolate) {
final boolean newIsolate = myIsolatesInfo.addIsolate(isolateRef);
// Just to make sure that the main isolate is not handled twice, both from handleDebuggerConnected() and DartVmServiceListener.received(PauseStart)
if (newIsolate) {
final XDebugSessionImpl session = (XDebugSessionImpl) myDebugProcess.getSession();
ApplicationManager.getApplication().runReadAction(() -> {
session.reset();
session.initBreakpoints();
});
addRequest(() -> myVmService.setExceptionPauseMode(isolateRef.getId(), myDebugProcess.getBreakOnExceptionMode(), new SetExceptionPauseModeConsumer() {
@Override
public void received(Success response) {
setInitialBreakpointsAndCheckExtensions(isolateRef, isolate);
}
@Override
public void onError(RPCError error) {
}
@Override
public void received(Sentinel response) {
}
}));
}
}
use of org.dartlang.vm.service.element.Success in project flutter-intellij by flutter.
the class CanonicalBreakpoint method handleDebuggerConnected.
public void handleDebuggerConnected() {
streamListen(VmService.DEBUG_STREAM_ID, new VmServiceConsumers.SuccessConsumerWrapper() {
@Override
public void received(final Success success) {
myVmServiceReceiverThreadId = Thread.currentThread().getId();
streamListen(VmService.ISOLATE_STREAM_ID, new VmServiceConsumers.SuccessConsumerWrapper() {
@Override
public void received(final Success success) {
getVm(new VmServiceConsumers.VmConsumerWrapper() {
@Override
public void received(final VM vm) {
for (final IsolateRef isolateRef : vm.getIsolates()) {
getIsolate(isolateRef.getId(), new VmServiceConsumers.GetIsolateConsumerWrapper() {
@Override
public void received(final Isolate isolate) {
final Event event = isolate.getPauseEvent();
final EventKind eventKind = event.getKind();
// yet, and we'll get lifecycle events for them later.
if (eventKind == EventKind.None) {
return;
}
// This is the entry point for attaching a debugger to a running app.
if (eventKind == EventKind.Resume) {
attachIsolate(isolateRef, isolate);
return;
}
// if event is not PauseStart it means that PauseStart event will follow later and will be handled by listener
handleIsolate(isolateRef, eventKind == EventKind.PauseStart);
// Handle the case of isolates paused when we connect (this can come up in remote debugging).
if (eventKind == EventKind.PauseBreakpoint || eventKind == EventKind.PauseException || eventKind == EventKind.PauseInterrupted) {
myDebugProcess.isolateSuspended(isolateRef);
ApplicationManager.getApplication().executeOnPooledThread(() -> {
final ElementList<Breakpoint> breakpoints = eventKind == EventKind.PauseBreakpoint ? event.getPauseBreakpoints() : null;
final InstanceRef exception = eventKind == EventKind.PauseException ? event.getException() : null;
myVmServiceListener.onIsolatePaused(isolateRef, breakpoints, exception, event.getTopFrame(), event.getAtAsyncSuspension());
});
}
}
});
}
}
});
}
});
}
});
}
Aggregations