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();
}
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);
}
}
}
}
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);
}
Aggregations