test/jdk/com/sun/jdi/TestScaffold.java
changeset 52068 218b5b64f102
parent 47216 71c04702a3d5
child 52365 45e3d52aaced
equal deleted inserted replaced
52067:2e72562697bf 52068:218b5b64f102
     1 /*
     1 /*
     2  * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
   782     public StepEvent stepOut(ThreadReference thread) {
   782     public StepEvent stepOut(ThreadReference thread) {
   783         return doStep(thread, StepRequest.STEP_LINE, StepRequest.STEP_OUT);
   783         return doStep(thread, StepRequest.STEP_LINE, StepRequest.STEP_OUT);
   784     }
   784     }
   785 
   785 
   786     public BreakpointEvent resumeTo(Location loc) {
   786     public BreakpointEvent resumeTo(Location loc) {
       
   787         return resumeTo(loc, false);
       
   788     }
       
   789 
       
   790     public BreakpointEvent resumeTo(Location loc, boolean suspendThread) {
   787         final BreakpointRequest request =
   791         final BreakpointRequest request =
   788             requestManager.createBreakpointRequest(loc);
   792                 requestManager.createBreakpointRequest(loc);
   789         request.addCountFilter(1);
   793         request.addCountFilter(1);
       
   794         if (suspendThread) {
       
   795             request.setSuspendPolicy(EventRequest.SUSPEND_EVENT_THREAD);
       
   796         }
   790         request.enable();
   797         request.enable();
   791         return (BreakpointEvent)waitForRequestedEvent(request);
   798         return (BreakpointEvent)waitForRequestedEvent(request);
   792     }
   799     }
   793 
   800 
   794     public ReferenceType findReferenceType(String name) {
   801     public ReferenceType findReferenceType(String name) {
   843 
   850 
   844         return resumeTo(method.location());
   851         return resumeTo(method.location());
   845     }
   852     }
   846 
   853 
   847     public BreakpointEvent resumeTo(String clsName, int lineNumber) throws AbsentInformationException {
   854     public BreakpointEvent resumeTo(String clsName, int lineNumber) throws AbsentInformationException {
       
   855         return resumeTo(clsName, lineNumber, false);
       
   856     }
       
   857 
       
   858     public BreakpointEvent resumeTo(String clsName, int lineNumber, boolean suspendThread) throws AbsentInformationException {
   848         ReferenceType rt = findReferenceType(clsName);
   859         ReferenceType rt = findReferenceType(clsName);
   849         if (rt == null) {
   860         if (rt == null) {
   850             rt = resumeToPrepareOf(clsName).referenceType();
   861             rt = resumeToPrepareOf(clsName).referenceType();
   851         }
   862         }
   852 
   863 
   853         return resumeTo(findLocation(rt, lineNumber));
   864         return resumeTo(findLocation(rt, lineNumber), suspendThread);
   854     }
   865     }
   855 
   866 
   856     public ClassPrepareEvent resumeToPrepareOf(String className) {
   867     public ClassPrepareEvent resumeToPrepareOf(String className) {
   857         final ClassPrepareRequest request =
   868         final ClassPrepareRequest request =
   858             requestManager.createClassPrepareRequest();
   869             requestManager.createClassPrepareRequest();