Path: blob/master/test/hotspot/jtreg/vmTestbase/nsk/jdb/next/next001/next001a.java
40955 views
/*1* Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation.7*8* This code is distributed in the hope that it will be useful, but WITHOUT9* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License11* version 2 for more details (a copy is included in the LICENSE file that12* accompanied this code).13*14* You should have received a copy of the GNU General Public License version15* 2 along with this work; if not, write to the Free Software Foundation,16* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.17*18* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA19* or visit www.oracle.com if you need additional information or have any20* questions.21*/2223package nsk.jdb.next.next001;2425import nsk.share.*;26import nsk.share.jpda.*;27import nsk.share.jdb.*;2829import java.io.*;3031/* This is debuggee aplication */32public class next001a {33public static void main(String args[]) {34next001a _next001a = new next001a();35System.exit(next001.JCK_STATUS_BASE + _next001a.runIt(args, System.out));36}3738static void lastBreak () {}3940static final String MYTHREAD = "MyThread";41static final int numThreads = 2; // number of threads.4243static JdbArgumentHandler argumentHandler;44static Log log;4546static Object waitnotify = new Object();4748public int runIt(String args[], PrintStream out) {4950argumentHandler = new JdbArgumentHandler(args);51log = new Log(out, argumentHandler);5253Thread holder [] = new Thread[numThreads];5455for (int i = 0; i < numThreads ; i++) {56holder[i] = new MyThread();57holder[i].start();58try {59holder[i].join();60} catch (InterruptedException e) {61log.complain("Main thread was interrupted while waiting for finish of " + MYTHREAD + "-" + i);62return next001.FAILED;63}64}6566log.display("Debuggee PASSED");67return next001.PASSED;68}69}707172class MyThread extends Thread {73public void run() {74int runLocal = func1(100);75}7677public int func1(int i) {78return func2(i);79}8081public int func2(int i) {82next001a.lastBreak();83int int2 = func3(i); // this is the line before 'next' command84return int2; // this is the line after 'next' command85}8687public int func3(int i) {88return i*i;89}90}919293