Search in sources :

Example 1 with InternalException

use of com.sun.jdi.InternalException in project intellij-community by JetBrains.

the class DebugProcessEvents method getEventText.

public String getEventText(Pair<Breakpoint, Event> descriptor) {
    String text = "";
    final Event event = descriptor.getSecond();
    final Breakpoint breakpoint = descriptor.getFirst();
    if (event instanceof LocatableEvent) {
        try {
            text = breakpoint != null ? breakpoint.getEventMessage(((LocatableEvent) event)) : DebuggerBundle.message("status.generic.breakpoint.reached");
        } catch (InternalException e) {
            text = DebuggerBundle.message("status.generic.breakpoint.reached");
        }
    } else if (event instanceof VMStartEvent) {
        text = DebuggerBundle.message("status.process.started");
    } else if (event instanceof VMDeathEvent) {
        text = DebuggerBundle.message("status.process.terminated");
    } else if (event instanceof VMDisconnectEvent) {
        final RemoteConnection connection = getConnection();
        final String addressDisplayName = DebuggerBundle.getAddressDisplayName(connection);
        final String transportName = DebuggerBundle.getTransportName(connection);
        text = DebuggerBundle.message("status.disconnected", addressDisplayName, transportName);
    }
    return text;
}
Also used : StackCapturingLineBreakpoint(com.intellij.debugger.ui.breakpoints.StackCapturingLineBreakpoint) XBreakpoint(com.intellij.xdebugger.breakpoints.XBreakpoint) Breakpoint(com.intellij.debugger.ui.breakpoints.Breakpoint) RemoteConnection(com.intellij.execution.configurations.RemoteConnection) InternalException(com.sun.jdi.InternalException)

Example 2 with InternalException

use of com.sun.jdi.InternalException in project intellij-community by JetBrains.

the class NodeManagerImpl method getContextKeyForFrame.

@Nullable
public static String getContextKeyForFrame(final StackFrameProxyImpl frame) {
    if (frame == null) {
        return null;
    }
    try {
        final Location location = frame.location();
        final Method method = DebuggerUtilsEx.getMethod(location);
        if (method == null) {
            return null;
        }
        final ReferenceType referenceType = location.declaringType();
        final StringBuilder builder = StringBuilderSpinAllocator.alloc();
        try {
            return builder.append(referenceType.signature()).append("#").append(method.name()).append(method.signature()).toString();
        } finally {
            StringBuilderSpinAllocator.dispose(builder);
        }
    } catch (EvaluateException ignored) {
    } catch (InternalException ie) {
        if (ie.errorCode() != 23) {
            // INVALID_METHODID
            throw ie;
        }
    }
    return null;
}
Also used : EvaluateException(com.intellij.debugger.engine.evaluation.EvaluateException) Method(com.sun.jdi.Method) ReferenceType(com.sun.jdi.ReferenceType) Location(com.sun.jdi.Location) InternalException(com.sun.jdi.InternalException) Nullable(org.jetbrains.annotations.Nullable)

Aggregations

InternalException (com.sun.jdi.InternalException)2 EvaluateException (com.intellij.debugger.engine.evaluation.EvaluateException)1 Breakpoint (com.intellij.debugger.ui.breakpoints.Breakpoint)1 StackCapturingLineBreakpoint (com.intellij.debugger.ui.breakpoints.StackCapturingLineBreakpoint)1 RemoteConnection (com.intellij.execution.configurations.RemoteConnection)1 XBreakpoint (com.intellij.xdebugger.breakpoints.XBreakpoint)1 Location (com.sun.jdi.Location)1 Method (com.sun.jdi.Method)1 ReferenceType (com.sun.jdi.ReferenceType)1 Nullable (org.jetbrains.annotations.Nullable)1