author | iignatyev |
Wed, 30 May 2018 20:54:45 -0700 | |
changeset 50317 | cf71bff5f533 |
permissions | -rw-r--r-- |
50317
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
1 |
/* |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
2 |
* Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved. |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
4 |
* |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation. |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
8 |
* |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
13 |
* accompanied this code). |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
14 |
* |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
15 |
* You should have received a copy of the GNU General Public License version |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
18 |
* |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
21 |
* questions. |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
22 |
*/ |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
23 |
|
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
24 |
package nsk.jdwp.StackFrame.GetValues; |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
25 |
|
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
26 |
import nsk.share.*; |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
27 |
import nsk.share.jpda.*; |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
28 |
import nsk.share.jdwp.*; |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
29 |
|
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
30 |
import java.io.*; |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
31 |
|
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
32 |
/** |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
33 |
* This class represents debuggee part in the test. |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
34 |
*/ |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
35 |
public class getvalues001a { |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
36 |
|
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
37 |
// name of the tested object and thread classes |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
38 |
public static final String OBJECT_CLASS_NAME = "TestedObjectClass"; |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
39 |
public static final String THREAD_CLASS_NAME = "TestedThreadClass"; |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
40 |
public static final String THREAD_NAME = "TestedThreadName"; |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
41 |
|
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
42 |
// name of the static fields with the tested object values |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
43 |
public static final String THREAD_FIELD_NAME = "thread"; |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
44 |
public static final String OBJECT_FIELD_NAME = "object"; |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
45 |
public static final String OBJECT_METHOD_NAME = "testedMethod"; |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
46 |
|
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
47 |
// notification object to notify debuggee that thread is ready |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
48 |
private static Object threadReady = new Object(); |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
49 |
// lock object to prevent thread from exit |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
50 |
private static Object threadLock = new Object(); |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
51 |
|
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
52 |
// scaffold objects |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
53 |
private static volatile ArgumentHandler argumentHandler = null; |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
54 |
private static volatile Log log = null; |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
55 |
|
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
56 |
public static void main(String args[]) { |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
57 |
getvalues001a _getvalues001a = new getvalues001a(); |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
58 |
System.exit(getvalues001.JCK_STATUS_BASE + _getvalues001a.runIt(args, System.err)); |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
59 |
} |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
60 |
|
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
61 |
public int runIt(String args[], PrintStream out) { |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
62 |
//make log for debugee messages |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
63 |
argumentHandler = new ArgumentHandler(args); |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
64 |
log = new Log(out, argumentHandler); |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
65 |
|
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
66 |
// make communication pipe to debugger |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
67 |
log.display("Creating pipe"); |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
68 |
IOPipe pipe = argumentHandler.createDebugeeIOPipe(log); |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
69 |
|
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
70 |
// lock the object to prevent thread from exit |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
71 |
synchronized (threadLock) { |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
72 |
|
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
73 |
// load tested class and create tested thread and object |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
74 |
log.display("Creating object of tested class"); |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
75 |
TestedObjectClass.object = new TestedObjectClass(); |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
76 |
log.display("Creating tested thread"); |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
77 |
TestedObjectClass.thread = new TestedThreadClass(THREAD_NAME); |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
78 |
|
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
79 |
// start the thread and wait for notification from it |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
80 |
synchronized (threadReady) { |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
81 |
TestedObjectClass.thread.start(); |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
82 |
try { |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
83 |
threadReady.wait(); |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
84 |
// send debugger signal READY |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
85 |
log.display("Sending signal to debugger: " + getvalues001.READY); |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
86 |
pipe.println(getvalues001.READY); |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
87 |
} catch (InterruptedException e) { |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
88 |
log.complain("Interruption while waiting for thread started: " + e); |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
89 |
pipe.println(getvalues001.ERROR); |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
90 |
} |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
91 |
} |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
92 |
|
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
93 |
// wait for signal QUIT from debugeer |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
94 |
log.display("Waiting for signal from debugger: " + getvalues001.QUIT); |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
95 |
String signal = pipe.readln(); |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
96 |
log.display("Received signal from debugger: " + signal); |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
97 |
|
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
98 |
// check received signal |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
99 |
if (signal == null || !signal.equals(getvalues001.QUIT)) { |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
100 |
log.complain("Unexpected communication signal from debugee: " + signal |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
101 |
+ " (expected: " + getvalues001.QUIT + ")"); |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
102 |
log.complain("Debugee FAILED"); |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
103 |
return getvalues001.FAILED; |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
104 |
} |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
105 |
|
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
106 |
// allow started thread to finish |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
107 |
} |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
108 |
|
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
109 |
// wait for tested thread finished |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
110 |
try { |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
111 |
log.display("Waiting for tested thread finished"); |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
112 |
TestedObjectClass.thread.join(); |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
113 |
} catch (InterruptedException e) { |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
114 |
log.complain("Interruption while waiting for tested thread finished:\n\t" |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
115 |
+ e); |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
116 |
log.complain("Debugee FAILED"); |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
117 |
return getvalues001.FAILED; |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
118 |
} |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
119 |
|
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
120 |
// exit debugee |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
121 |
log.display("Debugee PASSED"); |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
122 |
return getvalues001.PASSED; |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
123 |
} |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
124 |
|
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
125 |
// tested thread class |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
126 |
public static class TestedThreadClass extends Thread { |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
127 |
|
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
128 |
TestedThreadClass(String name) { |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
129 |
super(name); |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
130 |
} |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
131 |
|
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
132 |
public void run() { |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
133 |
log.display("Tested thread started"); |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
134 |
|
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
135 |
// invoke tested method for the tested object from the tested thread |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
136 |
TestedObjectClass.object.testedMethod(); |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
137 |
|
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
138 |
log.display("Tested thread finished"); |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
139 |
} |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
140 |
|
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
141 |
} |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
142 |
|
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
143 |
// tested object class |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
144 |
public static class TestedObjectClass { |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
145 |
|
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
146 |
// field with the tested thread and object values |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
147 |
public static volatile TestedThreadClass thread = null; |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
148 |
public static volatile TestedObjectClass object = null; |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
149 |
|
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
150 |
public void testedMethod() { |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
151 |
// local variables |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
152 |
boolean booleanValue = true; |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
153 |
byte byteValue = (byte)0x0F; |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
154 |
char charValue = 'Z'; |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
155 |
int intValue = 100; |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
156 |
short shortValue = (short)10; |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
157 |
long longValue = (long)1000000; |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
158 |
float floatValue = (float)3.14; |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
159 |
double doubleValue = (double)2.8e-12; |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
160 |
Object objectValue = null; |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
161 |
|
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
162 |
log.display("Tested frame entered"); |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
163 |
|
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
164 |
// notify debuggee that tested thread ready for testing |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
165 |
synchronized (threadReady) { |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
166 |
threadReady.notifyAll(); |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
167 |
} |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
168 |
|
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
169 |
// wait for lock object released |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
170 |
synchronized (threadLock) { |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
171 |
log.display("Tested frame dropped"); |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
172 |
} |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
173 |
} |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
174 |
|
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
175 |
} |
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
176 |
|
cf71bff5f533
8199371: [TESTBUG] Open source vm testbase JDWP tests
iignatyev
parents:
diff
changeset
|
177 |
} |