Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/mobile
Path: blob/master/test/hotspot/jtreg/vmTestbase/nsk/jdb/run/run002/run002.java
40951 views
1
/*
2
* Copyright (c) 2002, 2020, 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
25
/*
26
* @test
27
*
28
* @summary converted from VM Testbase nsk/jdb/run/run002.
29
* VM Testbase keywords: [jpda, jdb]
30
* VM Testbase readme:
31
* DESCRIPTION
32
* This is a test for the 'run' command.
33
* The 'run' command is issued in the superclass of test driver class.
34
* The test is passed if "run nsk.jdb.run.run002a" string is found
35
* in jdb's output stream:
36
* The test consists of two parts:
37
* run002.java - test driver, i.e. launches jdb and debuggee,
38
* writes commands to jdb, reads the jdb output,
39
* run002a.java - the debugged application.
40
* COMMENTS
41
* This test functionally equals to nsk/jdb/run/run001 test and
42
* replaces it.
43
*
44
* @library /vmTestbase
45
* /test/lib
46
* @build nsk.jdb.run.run002.run002a
47
* @run main/othervm
48
* nsk.jdb.run.run002.run002
49
* -arch=${os.family}-${os.simpleArch}
50
* -waittime=5
51
* -debugee.vmkind=java
52
* -transport.address=dynamic
53
* -jdb=${test.jdk}/bin/jdb
54
* -java.options="${test.vm.opts} ${test.java.opts}"
55
* -workdir=.
56
* -debugee.vmkeys="${test.vm.opts} ${test.java.opts}"
57
*/
58
59
package nsk.jdb.run.run002;
60
61
import nsk.share.*;
62
import nsk.share.jdb.*;
63
64
import java.io.*;
65
import java.util.*;
66
67
public class run002 extends JdbTest {
68
69
public static void main (String argv[]) {
70
System.exit(run(argv, System.out) + JCK_STATUS_BASE);
71
}
72
73
public static int run(String argv[], PrintStream out) {
74
debuggeeClass = DEBUGGEE_CLASS;
75
firstBreak = FIRST_BREAK;
76
lastBreak = LAST_BREAK;
77
return new run002().runTest(argv, out);
78
}
79
80
static final String PACKAGE_NAME = "nsk.jdb.run.run002";
81
static final String TEST_CLASS = PACKAGE_NAME + ".run002";
82
static final String DEBUGGEE_CLASS = TEST_CLASS + "a";
83
static final String FIRST_BREAK = DEBUGGEE_CLASS + ".main";
84
static final String LAST_BREAK = DEBUGGEE_CLASS + ".lastBreak";
85
86
protected void runCases() {
87
String[] reply;
88
Paragrep grep;
89
int count;
90
Vector v;
91
String found;
92
93
jdb.contToExit(1);
94
95
if (argumentHandler.isLaunchingConnector()) {
96
reply = jdb.getTotalReply();
97
grep = new Paragrep(reply);
98
v = new Vector();
99
v.add(JdbCommand.run);
100
v.add(DEBUGGEE_CLASS);
101
if (grep.find(v) != 1) {
102
failure("jdb failed to run debugged application.");
103
}
104
}
105
}
106
}
107
108