Path: blob/master/test/hotspot/jtreg/vmTestbase/nsk/jdb/pop/pop001/pop001a.java
40951 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.pop.pop001;2425import nsk.share.*;26import nsk.share.jpda.*;27import nsk.share.jdb.*;2829import java.io.*;3031/* This is debuggee aplication */32public class pop001a {3334static final String MYTHREAD = "MyThread";3536static JdbArgumentHandler argumentHandler;37static Log log;3839static pop001a _pop001a = new pop001a();4041public static void main(String args[]) {42System.exit(pop001.JCK_STATUS_BASE + _pop001a.runIt(args, System.out));43}4445static void lastBreak () {}4647public int runIt(String args[], PrintStream out) {48argumentHandler = new JdbArgumentHandler(args);49log = new Log(out, argumentHandler);5051MyThread myThread = new MyThread(MYTHREAD);52myThread.start();5354if (myThread.isAlive()) {55try {56myThread.join();57} catch (InterruptedException e) {58log.complain("Main thread was interrupted while waiting for finish of " + MYTHREAD);59return pop001.FAILED;60}61}6263log.display("Debuggee PASSED");64return pop001.PASSED;65}66}6768class MyThread extends Thread {6970public MyThread (String name) {71super(name);72}7374public void run() {75pop001a.log.display("run() started");76int runLocal;77int j = func1(0);78pop001a.log.display("run() finished");79}8081public int func1(int intParam) {82pop001a.log.display("func1() started");83int func1Local;84intParam++;85return func2(intParam);86}8788public int func2(int intParam) {89pop001a.log.display("func2() started");90int func2Local;91intParam++;92return func3(intParam);93}9495public int func3(int intParam) {96pop001a.log.display("func3() started");97int func3Local;98intParam++;99return func4(intParam);100}101102public int func4(int intParam) {103pop001a.log.display("func4() started");104int func4Local;105intParam++;106return func5(intParam);107}108109public int func5(int intParam) {110pop001a.log.display("func5() started");111int func5Local;112intParam++;113pop001a.lastBreak();114return intParam;115}116}117118119