1 /* 2 * Copyright (c) 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 nsk/jvmti/RedefineClasses/redefclass019. 29 * VM Testbase keywords: [quick, jpda, jvmti, noras, redefine] 30 * VM Testbase readme: 31 * DESCRIPTION 32 * The test exercises JVMTI function RedefineClasses(classCount, classDefs). 33 * The test creates a child thread, sets a breakpoint into method 34 * checkPoint, then starts the thread which does some nesting calls 35 * up to the method checkPoint. Catching breakpoint the test redefines 36 * "TestThread" class and requests NotifyFramePop for the current 37 * frame. Catching the frame pop event the test checks their class, 38 * current line number, names and values of local varaibles, and requests 39 * NotifyFramePop for the next frame, and so on till the method "run". 40 * COMMENTS 41 * This is a regression test on the following bug: 42 * 4628726 RedefineClasses followed by up and locals cmds gets 43 * JDWP Error 500 44 * Ported from JVMDI. 45 * 46 * @library /vmTestbase 47 * /test/lib 48 * @run driver jdk.test.lib.FileInstaller . . 49 * 50 * @comment make sure redefclass019 is compiled with full debug info 51 * @build nsk.jvmti.RedefineClasses.redefclass019 52 * @clean nsk.jvmti.RedefineClasses.redefclass019 53 * @compile -g:lines,source,vars ../redefclass019.java 54 * 55 * @comment compile newclassXX to bin/newclassXX 56 * with full debug info 57 * @run driver nsk.share.ExtraClassesBuilder 58 * -g:lines,source,vars 59 * newclass_g 60 * 61 * @comment make sure redefclass019 is compiled with full debug info 62 * @build nsk.jvmti.RedefineClasses.redefclass019 63 * @clean nsk.jvmti.RedefineClasses.redefclass019 64 * @compile -g:lines,source,vars ../redefclass019.java 65 * 66 * @run main/othervm/native -agentlib:redefclass019 nsk.jvmti.RedefineClasses.redefclass019 ./bin 67 */ 68 69