Path: blob/aarch64-shenandoah-jdk8u272-b10/jdk/test/com/sun/jdi/DeoptimizeWalk.sh
38855 views
#!/bin/sh12#3# Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.4# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.5#6# This code is free software; you can redistribute it and/or modify it7# under the terms of the GNU General Public License version 2 only, as8# published by the Free Software Foundation.9#10# This code is distributed in the hope that it will be useful, but WITHOUT11# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13# version 2 for more details (a copy is included in the LICENSE file that14# accompanied this code).15#16# You should have received a copy of the GNU General Public License version17# 2 along with this work; if not, write to the Free Software Foundation,18# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19#20# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21# or visit www.oracle.com if you need additional information or have any22# questions.23#2425# @test26# @bug 452571427# @summary jtreg test PopAsynchronousTest fails in build 85 with -Xcomp28# @author Jim Holmlund/Swamy Venkataramanappa29# @run shell DeoptimizeWalk.sh3031# This is another test of the same bug. The bug occurs when trying32# to walk the stack of a deoptimized thread. We can do this33# by running in -Xcomp mode and by doing a step which causes deopt,34# and then a 'where'. This will cause not all the frames to be shown.3536compileOptions=-g3738echo "*********** This test only fails with -Xcomp ***************"39createJavaFile()40{41cat <<EOF > $1.java.14243public class $1 {44static public void main(String[] args) {45$1 mine = new $1();46mine.a1(89);47}4849public void a1(int p1) {50int v1 = 89;51System.out.println("a1" + v1);52a2(89);53}545556public void a2(int pp) {57int v2 = 89;58System.out.println("a2" + v2);59a3(89);60}6162public void a3(int pp) {63int v3 = 89;64System.out.println("a3"); //@ 1 breakpoint65a4(22); // it passes if this line is commented out66System.out.println("jj");67}6869public void a4(int pp) {70int v4 = 90;71System.out.println("a4: @1 breakpoint here");72}73}74EOF75}7677# This is called to feed cmds to jdb.78dojdbCmds()79{80setBkpts @181runToBkpt @182cmd where83#cmd next84cmd step85cmd where86cmd quit87jdbFailIfNotPresent "shtest\.main" 388}899091mysetup()92{93if [ -z "$TESTSRC" ] ; then94TESTSRC=.95fi9697for ii in . $TESTSRC $TESTSRC/.. ; do98if [ -r "$ii/ShellScaffold.sh" ] ; then99. $ii/ShellScaffold.sh100break101fi102done103}104105# You could replace this next line with the contents106# of ShellScaffold.sh and this script will run just the same.107mysetup108109runit110debuggeeFailIfPresent "Internal exception:"111pass112113114