use of com.intellij.debugger.ui.breakpoints.Breakpoint in project intellij-community by JetBrains.
the class BreakpointsContextProvider method clearContext.
public void clearContext() {
final BreakpointManager breakpointManager = ((DebuggerManagerEx) myDebuggerManager).getBreakpointManager();
List<Breakpoint> breakpoints = breakpointManager.getBreakpoints();
for (final Breakpoint breakpoint : breakpoints) {
ApplicationManager.getApplication().runWriteAction(() -> breakpointManager.removeBreakpoint(breakpoint));
}
}
use of com.intellij.debugger.ui.breakpoints.Breakpoint in project intellij-community by JetBrains.
the class XBreakpointGroupingByClassRule method getGroup.
@Override
public XBreakpointClassGroup getGroup(@NotNull B b, @NotNull Collection<XBreakpointClassGroup> groups) {
if (b instanceof XBreakpoint) {
Breakpoint javaBreakpoint = BreakpointManager.getJavaBreakpoint((XBreakpoint) b);
if (javaBreakpoint == null) {
return null;
}
String className = javaBreakpoint.getShortClassName();
String packageName = javaBreakpoint.getPackageName();
if (className == null) {
return null;
}
for (XBreakpointClassGroup group : groups) {
if (group.getClassName().equals(className) && group.getPackageName().equals(packageName)) {
return group;
}
}
return new XBreakpointClassGroup(packageName, className);
}
return null;
}
use of com.intellij.debugger.ui.breakpoints.Breakpoint in project intellij-community by JetBrains.
the class JavaStackFrame method buildVariablesThreadAction.
// copied from DebuggerTree
private void buildVariablesThreadAction(DebuggerContextImpl debuggerContext, XValueChildrenList children, XCompositeNode node) {
try {
final EvaluationContextImpl evaluationContext = debuggerContext.createEvaluationContext();
if (evaluationContext == null) {
return;
}
if (!debuggerContext.isEvaluationPossible()) {
node.setErrorMessage(MessageDescriptor.EVALUATION_NOT_POSSIBLE.getLabel());
//myChildren.add(myNodeManager.createNode(MessageDescriptor.EVALUATION_NOT_POSSIBLE, evaluationContext));
}
final Location location = myDescriptor.getLocation();
final ObjectReference thisObjectReference = myDescriptor.getThisObject();
if (thisObjectReference != null) {
ValueDescriptorImpl thisDescriptor = myNodeManager.getThisDescriptor(null, thisObjectReference);
children.add(JavaValue.create(thisDescriptor, evaluationContext, myNodeManager));
} else if (location != null) {
StaticDescriptorImpl staticDecriptor = myNodeManager.getStaticDescriptor(myDescriptor, location.declaringType());
if (staticDecriptor.isExpandable()) {
children.addTopGroup(new JavaStaticGroup(staticDecriptor, evaluationContext, myNodeManager));
}
}
DebugProcessImpl debugProcess = debuggerContext.getDebugProcess();
if (debugProcess == null) {
return;
}
// add last method return value if any
final Pair<Method, Value> methodValuePair = debugProcess.getLastExecutedMethod();
if (methodValuePair != null && myDescriptor.getUiIndex() == 0) {
ValueDescriptorImpl returnValueDescriptor = myNodeManager.getMethodReturnValueDescriptor(myDescriptor, methodValuePair.getFirst(), methodValuePair.getSecond());
children.add(JavaValue.create(returnValueDescriptor, evaluationContext, myNodeManager));
}
// add context exceptions
Set<ObjectReference> exceptions = new HashSet<>();
for (Pair<Breakpoint, Event> pair : DebuggerUtilsEx.getEventDescriptors(debuggerContext.getSuspendContext())) {
Event debugEvent = pair.getSecond();
if (debugEvent instanceof ExceptionEvent) {
ObjectReference exception = ((ExceptionEvent) debugEvent).exception();
if (exception != null) {
exceptions.add(exception);
}
}
}
exceptions.forEach(e -> children.add(JavaValue.create(myNodeManager.getThrownExceptionObjectDescriptor(myDescriptor, e), evaluationContext, myNodeManager)));
try {
buildVariables(debuggerContext, evaluationContext, debugProcess, children, thisObjectReference, location);
//if (classRenderer.SORT_ASCENDING) {
// Collections.sort(myChildren, NodeManagerImpl.getNodeComparator());
//}
} catch (EvaluateException e) {
node.setErrorMessage(e.getMessage());
//myChildren.add(myNodeManager.createMessageNode(new MessageDescriptor(e.getMessage())));
}
} catch (InvalidStackFrameException e) {
LOG.info(e);
//myChildren.clear();
//notifyCancelled();
} catch (InternalException e) {
if (e.errorCode() == 35) {
node.setErrorMessage(DebuggerBundle.message("error.corrupt.debug.info", e.getMessage()));
//myChildren.add(
// myNodeManager.createMessageNode(new MessageDescriptor(DebuggerBundle.message("error.corrupt.debug.info", e.getMessage()))));
} else {
throw e;
}
}
}
use of com.intellij.debugger.ui.breakpoints.Breakpoint 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.ui.breakpoints.Breakpoint 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