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/meth/func/jdi/breakpointOtherStratum. 29 * VM Testbase keywords: [feature_mlvm, nonconcurrent, fds, jdk, quarantine] 30 * VM Testbase comments: 8079713 8079714 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.MHDebuggee 42 * 43 * @comment build test class and indify classes 44 * @build vm.mlvm.meth.func.jdi.breakpointOtherStratum.Test 45 * @run driver vm.mlvm.share.IndifiedClassesBuilder 46 * 47 * @comment recompile SDE_MHDebuggeeBase with Stratum annotation processor 48 * @clean vm.mlvm.share.jpda.SDE_MHDebuggeeBase 49 * @run driver 50 * vm.mlvm.share.StratumClassesBuilder 51 * vmTestbase/vm/mlvm/share/jpda/SDE_MHDebuggeeBase.java 52 * 53 * @run main/othervm PropertyResolvingWrapper 54 * vm.mlvm.meth.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.MHDebuggee 62 */ 63 64 package vm.mlvm.meth.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 @Override 76 protected List<BreakpointInfo> getBreakpoints(String debuggeeClassName) { 77 List<BreakpointInfo> result = new ArrayList<>(); 78 // invokeMH:S100/Logo=SDE_MHDebuggeeBase.logo:2 79 { 80 BreakpointInfo info = new BreakpointInfo("invokeMH"); 81 info.stepsToTrace = 100; 82 info.stratumInfo = new StratumInfo("Logo", "SDE_MHDebuggeeBase.logo", 2); 83 result.add(info); 84 } 85 // invokePlain:S100/Logo=SDE_MHDebuggeeBase.logo:4 86 { 87 BreakpointInfo info = new BreakpointInfo("invokePlain"); 88 info.stepsToTrace = 100; 89 info.stratumInfo = new StratumInfo("Logo", "SDE_MHDebuggeeBase.logo", 4); 90 result.add(info); 91 } 92 // mhTarget/Logo=SDE_MHDebuggeeBase.logo:3 93 { 94 BreakpointInfo info = new BreakpointInfo("mhTarget"); 95 info.stratumInfo = new StratumInfo("Logo", "SDE_MHDebuggeeBase.logo", 3); 96 result.add(info); 97 } 98 // plainTarget/Logo=SDE_MHDebuggeeBase.logo:5 99 { 100 BreakpointInfo info = new BreakpointInfo("plainTarget"); 101 info.stratumInfo = new StratumInfo("Logo", "SDE_MHDebuggeeBase.logo", 5); 102 result.add(info); 103 } 104 // stop/Logo=SDE_MHDebuggeeBase.logo:6 105 { 106 BreakpointInfo info = new BreakpointInfo("stop"); 107 info.stratumInfo = new StratumInfo("Logo", "SDE_MHDebuggeeBase.logo", 6); 108 result.add(info); 109 } 110 return result; 111 } 112 113 114 public static void main(String[] args) { 115 launch(new ArgumentHandler(args)); 116 } 117 }