Search in sources :

Example 1 with Requestor

use of com.intellij.debugger.requests.Requestor 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();
}
Also used : Breakpoint(com.intellij.debugger.ui.breakpoints.Breakpoint) EventSet(com.sun.jdi.event.EventSet) Event(com.sun.jdi.event.Event) Requestor(com.intellij.debugger.requests.Requestor) RequestManagerImpl(com.intellij.debugger.engine.requests.RequestManagerImpl) NotNull(org.jetbrains.annotations.NotNull)

Example 2 with Requestor

use of com.intellij.debugger.requests.Requestor in project intellij-community by JetBrains.

the class RequestManagerImpl method deleteRequest.

public void deleteRequest(Requestor requestor) {
    DebuggerManagerThreadImpl.assertIsManagerThread();
    myRequestWarnings.remove(requestor);
    if (!myDebugProcess.isAttached()) {
        return;
    }
    final Set<EventRequest> requests = myRequestorToBelongedRequests.remove(requestor);
    if (requests == null) {
        return;
    }
    for (final EventRequest request : requests) {
        try {
            final Requestor targetRequestor = (Requestor) request.getProperty(REQUESTOR);
            if (targetRequestor != requestor) {
                // the same request may be assigned to more than one requestor, but
                // there is only one 'targetRequestor' for each request, so if target requestor and requestor being processed are different,
                // should clear also the mapping targetRequestor->request
                Set<EventRequest> allTargetRequestorRequests = myRequestorToBelongedRequests.get(targetRequestor);
                if (allTargetRequestorRequests != null) {
                    allTargetRequestorRequests.remove(request);
                    if (allTargetRequestorRequests.isEmpty()) {
                        myRequestorToBelongedRequests.remove(targetRequestor);
                    }
                }
            }
            try {
                myEventRequestManager.deleteEventRequest(request);
            } catch (ArrayIndexOutOfBoundsException e) {
                LOG.error("Exception in EventRequestManager.deleteEventRequest", e, ThreadDumper.dumpThreadsToString());
            }
        } catch (InvalidRequestStateException ignored) {
        // request is already deleted
        } catch (InternalException e) {
            //noinspection StatementWithEmptyBody
            if (e.errorCode() == 41) {
            //event request not found
            //there could be no requests after hotswap
            } else {
                LOG.info(e);
            }
        }
    }
}
Also used : FilteredRequestor(com.intellij.debugger.ui.breakpoints.FilteredRequestor) Requestor(com.intellij.debugger.requests.Requestor) ClassPrepareRequestor(com.intellij.debugger.requests.ClassPrepareRequestor)

Example 3 with Requestor

use of com.intellij.debugger.requests.Requestor in project intellij-community by JetBrains.

the class DebugProcessEvents method showStatusText.

private static void showStatusText(DebugProcessEvents debugProcess, Event event) {
    Requestor requestor = debugProcess.getRequestsManager().findRequestor(event.request());
    Breakpoint breakpoint = null;
    if (requestor instanceof Breakpoint) {
        breakpoint = (Breakpoint) requestor;
    }
    String text = debugProcess.getEventText(Pair.create(breakpoint, event));
    debugProcess.showStatusText(text);
}
Also used : StackCapturingLineBreakpoint(com.intellij.debugger.ui.breakpoints.StackCapturingLineBreakpoint) XBreakpoint(com.intellij.xdebugger.breakpoints.XBreakpoint) Breakpoint(com.intellij.debugger.ui.breakpoints.Breakpoint) LocatableEventRequestor(com.intellij.debugger.engine.requests.LocatableEventRequestor) Requestor(com.intellij.debugger.requests.Requestor)

Aggregations

Requestor (com.intellij.debugger.requests.Requestor)3 Breakpoint (com.intellij.debugger.ui.breakpoints.Breakpoint)2 LocatableEventRequestor (com.intellij.debugger.engine.requests.LocatableEventRequestor)1 RequestManagerImpl (com.intellij.debugger.engine.requests.RequestManagerImpl)1 ClassPrepareRequestor (com.intellij.debugger.requests.ClassPrepareRequestor)1 FilteredRequestor (com.intellij.debugger.ui.breakpoints.FilteredRequestor)1 StackCapturingLineBreakpoint (com.intellij.debugger.ui.breakpoints.StackCapturingLineBreakpoint)1 XBreakpoint (com.intellij.xdebugger.breakpoints.XBreakpoint)1 Event (com.sun.jdi.event.Event)1 EventSet (com.sun.jdi.event.EventSet)1 NotNull (org.jetbrains.annotations.NotNull)1