Search in sources :

Example 1 with MethodEntryEvent

use of com.sun.jdi.event.MethodEntryEvent 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 MethodEntryEvent

use of com.sun.jdi.event.MethodEntryEvent 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)

Example 3 with MethodEntryEvent

use of com.sun.jdi.event.MethodEntryEvent in project warn-report by saaavsaaa.

the class debugger method execute.

private static void execute(Event event) throws Exception {
    if (event instanceof VMStartEvent) {
        System.out.println("VM started");
        eventSet.resume();
    } else if (event instanceof BreakpointEvent) {
        System.out.println("Reach Method printHello of test.Test");
        eventSet.resume();
    } else if (event instanceof MethodEntryEvent) {
        MethodEntryEvent mee = (MethodEntryEvent) event;
        Method method = mee.method();
        System.out.println(method.name() + " was Entered!");
        eventSet.resume();
    } else if (event instanceof VMDisconnectEvent) {
        vmExit = true;
    } else {
        eventSet.resume();
    }
}
Also used : BreakpointEvent(com.sun.jdi.event.BreakpointEvent) VMDisconnectEvent(com.sun.jdi.event.VMDisconnectEvent) VMStartEvent(com.sun.jdi.event.VMStartEvent) Method(com.sun.jdi.Method) MethodEntryEvent(com.sun.jdi.event.MethodEntryEvent)

Aggregations

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