Search in sources :

Example 6 with BreakpointEvent

use of com.sun.jdi.event.BreakpointEvent in project jdk8u_jdk by JetBrains.

the class OomDebugTest method runTests.

@Override
protected void runTests() throws Exception {
    try {
        addListener(new TargetAdapter() {

            @Override
            public void exceptionThrown(ExceptionEvent event) {
                String name = event.exception().referenceType().name();
                System.err.println("DEBUG: Exception thrown in debuggee was: " + name);
            }
        });
        /*
             * Get to the top of entry()
             * to determine targetClass and mainThread
             */
        BreakpointEvent bpe = startTo("OomDebugTestTarget", "entry", "()V");
        targetClass = bpe.location().declaringType();
        mainThread = bpe.thread();
        StackFrame frame = mainThread.frame(0);
        thisObject = frame.thisObject();
        java.lang.reflect.Method m = findTestMethod();
        m.invoke(this);
    } catch (NoSuchMethodException e) {
        e.printStackTrace();
        failure();
    } catch (SecurityException e) {
        e.printStackTrace();
        failure();
    }
    /*
         * resume the target, listening for events
         */
    listenUntilVMDisconnect();
}
Also used : ExceptionEvent(com.sun.jdi.event.ExceptionEvent) BreakpointEvent(com.sun.jdi.event.BreakpointEvent) StackFrame(com.sun.jdi.StackFrame)

Aggregations

BreakpointEvent (com.sun.jdi.event.BreakpointEvent)6 StackFrame (com.sun.jdi.StackFrame)4 StringReference (com.sun.jdi.StringReference)2 ThreadReference (com.sun.jdi.ThreadReference)2 VirtualMachine (com.sun.jdi.VirtualMachine)2 EventSet (com.sun.jdi.event.EventSet)2 AbsentInformationException (com.sun.jdi.AbsentInformationException)1 IncompatibleThreadStateException (com.sun.jdi.IncompatibleThreadStateException)1 LocalVariable (com.sun.jdi.LocalVariable)1 Method (com.sun.jdi.Method)1 Value (com.sun.jdi.Value)1 Connector (com.sun.jdi.connect.Connector)1 IllegalConnectorArgumentsException (com.sun.jdi.connect.IllegalConnectorArgumentsException)1 ClassPrepareEvent (com.sun.jdi.event.ClassPrepareEvent)1 Event (com.sun.jdi.event.Event)1 EventQueue (com.sun.jdi.event.EventQueue)1 ExceptionEvent (com.sun.jdi.event.ExceptionEvent)1 StepEvent (com.sun.jdi.event.StepEvent)1 VMDeathEvent (com.sun.jdi.event.VMDeathEvent)1 VMDisconnectEvent (com.sun.jdi.event.VMDisconnectEvent)1