1 /* 2 * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 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 7 * published by the Free Software Foundation. 8 * 9 * This code is distributed in the hope that it will be useful, but WITHOUT 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12 * version 2 for more details (a copy is included in the LICENSE file that 13 * accompanied this code). 14 * 15 * You should have received a copy of the GNU General Public License version 16 * 2 along with this work; if not, write to the Free Software Foundation, 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 * 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20 * or visit www.oracle.com if you need additional information or have any 21 * questions. 22 */ 23 24 25 /* 26 * @test 27 * 28 * @summary converted from VM Testbase vm/mlvm/indy/func/jdi/breakpointOtherStratum. 29 * VM Testbase keywords: [feature_mlvm, nonconcurrent, quarantine] 30 * VM Testbase comments: 8199578 31 * VM Testbase readme: 32 * DESCRIPTION 33 * Performs debugging of invokedynamic call in vm.mlvm.share.jdi.INDIFY_Debuggee (with added 34 * source debug information) and verifies that JDI reports correct SDE locations. 35 * 36 * @library /vmTestbase 37 * /test/lib 38 * @run driver jdk.test.lib.FileInstaller . . 39 * 40 * @comment build debuggee class 41 * @build vm.mlvm.share.jdi.IndyDebuggee 42 * 43 * @comment build test class and indify classes 44 * @build vm.mlvm.indy.func.jdi.breakpointOtherStratum.Test 45 * @run driver vm.mlvm.share.IndifiedClassesBuilder 46 * 47 * @comment recompile INDIFY_SDE_DebuggeeBase with Stratum annotation processor 48 * @clean vm.mlvm.share.jpda.INDIFY_SDE_DebuggeeBase 49 * @run driver 50 * vm.mlvm.share.StratumClassesBuilder 51 * vmTestbase/vm/mlvm/share/jpda/INDIFY_SDE_DebuggeeBase.java 52 * 53 * @run main/othervm PropertyResolvingWrapper 54 * vm.mlvm.indy.func.jdi.breakpointOtherStratum.Test 55 * -verbose 56 * -arch=${os.family}-${os.simpleArch} 57 * -waittime=5 58 * -debugee.vmkind=java 59 * -debugee.vmkeys="-cp ./bin/classes${path.separator}${test.class.path}" 60 * -transport.address=dynamic 61 * -debugger.debuggeeClass vm.mlvm.share.jdi.IndyDebuggee 62 */ 63 64 package vm.mlvm.indy.func.jdi.breakpointOtherStratum; 65 66 import vm.mlvm.share.jdi.ArgumentHandler; 67 import vm.mlvm.share.jdi.BreakpointInfo; 68 import vm.mlvm.share.jdi.JDIBreakpointTest; 69 import vm.mlvm.share.jpda.StratumInfo; 70 71 import java.util.ArrayList; 72 import java.util.List; 73 74 public class Test extends JDIBreakpointTest { 75 76 @Override 77 protected List<BreakpointInfo> getBreakpoints(String debuggeeClassName) { 78 List<BreakpointInfo> result = new ArrayList<>(); 79 // indyWrapper:S8000/Logo=INDIFY_SDE_DebuggeeBase.logo:2 80 { 81 BreakpointInfo info = new BreakpointInfo("indyWrapper"); 82 info.stepsToTrace = 8000; 83 info.stratumInfo = new StratumInfo("Logo", "INDIFY_SDE_DebuggeeBase.logo", 2); 84 result.add(info); 85 } 86 // bootstrap/Logo=INDIFY_SDE_DebuggeeBase.logo:3 87 { 88 BreakpointInfo info = new BreakpointInfo("bootstrap"); 89 info.stratumInfo = new StratumInfo("Logo", "INDIFY_SDE_DebuggeeBase.logo", 3); 90 result.add(info); 91 } 92 // target/Logo=INDIFY_SDE_DebuggeeBase.logo:4 93 { 94 BreakpointInfo info = new BreakpointInfo("target"); 95 info.stratumInfo = new StratumInfo("Logo", "INDIFY_SDE_DebuggeeBase.logo", 4); 96 result.add(info); 97 } 98 // stop/Logo=INDIFY_SDE_DebuggeeBase.logo:5 99 { 100 BreakpointInfo info = new BreakpointInfo("stop"); 101 info.stratumInfo = new StratumInfo("Logo", "INDIFY_SDE_DebuggeeBase.logo", 5); 102 result.add(info); 103 } 104 return result; 105 } 106 107 public static void main(String[] args) { 108 launch(new ArgumentHandler(args)); 109 } 110 }