Search in sources :

Example 1 with MethodExitEvent

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

the class MethodBreakpoint method getEventMessage.

public String getEventMessage(@NotNull LocatableEvent event) {
    final Location location = event.location();
    final String locationQName = DebuggerUtilsEx.getLocationMethodQName(location);
    String locationFileName;
    try {
        locationFileName = location.sourceName();
    } catch (AbsentInformationException e) {
        locationFileName = getFileName();
    }
    final int locationLine = location.lineNumber();
    if (event instanceof MethodEntryEvent) {
        MethodEntryEvent entryEvent = (MethodEntryEvent) event;
        final Method method = entryEvent.method();
        return DebuggerBundle.message("status.method.entry.breakpoint.reached", method.declaringType().name() + "." + method.name() + "()", locationQName, locationFileName, locationLine);
    }
    if (event instanceof MethodExitEvent) {
        MethodExitEvent exitEvent = (MethodExitEvent) event;
        final Method method = exitEvent.method();
        return DebuggerBundle.message("status.method.exit.breakpoint.reached", method.declaringType().name() + "." + method.name() + "()", locationQName, locationFileName, locationLine);
    }
    return "";
}
Also used : MethodExitEvent(com.sun.jdi.event.MethodExitEvent) XBreakpoint(com.intellij.xdebugger.breakpoints.XBreakpoint) MethodEntryEvent(com.sun.jdi.event.MethodEntryEvent)

Example 2 with MethodExitEvent

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

the class WildcardMethodBreakpoint method getEventMessage.

public String getEventMessage(LocatableEvent event) {
    final Location location = event.location();
    final String locationQName = DebuggerUtilsEx.getLocationMethodQName(location);
    String locationFileName;
    try {
        locationFileName = location.sourceName();
    } catch (AbsentInformationException e) {
        locationFileName = "";
    }
    final int locationLine = location.lineNumber();
    if (event instanceof MethodEntryEvent) {
        MethodEntryEvent entryEvent = (MethodEntryEvent) event;
        final Method method = entryEvent.method();
        return DebuggerBundle.message("status.method.entry.breakpoint.reached", method.declaringType().name() + "." + method.name() + "()", locationQName, locationFileName, locationLine);
    }
    if (event instanceof MethodExitEvent) {
        MethodExitEvent exitEvent = (MethodExitEvent) event;
        final Method method = exitEvent.method();
        return DebuggerBundle.message("status.method.exit.breakpoint.reached", method.declaringType().name() + "." + method.name() + "()", locationQName, locationFileName, locationLine);
    }
    return "";
}
Also used : AbsentInformationException(com.sun.jdi.AbsentInformationException) Method(com.sun.jdi.Method) MethodExitEvent(com.sun.jdi.event.MethodExitEvent) XBreakpoint(com.intellij.xdebugger.breakpoints.XBreakpoint) Location(com.sun.jdi.Location) MethodEntryEvent(com.sun.jdi.event.MethodEntryEvent)

Aggregations

XBreakpoint (com.intellij.xdebugger.breakpoints.XBreakpoint)2 MethodEntryEvent (com.sun.jdi.event.MethodEntryEvent)2 MethodExitEvent (com.sun.jdi.event.MethodExitEvent)2 AbsentInformationException (com.sun.jdi.AbsentInformationException)1 Location (com.sun.jdi.Location)1 Method (com.sun.jdi.Method)1