Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/mobile
Path: blob/master/test/hotspot/jtreg/vmTestbase/nsk/jdwp/Method/LineTable/linetable001a.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
// THIS TEST IS LINE NUMBER SENSITIVE
25
26
package nsk.jdwp.Method.LineTable;
27
28
import nsk.share.*;
29
import nsk.share.jpda.*;
30
import nsk.share.jdwp.*;
31
32
import java.io.*;
33
34
/**
35
* This class represents debuggee part in the test.
36
*/
37
public class linetable001a {
38
39
public static final int FIRST_LINE_NUMBER = 86;
40
public static final int LAST_LINE_NUMBER = 97;
41
42
public static void main(String args[]) {
43
linetable001a _linetable001a = new linetable001a();
44
System.exit(linetable001.JCK_STATUS_BASE + _linetable001a.runIt(args, System.err));
45
}
46
47
public int runIt(String args[], PrintStream out) {
48
//make log for debugee messages
49
ArgumentHandler argumentHandler = new ArgumentHandler(args);
50
Log log = new Log(out, argumentHandler);
51
52
// make communication pipe to debugger
53
log.display("Creating pipe");
54
IOPipe pipe = argumentHandler.createDebugeeIOPipe(log);
55
56
// ensure tested class loaded
57
log.display("Creating object of tested class");
58
TestedClass foo = new TestedClass();
59
60
// send debugger signal READY
61
log.display("Sending signal to debugger: " + linetable001.READY);
62
pipe.println(linetable001.READY);
63
64
// wait for signal QUIT from debugeer
65
log.display("Waiting for signal from debugger: " + linetable001.QUIT);
66
String signal = pipe.readln();
67
log.display("Received signal from debugger: " + signal);
68
69
// check received signal
70
if (! signal.equals(linetable001.QUIT)) {
71
log.complain("Unexpected communication signal from debugee: " + signal
72
+ " (expected: " + linetable001.QUIT + ")");
73
log.display("Debugee FAILED");
74
return linetable001.FAILED;
75
}
76
77
// exit debugee
78
log.display("Debugee PASSED");
79
return linetable001.PASSED;
80
}
81
82
// tested class
83
public static class TestedClass {
84
int foo = 0;
85
86
public void testedMethod() { // FIRST_LINE_NUMBER
87
foo = 1; // foo == 1
88
foo++; // foo == 2
89
foo++; // foo == 3
90
foo++; // foo == 4
91
foo++; // foo == 5
92
foo++; // foo == 6
93
foo++; // foo == 7
94
foo++; // foo == 8
95
foo++; // foo == 9
96
foo++; // foo == 10
97
} // LAST_LINE_NUMBER
98
}
99
100
}
101
102