Path: blob/master/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/breakpointRequests/breakpreq001t.java
41161 views
/*1* Copyright (c) 2001, 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.jdi.EventRequestManager.breakpointRequests;2425import nsk.share.*;26import nsk.share.jpda.*;27import nsk.share.jdi.*;2829// THIS TEST IS LINE NUMBER SENSITIVE3031/**32* This is a debuggee class containing different types of methods.33*/34public class breakpreq001t {35public static void main(String args[]) {36ArgumentHandler argHandler = new ArgumentHandler(args); // breakpreq001.DEBUGGEE_LNS[0]37IOPipe pipe = argHandler.createDebugeeIOPipe();3839pipe.println(breakpreq001.COMMAND_READY);40String cmd = pipe.readln();41if (!cmd.equals(breakpreq001.COMMAND_QUIT)) {42System.err.println("TEST BUG: unknown debugger command: "43+ cmd);44System.exit(breakpreq001.JCK_STATUS_BASE +45breakpreq001.FAILED);46}47System.exit(breakpreq001.JCK_STATUS_BASE +48breakpreq001.PASSED);49}5051// dummy methods are below52byte byteMeth() {53return -128; // breakpreq001.DEBUGGEE_LNS[1]54}55short shortMeth() {56return 0; // breakpreq001.DEBUGGEE_LNS[2]57}58private int prMeth() {59return 1; // breakpreq001.DEBUGGEE_LNS[3]60}61protected long protMeth() {62return 9223372036854775807L; // breakpreq001.DEBUGGEE_LNS[4]63}64float floatMeth() {65return 0.03456f; // breakpreq001.DEBUGGEE_LNS[5]66}67double doubleMeth() {68return -56.789D; // breakpreq001.DEBUGGEE_LNS[6]69}70char charMeth() {71return '_'; // breakpreq001.DEBUGGEE_LNS[7]72}73private boolean boolMeth() {74return true; // breakpreq001.DEBUGGEE_LNS[8]75}76public String pubMeth() {77return "returning string"; // breakpreq001.DEBUGGEE_LNS[9]78}79}808182