use of com.intellij.debugger.engine.requests.RequestManagerImpl in project intellij-community by JetBrains.
the class BreakpointManager method applyThreadFilter.
public void applyThreadFilter(@NotNull final DebugProcessImpl debugProcess, @Nullable ThreadReference newFilterThread) {
final RequestManagerImpl requestManager = debugProcess.getRequestsManager();
final ThreadReference oldFilterThread = requestManager.getFilterThread();
if (Comparing.equal(newFilterThread, oldFilterThread)) {
// the filter already added
return;
}
requestManager.setFilterThread(newFilterThread);
if (newFilterThread == null || oldFilterThread != null) {
final List<Breakpoint> breakpoints = getBreakpoints();
for (Breakpoint breakpoint : breakpoints) {
if (LineBreakpoint.CATEGORY.equals(breakpoint.getCategory()) || MethodBreakpoint.CATEGORY.equals(breakpoint.getCategory())) {
requestManager.deleteRequest(breakpoint);
breakpoint.createRequest(debugProcess);
}
}
} else {
// important! need to add filter to _existing_ requests, otherwise Requestor->Request mapping will be lost
// and debugger trees will not be restored to original state
EventRequestManager eventRequestManager = requestManager.getVMRequestManager();
if (eventRequestManager != null) {
applyFilter(eventRequestManager.breakpointRequests(), request -> request.addThreadFilter(newFilterThread));
applyFilter(eventRequestManager.methodEntryRequests(), request -> request.addThreadFilter(newFilterThread));
applyFilter(eventRequestManager.methodExitRequests(), request -> request.addThreadFilter(newFilterThread));
}
}
}
use of com.intellij.debugger.engine.requests.RequestManagerImpl in project intellij-community by JetBrains.
the class BreakpointManager method disableBreakpoints.
//interaction with RequestManagerImpl
public void disableBreakpoints(@NotNull final DebugProcessImpl debugProcess) {
final List<Breakpoint> breakpoints = getBreakpoints();
if (!breakpoints.isEmpty()) {
final RequestManagerImpl requestManager = debugProcess.getRequestsManager();
for (Breakpoint breakpoint : breakpoints) {
breakpoint.markVerified(requestManager.isVerified(breakpoint));
requestManager.deleteRequest(breakpoint);
}
SwingUtilities.invokeLater(this::updateBreakpointsUI);
}
}
use of com.intellij.debugger.engine.requests.RequestManagerImpl in project intellij-community by JetBrains.
the class ExceptionBreakpoint method processClassPrepare.
public void processClassPrepare(DebugProcess process, ReferenceType refType) {
DebugProcessImpl debugProcess = (DebugProcessImpl) process;
if (shouldCreateRequest(debugProcess, true)) {
// trying to create a request
RequestManagerImpl manager = debugProcess.getRequestsManager();
manager.enableRequest(manager.createExceptionRequest(this, refType, isNotifyCaught(), isNotifyUncaught()));
if (LOG.isDebugEnabled()) {
if (refType != null) {
LOG.debug("Created exception request for reference type " + refType.name());
} else {
LOG.debug("Created exception request for reference type null");
}
}
}
}
use of com.intellij.debugger.engine.requests.RequestManagerImpl in project intellij-community by JetBrains.
the class DebuggerUtilsEx method getEventDescriptors.
@NotNull
public static List<Pair<Breakpoint, Event>> getEventDescriptors(@Nullable SuspendContextImpl suspendContext) {
DebuggerManagerThreadImpl.assertIsManagerThread();
if (suspendContext != null) {
EventSet events = suspendContext.getEventSet();
if (!ContainerUtil.isEmpty(events)) {
List<Pair<Breakpoint, Event>> eventDescriptors = ContainerUtil.newSmartList();
RequestManagerImpl requestManager = suspendContext.getDebugProcess().getRequestsManager();
for (Event event : events) {
Requestor requestor = requestManager.findRequestor(event.request());
if (requestor instanceof Breakpoint) {
eventDescriptors.add(Pair.create((Breakpoint) requestor, event));
}
}
return eventDescriptors;
}
}
return Collections.emptyList();
}
use of com.intellij.debugger.engine.requests.RequestManagerImpl in project intellij-community by JetBrains.
the class MethodBreakpoint method createRequestForSubClasses.
private static void createRequestForSubClasses(@NotNull MethodBreakpointBase breakpoint, @NotNull DebugProcessImpl debugProcess, @NotNull ReferenceType baseType) {
DebuggerManagerThreadImpl.assertIsManagerThread();
RequestManagerImpl requestsManager = debugProcess.getRequestsManager();
ClassPrepareRequest request = requestsManager.createClassPrepareRequest((debuggerProcess, referenceType) -> {
if (instanceOf(referenceType, baseType)) {
createRequestForPreparedClassEmulated(breakpoint, debugProcess, referenceType, false);
}
}, null);
if (request != null) {
requestsManager.registerRequest(breakpoint, request);
request.enable();
// to force reload classes available so far
debugProcess.getVirtualMachineProxy().clearCaches();
}
AtomicReference<ProgressIndicator> indicatorRef = new AtomicReference<>();
ApplicationManager.getApplication().invokeAndWait(() -> indicatorRef.set(new ProgressWindowWithNotification(true, false, debugProcess.getProject(), "Cancel emulation")));
ProgressIndicator indicator = indicatorRef.get();
ProgressManager.getInstance().executeProcessUnderProgress(() -> processPreparedSubTypes(baseType, subType -> createRequestForPreparedClassEmulated(breakpoint, debugProcess, subType, false), indicator), indicator);
if (indicator.isCanceled()) {
breakpoint.disableEmulation();
}
}
Aggregations