Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/mobile
Path: blob/master/test/hotspot/jtreg/vmTestbase/nsk/jdi/ExceptionEvent/catchLocation/location002a.java
41161 views
1
/*
2
* Copyright (c) 2001, 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
package nsk.jdi.ExceptionEvent.catchLocation;
25
26
import nsk.share.*;
27
import nsk.share.jpda.*;
28
import nsk.share.jdi.*;
29
30
import java.io.*;
31
import java.lang.Integer.*;
32
33
// This class is the debugged application in the test
34
35
class location002a {
36
static final int PASSED = 0;
37
static final int FAILED = 2;
38
static final int JCK_STATUS_BASE = 95;
39
40
// synchronization commands
41
static final String COMMAND_READY = "ready";
42
static final String COMMAND_QUIT = "quit";
43
static final String COMMAND_GO = "go";
44
static final String COMMAND_DONE = "done";
45
static final String COMMAND_ERROR = "error";
46
47
// start debuggee
48
public static void main(String args[]) throws Throwable {
49
location002a _location002a = new location002a();
50
System.exit(JCK_STATUS_BASE + _location002a.runIt(args, System.err));
51
}
52
53
// perform debugee execution
54
int runIt(String args[], PrintStream out) throws Throwable {
55
ArgumentHandler argHandler = new ArgumentHandler(args);
56
IOPipe pipe = argHandler.createDebugeeIOPipe();
57
Log log = new Log(out, argHandler);
58
59
// notify debuggeer that debuggee started
60
pipe.println(COMMAND_READY);
61
62
// wait for command <GO> from debugger
63
String command = pipe.readln();
64
if (!command.equals(COMMAND_GO)) {
65
log.complain("TEST BUG: unknown command: " + command);
66
return FAILED;
67
}
68
69
// throw uncaught exception, which should terminate debuggee
70
System.err.println("Raising NumberFormatException");
71
int i = Integer.parseInt("foo");
72
73
// return FAILED if not terminated by uncaught exception
74
return FAILED;
75
}
76
}
77
78