com.sun.jdi.event.BreakpointEvent Java Examples

The following examples show how to use com.sun.jdi.event.BreakpointEvent. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: LambdaBreakpointTest.java    From dragonwell8_jdk with GNU General Public License v2.0 6 votes vote down vote up
/********** test core **********/

    protected void runTests()
        throws Exception
    {
        startToMain("LambdaBreakpointTestTarg");

        // Put a breakpoint on each location in the order they should happen
        for (int line : LambdaBreakpointTestTarg.breakpointLines) {
            System.out.println("Running to line: " + line);
            BreakpointEvent be = resumeTo("LambdaBreakpointTestTarg", line);
            int stoppedAt = be.location().lineNumber();
            System.out.println("Stopped at line: " + stoppedAt);
            if (stoppedAt != line) {
                throw new Exception("Stopped on the wrong line: "
                        + stoppedAt + " != " + line);
            }
        }

        /*
         * resume the target listening for events
         */
        listenUntilVMDisconnect();
    }
 
Example #2
Source File: LambdaBreakpointTest.java    From jdk8u-dev-jdk with GNU General Public License v2.0 6 votes vote down vote up
/********** test core **********/

    protected void runTests()
        throws Exception
    {
        startToMain("LambdaBreakpointTestTarg");

        // Put a breakpoint on each location in the order they should happen
        for (int line : LambdaBreakpointTestTarg.breakpointLines) {
            System.out.println("Running to line: " + line);
            BreakpointEvent be = resumeTo("LambdaBreakpointTestTarg", line);
            int stoppedAt = be.location().lineNumber();
            System.out.println("Stopped at line: " + stoppedAt);
            if (stoppedAt != line) {
                throw new Exception("Stopped on the wrong line: "
                        + stoppedAt + " != " + line);
            }
        }

        /*
         * resume the target listening for events
         */
        listenUntilVMDisconnect();
    }
 
Example #3
Source File: GetUninitializedStringValue.java    From jdk8u-dev-jdk with GNU General Public License v2.0 6 votes vote down vote up
/********** test core **********/

    protected void runTests()
        throws Exception
    {
        /*
         * Run to String.<init>
         */
        startUp("GetUninitializedStringValueTarg");
        BreakpointEvent bpe = resumeTo("java.lang.String", "<init>", "(Ljava/lang/String;)V");

        /*
         * We've arrived. Look at 'this' - it will be uninitialized (the value field will not be set yet).
         */
        StackFrame frame = bpe.thread().frame(0);
        StringReference sr = (StringReference)frame.thisObject();
        if (!sr.value().equals("")) {
            throw new Exception("Unexpected value for the uninitialized String");
        }

        /*
         * resume the target listening for events
         */
        listenUntilVMDisconnect();
    }
 
Example #4
Source File: LambdaBreakpointTest.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
/********** test core **********/

    protected void runTests()
        throws Exception
    {
        startToMain("LambdaBreakpointTestTarg");

        // Put a breakpoint on each location in the order they should happen
        for (int line : LambdaBreakpointTestTarg.breakpointLines) {
            System.out.println("Running to line: " + line);
            BreakpointEvent be = resumeTo("LambdaBreakpointTestTarg", line);
            int stoppedAt = be.location().lineNumber();
            System.out.println("Stopped at line: " + stoppedAt);
            if (stoppedAt != line) {
                throw new Exception("Stopped on the wrong line: "
                        + stoppedAt + " != " + line);
            }
        }

        /*
         * resume the target listening for events
         */
        listenUntilVMDisconnect();
    }
 
Example #5
Source File: GetUninitializedStringValue.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
/********** test core **********/

    protected void runTests()
        throws Exception
    {
        /*
         * Run to String.<init>
         */
        startUp("GetUninitializedStringValueTarg");
        BreakpointEvent bpe = resumeTo("java.lang.String", "<init>", "(Ljava/lang/String;)V");

        /*
         * We've arrived. Look at 'this' - it will be uninitialized (the value field will not be set yet).
         */
        StackFrame frame = bpe.thread().frame(0);
        StringReference sr = (StringReference)frame.thisObject();
        if (!sr.value().equals("")) {
            throw new Exception("Unexpected value for the uninitialized String");
        }

        /*
         * resume the target listening for events
         */
        listenUntilVMDisconnect();
    }
 
Example #6
Source File: LambdaBreakpointTest.java    From jdk8u_jdk with GNU General Public License v2.0 6 votes vote down vote up
/********** test core **********/

    protected void runTests()
        throws Exception
    {
        startToMain("LambdaBreakpointTestTarg");

        // Put a breakpoint on each location in the order they should happen
        for (int line : LambdaBreakpointTestTarg.breakpointLines) {
            System.out.println("Running to line: " + line);
            BreakpointEvent be = resumeTo("LambdaBreakpointTestTarg", line);
            int stoppedAt = be.location().lineNumber();
            System.out.println("Stopped at line: " + stoppedAt);
            if (stoppedAt != line) {
                throw new Exception("Stopped on the wrong line: "
                        + stoppedAt + " != " + line);
            }
        }

        /*
         * resume the target listening for events
         */
        listenUntilVMDisconnect();
    }
 
Example #7
Source File: GetUninitializedStringValue.java    From jdk8u_jdk with GNU General Public License v2.0 6 votes vote down vote up
/********** test core **********/

    protected void runTests()
        throws Exception
    {
        /*
         * Run to String.<init>
         */
        startUp("GetUninitializedStringValueTarg");
        BreakpointEvent bpe = resumeTo("java.lang.String", "<init>", "(Ljava/lang/String;)V");

        /*
         * We've arrived. Look at 'this' - it will be uninitialized (the value field will not be set yet).
         */
        StackFrame frame = bpe.thread().frame(0);
        StringReference sr = (StringReference)frame.thisObject();
        if (!sr.value().equals("")) {
            throw new Exception("Unexpected value for the uninitialized String");
        }

        /*
         * resume the target listening for events
         */
        listenUntilVMDisconnect();
    }
 
Example #8
Source File: LambdaBreakpointTest.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/********** test core **********/

    protected void runTests()
        throws Exception
    {
        startToMain("LambdaBreakpointTestTarg");

        // Put a breakpoint on each location in the order they should happen
        for (int line : LambdaBreakpointTestTarg.breakpointLines) {
            System.out.println("Running to line: " + line);
            BreakpointEvent be = resumeTo("LambdaBreakpointTestTarg", line);
            int stoppedAt = be.location().lineNumber();
            System.out.println("Stopped at line: " + stoppedAt);
            if (stoppedAt != line) {
                throw new Exception("Stopped on the wrong line: "
                        + stoppedAt + " != " + line);
            }
        }

        /*
         * resume the target listening for events
         */
        listenUntilVMDisconnect();
    }
 
Example #9
Source File: GetUninitializedStringValue.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/********** test core **********/

    protected void runTests()
        throws Exception
    {
        /*
         * Run to String.<init>
         */
        startUp("GetUninitializedStringValueTarg");
        BreakpointEvent bpe = resumeTo("java.lang.String", "<init>", "(Ljava/lang/String;)V");

        /*
         * We've arrived. Look at 'this' - it will be uninitialized (the value field will not be set yet).
         */
        StackFrame frame = bpe.thread().frame(0);
        StringReference sr = (StringReference)frame.thisObject();
        if (!sr.value().equals("")) {
            throw new Exception("Unexpected value for the uninitialized String");
        }

        /*
         * resume the target listening for events
         */
        listenUntilVMDisconnect();
    }
 
Example #10
Source File: LambdaBreakpointTest.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
/********** test core **********/

    protected void runTests()
        throws Exception
    {
        startToMain("LambdaBreakpointTestTarg");

        // Put a breakpoint on each location in the order they should happen
        for (int line : LambdaBreakpointTestTarg.breakpointLines) {
            System.out.println("Running to line: " + line);
            BreakpointEvent be = resumeTo("LambdaBreakpointTestTarg", line);
            int stoppedAt = be.location().lineNumber();
            System.out.println("Stopped at line: " + stoppedAt);
            if (stoppedAt != line) {
                throw new Exception("Stopped on the wrong line: "
                        + stoppedAt + " != " + line);
            }
        }

        /*
         * resume the target listening for events
         */
        listenUntilVMDisconnect();
    }
 
Example #11
Source File: GetUninitializedStringValue.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
/********** test core **********/

    protected void runTests()
        throws Exception
    {
        /*
         * Run to String.<init>
         */
        startUp("GetUninitializedStringValueTarg");
        BreakpointEvent bpe = resumeTo("java.lang.String", "<init>", "(Ljava/lang/String;)V");

        /*
         * We've arrived. Look at 'this' - it will be uninitialized (the value field will not be set yet).
         */
        StackFrame frame = bpe.thread().frame(0);
        StringReference sr = (StringReference)frame.thisObject();
        if (!sr.value().equals("")) {
            throw new Exception("Unexpected value for the uninitialized String");
        }

        /*
         * resume the target listening for events
         */
        listenUntilVMDisconnect();
    }
 
Example #12
Source File: LambdaBreakpointTest.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/********** test core **********/

    protected void runTests()
        throws Exception
    {
        startToMain("LambdaBreakpointTestTarg");

        // Put a breakpoint on each location in the order they should happen
        for (int line : LambdaBreakpointTestTarg.breakpointLines) {
            System.out.println("Running to line: " + line);
            BreakpointEvent be = resumeTo("LambdaBreakpointTestTarg", line);
            int stoppedAt = be.location().lineNumber();
            System.out.println("Stopped at line: " + stoppedAt);
            if (stoppedAt != line) {
                throw new Exception("Stopped on the wrong line: "
                        + stoppedAt + " != " + line);
            }
        }

        /*
         * resume the target listening for events
         */
        listenUntilVMDisconnect();
    }
 
Example #13
Source File: GetUninitializedStringValue.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/********** test core **********/

    protected void runTests()
        throws Exception
    {
        /*
         * Run to String.<init>
         */
        startUp("GetUninitializedStringValueTarg");
        BreakpointEvent bpe = resumeTo("java.lang.String", "<init>", "(Ljava/lang/String;)V");

        /*
         * We've arrived. Look at 'this' - it will be uninitialized (the value field will not be set yet).
         */
        StackFrame frame = bpe.thread().frame(0);
        StringReference sr = (StringReference)frame.thisObject();
        if (!sr.value().equals("")) {
            throw new Exception("Unexpected value for the uninitialized String");
        }

        /*
         * resume the target listening for events
         */
        listenUntilVMDisconnect();
    }
 
Example #14
Source File: SetBreakpointsRequestHandler.java    From java-debug with Eclipse Public License 1.0 6 votes vote down vote up
private void reinstallBreakpoints(IDebugAdapterContext context, List<String> typenames) {
    if (typenames == null || typenames.isEmpty()) {
        return;
    }
    IBreakpoint[] breakpoints = context.getBreakpointManager().getBreakpoints();

    for (IBreakpoint breakpoint : breakpoints) {
        if (typenames.contains(breakpoint.className())) {
            try {
                breakpoint.close();
                breakpoint.install().thenAccept(bp -> {
                    Events.BreakpointEvent bpEvent = new Events.BreakpointEvent("new", this.convertDebuggerBreakpointToClient(bp, context));
                    context.getProtocolServer().sendEvent(bpEvent);
                });
            } catch (Exception e) {
                logger.log(Level.SEVERE, String.format("Remove breakpoint exception: %s", e.toString()), e);
            }
        }
    }
}
 
Example #15
Source File: GetUninitializedStringValue.java    From dragonwell8_jdk with GNU General Public License v2.0 6 votes vote down vote up
/********** test core **********/

    protected void runTests()
        throws Exception
    {
        /*
         * Run to String.<init>
         */
        startUp("GetUninitializedStringValueTarg");
        BreakpointEvent bpe = resumeTo("java.lang.String", "<init>", "(Ljava/lang/String;)V");

        /*
         * We've arrived. Look at 'this' - it will be uninitialized (the value field will not be set yet).
         */
        StackFrame frame = bpe.thread().frame(0);
        StringReference sr = (StringReference)frame.thisObject();
        if (!sr.value().equals("")) {
            throw new Exception("Unexpected value for the uninitialized String");
        }

        /*
         * resume the target listening for events
         */
        listenUntilVMDisconnect();
    }
 
Example #16
Source File: LambdaBreakpointTest.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
/********** test core **********/

    protected void runTests()
        throws Exception
    {
        startToMain("LambdaBreakpointTestTarg");

        // Put a breakpoint on each location in the order they should happen
        for (int line : LambdaBreakpointTestTarg.breakpointLines) {
            System.out.println("Running to line: " + line);
            BreakpointEvent be = resumeTo("LambdaBreakpointTestTarg", line);
            int stoppedAt = be.location().lineNumber();
            System.out.println("Stopped at line: " + stoppedAt);
            if (stoppedAt != line) {
                throw new Exception("Stopped on the wrong line: "
                        + stoppedAt + " != " + line);
            }
        }

        /*
         * resume the target listening for events
         */
        listenUntilVMDisconnect();
    }
 
Example #17
Source File: GetUninitializedStringValue.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
/********** test core **********/

    protected void runTests()
        throws Exception
    {
        /*
         * Run to String.<init>
         */
        startUp("GetUninitializedStringValueTarg");
        BreakpointEvent bpe = resumeTo("java.lang.String", "<init>", "(Ljava/lang/String;)V");

        /*
         * We've arrived. Look at 'this' - it will be uninitialized (the value field will not be set yet).
         */
        StackFrame frame = bpe.thread().frame(0);
        StringReference sr = (StringReference)frame.thisObject();
        if (!sr.value().equals("")) {
            throw new Exception("Unexpected value for the uninitialized String");
        }

        /*
         * resume the target listening for events
         */
        listenUntilVMDisconnect();
    }
 
Example #18
Source File: LambdaBreakpointTest.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/********** test core **********/

    protected void runTests()
        throws Exception
    {
        startToMain("LambdaBreakpointTestTarg");

        // Put a breakpoint on each location in the order they should happen
        for (int line : BKPT_LINES) {
            System.out.println("Running to line: " + line);
            BreakpointEvent be = resumeTo("LambdaBreakpointTestTarg", line);
            int stoppedAt = be.location().lineNumber();
            System.out.println("Stopped at line: " + stoppedAt);
            if (stoppedAt != line) {
                throw new Exception("Stopped on the wrong line: "
                        + stoppedAt + " != " + line);
            }
        }

        /*
         * resume the target listening for events
         */
        listenUntilVMDisconnect();
    }
 
Example #19
Source File: GetUninitializedStringValue.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/********** test core **********/

    protected void runTests()
        throws Exception
    {
        /*
         * Run to String.<init>
         */
        startUp("GetUninitializedStringValueTarg");
        BreakpointEvent bpe = resumeTo("java.lang.String", "<init>", "(Ljava/lang/String;)V");

        /*
         * We've arrived. Look at 'this' - it will be uninitialized (the value field will not be set yet).
         */
        StackFrame frame = bpe.thread().frame(0);
        StringReference sr = (StringReference)frame.thisObject();
        if (!sr.value().equals("")) {
            throw new Exception("Unexpected value for the uninitialized String");
        }

        /*
         * resume the target listening for events
         */
        listenUntilVMDisconnect();
    }
 
Example #20
Source File: LambdaBreakpointTest.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/********** test core **********/

    protected void runTests()
        throws Exception
    {
        startToMain("LambdaBreakpointTestTarg");

        // Put a breakpoint on each location in the order they should happen
        for (int line : LambdaBreakpointTestTarg.breakpointLines) {
            System.out.println("Running to line: " + line);
            BreakpointEvent be = resumeTo("LambdaBreakpointTestTarg", line);
            int stoppedAt = be.location().lineNumber();
            System.out.println("Stopped at line: " + stoppedAt);
            if (stoppedAt != line) {
                throw new Exception("Stopped on the wrong line: "
                        + stoppedAt + " != " + line);
            }
        }

        /*
         * resume the target listening for events
         */
        listenUntilVMDisconnect();
    }
 
Example #21
Source File: GetUninitializedStringValue.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/********** test core **********/

    protected void runTests()
        throws Exception
    {
        /*
         * Run to String.<init>
         */
        startUp("GetUninitializedStringValueTarg");
        BreakpointEvent bpe = resumeTo("java.lang.String", "<init>", "(Ljava/lang/String;)V");

        /*
         * We've arrived. Look at 'this' - it will be uninitialized (the value field will not be set yet).
         */
        StackFrame frame = bpe.thread().frame(0);
        StringReference sr = (StringReference)frame.thisObject();
        if (!sr.value().equals("")) {
            throw new Exception("Unexpected value for the uninitialized String");
        }

        /*
         * resume the target listening for events
         */
        listenUntilVMDisconnect();
    }
 
Example #22
Source File: LambdaBreakpointTest.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/********** test core **********/

    protected void runTests()
        throws Exception
    {
        startToMain("LambdaBreakpointTestTarg");

        // Put a breakpoint on each location in the order they should happen
        for (int line : LambdaBreakpointTestTarg.breakpointLines) {
            System.out.println("Running to line: " + line);
            BreakpointEvent be = resumeTo("LambdaBreakpointTestTarg", line);
            int stoppedAt = be.location().lineNumber();
            System.out.println("Stopped at line: " + stoppedAt);
            if (stoppedAt != line) {
                throw new Exception("Stopped on the wrong line: "
                        + stoppedAt + " != " + line);
            }
        }

        /*
         * resume the target listening for events
         */
        listenUntilVMDisconnect();
    }
 
Example #23
Source File: GetUninitializedStringValue.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/********** test core **********/

    protected void runTests()
        throws Exception
    {
        /*
         * Run to String.<init>
         */
        startUp("GetUninitializedStringValueTarg");
        BreakpointEvent bpe = resumeTo("java.lang.String", "<init>", "(Ljava/lang/String;)V");

        /*
         * We've arrived. Look at 'this' - it will be uninitialized (the value field will not be set yet).
         */
        StackFrame frame = bpe.thread().frame(0);
        StringReference sr = (StringReference)frame.thisObject();
        if (!sr.value().equals("")) {
            throw new Exception("Unexpected value for the uninitialized String");
        }

        /*
         * resume the target listening for events
         */
        listenUntilVMDisconnect();
    }
 
Example #24
Source File: LambdaBreakpointTest.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/********** test core **********/

    protected void runTests()
        throws Exception
    {
        startToMain("LambdaBreakpointTestTarg");

        // Put a breakpoint on each location in the order they should happen
        for (int line : LambdaBreakpointTestTarg.breakpointLines) {
            System.out.println("Running to line: " + line);
            BreakpointEvent be = resumeTo("LambdaBreakpointTestTarg", line);
            int stoppedAt = be.location().lineNumber();
            System.out.println("Stopped at line: " + stoppedAt);
            if (stoppedAt != line) {
                throw new Exception("Stopped on the wrong line: "
                        + stoppedAt + " != " + line);
            }
        }

        /*
         * resume the target listening for events
         */
        listenUntilVMDisconnect();
    }
 
Example #25
Source File: GetUninitializedStringValue.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/********** test core **********/

    protected void runTests()
        throws Exception
    {
        /*
         * Run to String.<init>
         */
        startUp("GetUninitializedStringValueTarg");
        BreakpointEvent bpe = resumeTo("java.lang.String", "<init>", "(Ljava/lang/String;)V");

        /*
         * We've arrived. Look at 'this' - it will be uninitialized (the value field will not be set yet).
         */
        StackFrame frame = bpe.thread().frame(0);
        StringReference sr = (StringReference)frame.thisObject();
        if (!sr.value().equals("")) {
            throw new Exception("Unexpected value for the uninitialized String");
        }

        /*
         * resume the target listening for events
         */
        listenUntilVMDisconnect();
    }
 
Example #26
Source File: LambdaBreakpointTest.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/********** test core **********/

    protected void runTests()
        throws Exception
    {
        startToMain("LambdaBreakpointTestTarg");

        // Put a breakpoint on each location in the order they should happen
        for (int line : LambdaBreakpointTestTarg.breakpointLines) {
            System.out.println("Running to line: " + line);
            BreakpointEvent be = resumeTo("LambdaBreakpointTestTarg", line);
            int stoppedAt = be.location().lineNumber();
            System.out.println("Stopped at line: " + stoppedAt);
            if (stoppedAt != line) {
                throw new Exception("Stopped on the wrong line: "
                        + stoppedAt + " != " + line);
            }
        }

        /*
         * resume the target listening for events
         */
        listenUntilVMDisconnect();
    }
 
Example #27
Source File: GetUninitializedStringValue.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/********** test core **********/

    protected void runTests()
        throws Exception
    {
        /*
         * Run to String.<init>
         */
        startUp("GetUninitializedStringValueTarg");
        BreakpointEvent bpe = resumeTo("java.lang.String", "<init>", "(Ljava/lang/String;)V");

        /*
         * We've arrived. Look at 'this' - it will be uninitialized (the value field will not be set yet).
         */
        StackFrame frame = bpe.thread().frame(0);
        StringReference sr = (StringReference)frame.thisObject();
        if (!sr.value().equals("")) {
            throw new Exception("Unexpected value for the uninitialized String");
        }

        /*
         * resume the target listening for events
         */
        listenUntilVMDisconnect();
    }
 
Example #28
Source File: JDIExampleDebugger.java    From tutorials with MIT License 5 votes vote down vote up
/**
 * Enables step request for a break point
 * @param vm
 * @param event
 */
public void enableStepRequest(VirtualMachine vm, BreakpointEvent event) {
    //enable step request for last break point
    if(event.location().toString().contains(debugClass.getName()+":"+breakPointLines[breakPointLines.length-1])) {
        StepRequest stepRequest = vm.eventRequestManager().createStepRequest(event.thread(), StepRequest.STEP_LINE, StepRequest.STEP_OVER);
        stepRequest.enable();    
    }
}
 
Example #29
Source File: DynamothCollector.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
private void processVMEvents() {
	try {
		// process events
		final EventQueue eventQueue = vm.eventQueue();
		while (true) {
			EventSet eventSet = eventQueue.remove(TimeUnit.SECONDS.toMillis(this.dataCollectionTimeoutInSeconds));
			if (eventSet == null)
				return; // timeout
			for (Event event : eventSet) {
				if (event instanceof VMDeathEvent || event instanceof VMDisconnectEvent) {
					// exit
					DebugJUnitRunner.process.destroy();
					// logger.debug("Exit");
					// System.out.println("VM Event: Exit");
					return;
				} else if (event instanceof ClassPrepareEvent) {
					// logger.debug("ClassPrepareEvent");
					// System.out.println("VM event: ClassPrepareEvent");
					processClassPrepareEvent();
				} else if (event instanceof BreakpointEvent) {
					// logger.debug("VM Event: BreakpointEvent");
					// System.out.println("VM BreakpointEvent");
					processBreakPointEvents((BreakpointEvent) event);
				}
			}
			eventSet.resume();
		} // end while true
	} catch (Exception e) {
		System.err.println("Error processing VMEvents");
		e.printStackTrace();
	} finally {
		DebugJUnitRunner.process.destroy();
	}
}
 
Example #30
Source File: SetBreakpointsRequestHandler.java    From java-debug with Eclipse Public License 1.0 5 votes vote down vote up
private IBreakpoint getAssociatedEvaluatableBreakpoint(IDebugAdapterContext context, BreakpointEvent event) {
    return Arrays.asList(context.getBreakpointManager().getBreakpoints()).stream().filter(
        bp -> {
            return bp instanceof IEvaluatableBreakpoint
                && ((IEvaluatableBreakpoint) bp).containsEvaluatableExpression()
                && bp.requests().contains(event.request());
        }
    ).findFirst().orElse(null);
}