author | gadams |
Thu, 21 Feb 2019 05:06:41 -0500 | |
changeset 53869 | 34906de6c017 |
parent 50018 | 3ba0d8631f24 |
permissions | -rw-r--r-- |
50018 | 1 |
/* |
53869
34906de6c017
8219388: Misleading log message "issuspended002a debuggee launched"
gadams
parents:
50018
diff
changeset
|
2 |
* Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved. |
50018 | 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/jdi/VoidValue/hashCode/hashcode001. |
|
29 |
* VM Testbase keywords: [quick, jpda, jdi] |
|
30 |
* VM Testbase readme: |
|
31 |
* DESCRIPTION: |
|
32 |
* The test for the implementation of an object of the type |
|
33 |
* VoidValue. |
|
34 |
* The test checks up that a result of the method |
|
35 |
* com.sun.jdi.VoidValue.hashCode() |
|
36 |
* complies with its spec: |
|
37 |
* public int hashCode() |
|
38 |
* Returns the hash code value for this VoidValue. |
|
39 |
* Returns: the hash code |
|
40 |
* Overrides: hashCode in class java.lang.Object |
|
41 |
* The test works as follows: |
|
42 |
* A debugger program - nsk.jdi.VoidValue.hashCode.hashcode001; |
|
43 |
* a debuggee program - nsk.jdi.VoidValue.hashCode.hashcode001a. |
|
44 |
* Using nsk.jdi.share classes, |
|
45 |
* the debugger gets the debuggee running on another JavaVM, |
|
46 |
* creates the object debuggee.VM, |
|
47 |
* establishes a pipe with the debuggee program, and then |
|
48 |
* send to the programm commands, to which the debuggee replies |
|
49 |
* via the pipe. Upon getting reply, |
|
50 |
* the debugger calls corresponding debuggee.VM methods to get |
|
51 |
* needed data and compares the data got to the data expected. |
|
52 |
* In case of mismatch the test produces the return value 97 and |
|
53 |
* a corresponding error message(s). |
|
54 |
* Otherwise, the test is passed and produces |
|
55 |
* the return value 95 and no message. |
|
56 |
* COMMENTS: |
|
57 |
* |
|
58 |
* @library /vmTestbase |
|
59 |
* /test/lib |
|
60 |
* @run driver jdk.test.lib.FileInstaller . . |
|
61 |
* @build nsk.jdi.VoidValue.hashCode.hashcode001.hashcode001 |
|
62 |
* nsk.jdi.VoidValue.hashCode.hashcode001.hashcode001a |
|
63 |
* @run main/othervm PropertyResolvingWrapper |
|
64 |
* nsk.jdi.VoidValue.hashCode.hashcode001.hashcode001 |
|
65 |
* -verbose |
|
66 |
* -arch=${os.family}-${os.simpleArch} |
|
67 |
* -waittime=5 |
|
68 |
* -debugee.vmkind=java |
|
69 |
* -transport.address=dynamic |
|
70 |
* "-debugee.vmkeys=${test.vm.opts} ${test.java.opts}" |
|
71 |
*/ |
|
72 |
||
73 |
package nsk.jdi.VoidValue.hashCode.hashcode001; |
|
74 |
||
75 |
import nsk.share.*; |
|
76 |
import nsk.share.jpda.*; |
|
77 |
import nsk.share.jdi.*; |
|
78 |
||
79 |
import com.sun.jdi.*; |
|
80 |
import com.sun.jdi.event.*; |
|
81 |
import com.sun.jdi.request.*; |
|
82 |
import java.util.*; |
|
83 |
import java.io.*; |
|
84 |
||
85 |
/** |
|
86 |
* The test for the implementation of an object of the type <BR> |
|
87 |
* VoidValue. <BR> |
|
88 |
* <BR> |
|
89 |
* The test checks up that results of the method <BR> |
|
90 |
* <code>com.sun.jdi.VoidValue.hashCode()</code> <BR> |
|
91 |
* complies with its spec. <BR> |
|
92 |
* <BR> |
|
93 |
* The cases for testing are as follows : <BR> |
|
94 |
* <BR> |
|
95 |
* when a gebuggee is suspended at a breakpoint <BR> |
|
96 |
* set by a debugger, <BR> |
|
97 |
* the debugger invokes debuggee's methods: <BR> |
|
98 |
* void vdValue1(); void vdValue1(); void vdValue2();<BR> |
|
99 |
* to form the follwing objects: Value returnvdValue1, <BR> |
|
100 |
* Value returnvdValue2, and Value returnvdValue3; <BR> |
|
101 |
* <BR> |
|
102 |
* performs following casts: <BR> |
|
103 |
* VoidValue vdValue1 = (VoidValue) returnvdValue1; <BR> |
|
104 |
* VoidValue vdValue2 = (VoidValue) returnvdValue2; <BR> |
|
105 |
* VoidValue vdValue3 = (VoidValue) returnvdValue3; <BR> |
|
106 |
* <BR> |
|
107 |
* and checks up that each of the following is true: <BR> |
|
108 |
* <BR> |
|
109 |
* vdValue1.hashCode() == vdValue2.hashCode() <BR> |
|
110 |
* vdValue1.hashCode() == vdValue3.hashCode() <BR> |
|
111 |
* <BR> |
|
112 |
*/ |
|
113 |
||
114 |
public class hashcode001 { |
|
115 |
||
116 |
//----------------------------------------------------- templete section |
|
117 |
static final int PASSED = 0; |
|
118 |
static final int FAILED = 2; |
|
119 |
static final int PASS_BASE = 95; |
|
120 |
||
121 |
//----------------------------------------------------- templete parameters |
|
122 |
static final String |
|
123 |
sHeader1 = "\n==> nsk/jdi/VoidValue/hashCode/hashcode001", |
|
124 |
sHeader2 = "--> debugger: ", |
|
125 |
sHeader3 = "##> debugger: "; |
|
126 |
||
127 |
//----------------------------------------------------- main method |
|
128 |
||
129 |
public static void main (String argv[]) { |
|
130 |
int result = run(argv, System.out); |
|
131 |
System.exit(result + PASS_BASE); |
|
132 |
} |
|
133 |
||
134 |
public static int run (String argv[], PrintStream out) { |
|
135 |
return new hashcode001().runThis(argv, out); |
|
136 |
} |
|
137 |
||
138 |
//-------------------------------------------------- log procedures |
|
139 |
||
140 |
//private static boolean verbMode = false; |
|
141 |
||
142 |
private static Log logHandler; |
|
143 |
||
144 |
private static void log1(String message) { |
|
145 |
logHandler.display(sHeader1 + message); |
|
146 |
} |
|
147 |
private static void log2(String message) { |
|
148 |
logHandler.display(sHeader2 + message); |
|
149 |
} |
|
150 |
private static void log3(String message) { |
|
151 |
logHandler.complain(sHeader3 + message); |
|
152 |
} |
|
153 |
||
154 |
// ************************************************ test parameters |
|
155 |
||
156 |
private String debuggeeName = |
|
157 |
"nsk.jdi.VoidValue.hashCode.hashcode001.hashcode001a"; |
|
158 |
||
159 |
private String testedClassName = |
|
160 |
"nsk.jdi.VoidValue.hashCode.hashcode001.Threadhashcode001a"; |
|
161 |
||
162 |
//====================================================== test program |
|
163 |
//------------------------------------------------------ common section |
|
164 |
static ArgumentHandler argsHandler; |
|
165 |
||
166 |
static int waitTime; |
|
167 |
||
168 |
static VirtualMachine vm = null; |
|
169 |
static EventRequestManager eventRManager = null; |
|
170 |
static EventQueue eventQueue = null; |
|
171 |
static EventSet eventSet = null; |
|
172 |
||
173 |
ReferenceType testedclass = null; |
|
174 |
ThreadReference thread2 = null; |
|
175 |
ThreadReference mainThread = null; |
|
176 |
||
177 |
static int testExitCode = PASSED; |
|
178 |
||
179 |
static final int returnCode0 = 0; |
|
180 |
static final int returnCode1 = 1; |
|
181 |
static final int returnCode2 = 2; |
|
182 |
static final int returnCode3 = 3; |
|
183 |
static final int returnCode4 = 4; |
|
184 |
||
185 |
//------------------------------------------------------ methods |
|
186 |
||
187 |
private int runThis (String argv[], PrintStream out) { |
|
188 |
||
189 |
Debugee debuggee; |
|
190 |
||
191 |
argsHandler = new ArgumentHandler(argv); |
|
192 |
logHandler = new Log(out, argsHandler); |
|
193 |
Binder binder = new Binder(argsHandler, logHandler); |
|
194 |
||
195 |
if (argsHandler.verbose()) { |
|
196 |
debuggee = binder.bindToDebugee(debuggeeName + " -vbs"); // *** tp |
|
197 |
} else { |
|
198 |
debuggee = binder.bindToDebugee(debuggeeName); // *** tp |
|
199 |
} |
|
200 |
||
201 |
waitTime = argsHandler.getWaitTime(); |
|
202 |
||
203 |
||
204 |
IOPipe pipe = new IOPipe(debuggee); |
|
205 |
||
206 |
debuggee.redirectStderr(out); |
|
53869
34906de6c017
8219388: Misleading log message "issuspended002a debuggee launched"
gadams
parents:
50018
diff
changeset
|
207 |
log2(debuggeeName + " debuggee launched"); |
50018 | 208 |
debuggee.resume(); |
209 |
||
210 |
String line = pipe.readln(); |
|
211 |
if ((line == null) || !line.equals("ready")) { |
|
212 |
log3("signal received is not 'ready' but: " + line); |
|
213 |
return FAILED; |
|
214 |
} else { |
|
215 |
log2("'ready' recieved"); |
|
216 |
} |
|
217 |
||
218 |
VirtualMachine vm = debuggee.VM(); |
|
219 |
||
220 |
//------------------------------------------------------ testing section |
|
221 |
log1(" TESTING BEGINS"); |
|
222 |
||
223 |
for (int i = 0; ; i++) { |
|
224 |
pipe.println("newcheck"); |
|
225 |
line = pipe.readln(); |
|
226 |
||
227 |
if (line.equals("checkend")) { |
|
228 |
log2(" : returned string is 'checkend'"); |
|
229 |
break ; |
|
230 |
} else if (!line.equals("checkready")) { |
|
231 |
log3("ERROR: returned string is not 'checkready'"); |
|
232 |
testExitCode = FAILED; |
|
233 |
break ; |
|
234 |
} |
|
235 |
||
236 |
log1("new check: #" + i); |
|
237 |
||
238 |
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ variable part |
|
239 |
||
240 |
int expresult = returnCode0; |
|
241 |
||
242 |
eventRManager = vm.eventRequestManager(); |
|
243 |
eventQueue = vm.eventQueue(); |
|
244 |
||
245 |
List allThreads = null; |
|
246 |
ListIterator listIterator = null; |
|
247 |
List classes = null; |
|
248 |
||
249 |
String threadName = "Thread2"; |
|
250 |
||
251 |
String breakpointMethod1 = "run"; |
|
252 |
String bpLine1 = "breakpointLineNumber1"; |
|
253 |
||
254 |
BreakpointRequest breakpRequest1 = null; |
|
255 |
||
256 |
||
257 |
label0: { |
|
258 |
||
259 |
log2("getting ThreadReference object"); |
|
260 |
try { |
|
261 |
allThreads = vm.allThreads(); |
|
262 |
classes = vm.classesByName(testedClassName); |
|
263 |
testedclass = (ReferenceType) classes.get(0); |
|
264 |
} catch ( Exception e) { |
|
265 |
log3("ERROR: Exception at very beginning !? : " + e); |
|
266 |
expresult = returnCode1; |
|
267 |
break label0; |
|
268 |
} |
|
269 |
||
270 |
listIterator = allThreads.listIterator(); |
|
271 |
for (;;) { |
|
272 |
try { |
|
273 |
thread2 = (ThreadReference) listIterator.next(); |
|
274 |
if (thread2.name().equals(threadName)) |
|
275 |
break ; |
|
276 |
} catch ( NoSuchElementException e ) { |
|
277 |
log3("ERROR: NoSuchElementException for listIterator.next()"); |
|
278 |
log3("ERROR: NO THREAD2 ?????????!!!!!!!"); |
|
279 |
expresult = returnCode1; |
|
280 |
break label0; |
|
281 |
} |
|
282 |
} |
|
283 |
||
284 |
log2("setting up breakpoint"); |
|
285 |
||
286 |
breakpRequest1 = settingBreakpoint(breakpointMethod1, bpLine1, "one"); |
|
287 |
if (breakpRequest1 == null) { |
|
288 |
expresult = returnCode1; |
|
289 |
break label0; |
|
290 |
} |
|
291 |
} |
|
292 |
||
293 |
label1: { |
|
294 |
||
295 |
if (expresult != returnCode0) |
|
296 |
break label1; |
|
297 |
||
298 |
log2(" enabling breakpRequest1"); |
|
299 |
breakpRequest1.enable(); |
|
300 |
||
301 |
log2(" forcing the main thread to leave synchronized block"); |
|
302 |
pipe.println("continue"); |
|
303 |
line = pipe.readln(); |
|
304 |
if (!line.equals("docontinue")) { |
|
305 |
log3("ERROR: returned string is not 'docontinue'"); |
|
306 |
expresult = returnCode4; |
|
307 |
break label1; |
|
308 |
} |
|
309 |
||
310 |
log2(" getting a breakpoint event"); |
|
311 |
expresult = breakpoint(); |
|
312 |
if (expresult != returnCode0) |
|
313 |
break label1; |
|
314 |
||
315 |
||
316 |
Value returnvdValue1 = null; |
|
317 |
Value returnvdValue2 = null; |
|
318 |
Value returnvdValue3 = null; |
|
319 |
List invokeMethods = null; |
|
320 |
Method invokeMethod = null; |
|
321 |
List<Value> argumentList = null; |
|
322 |
||
323 |
||
324 |
invokeMethods = testedclass.methodsByName("vdValue1"); |
|
325 |
invokeMethod = (Method) invokeMethods.get(0); |
|
326 |
||
327 |
argumentList = Collections.<Value>emptyList(); |
|
328 |
||
329 |
try { |
|
330 |
log2(" 1st invoking hashcode001a.vdValue1(); no Exception expected"); |
|
331 |
returnvdValue1 = thread2.invokeMethod(thread2, |
|
332 |
invokeMethod, argumentList, 0); |
|
333 |
log2(" 2nd invoking hashcode001a.vdValue1(); no Exception expected"); |
|
334 |
returnvdValue2 = thread2.invokeMethod(thread2, |
|
335 |
invokeMethod, argumentList, 0); |
|
336 |
} catch ( Exception e ) { |
|
337 |
log3("ERROR: Exception: " + e); |
|
338 |
expresult = returnCode1; |
|
339 |
break label1; |
|
340 |
} |
|
341 |
||
342 |
// invoking hashcode001a.vdValue2() |
|
343 |
||
344 |
invokeMethods = testedclass.methodsByName("vdValue2"); |
|
345 |
invokeMethod = (Method) invokeMethods.get(0); |
|
346 |
||
347 |
try { |
|
348 |
log2(" invoking hashcode001a.vdValue2(); no Exception expected"); |
|
349 |
returnvdValue3 = thread2.invokeMethod(thread2, |
|
350 |
invokeMethod, argumentList, 0); |
|
351 |
} catch ( Exception e ) { |
|
352 |
log3("ERROR: Exception: " + e); |
|
353 |
expresult = returnCode1; |
|
354 |
break label1; |
|
355 |
} |
|
356 |
||
357 |
||
358 |
VoidValue vdValue1 = null; |
|
359 |
VoidValue vdValue2 = null; |
|
360 |
VoidValue vdValue3 = null; |
|
361 |
||
362 |
try { |
|
363 |
log2(" checking up cast: vdValue1 = (VoidValue) returnvdValue1; no Exception expected"); |
|
364 |
vdValue1 = (VoidValue) returnvdValue1; |
|
365 |
} catch ( ClassCastException e ) { |
|
366 |
log3("ERROR : ClassCastException"); |
|
367 |
expresult = returnCode1; |
|
368 |
break label1; |
|
369 |
} |
|
370 |
||
371 |
try { |
|
372 |
log2(" checking up cast: vdValue2 = (VoidValue) returnvdValue2; no Exception expected"); |
|
373 |
vdValue2 = (VoidValue) returnvdValue2; |
|
374 |
} catch ( ClassCastException e ) { |
|
375 |
log3("ERROR : ClassCastException"); |
|
376 |
expresult = returnCode1; |
|
377 |
break label1; |
|
378 |
} |
|
379 |
||
380 |
try { |
|
381 |
log2(" checking up cast: vdValue3 = (VoidValue) returnvdValue3; no Exception expected"); |
|
382 |
vdValue3 = (VoidValue) returnvdValue3; |
|
383 |
} catch ( ClassCastException e ) { |
|
384 |
log3("ERROR : ClassCastException"); |
|
385 |
expresult = returnCode1; |
|
386 |
break label1; |
|
387 |
} |
|
388 |
||
389 |
log2(" checking up: dValue1.hashCode() == vdValue2.hashCode()"); |
|
390 |
if (vdValue1.hashCode() != vdValue2.hashCode() ) { |
|
391 |
log3("ERROR: vdValue1.hashCode() != vdValue2.hashCode()"); |
|
392 |
expresult = returnCode1; |
|
393 |
} |
|
394 |
log2(" checking up: dValue1.hashCode() == vdValue3.hashCode()"); |
|
395 |
if (vdValue1.hashCode() != vdValue3.hashCode() ) { |
|
396 |
log3("ERROR: vdValue1.hashCode() != vdValue3.hashCode()"); |
|
397 |
expresult = returnCode1; |
|
398 |
} |
|
399 |
} |
|
400 |
log2(" resuming the vm"); |
|
401 |
vm.resume(); |
|
402 |
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|
403 |
log2(" the end of testing"); |
|
404 |
if (expresult != returnCode0) |
|
405 |
testExitCode = FAILED; |
|
406 |
} |
|
407 |
log1(" TESTING ENDS"); |
|
408 |
||
409 |
//-------------------------------------------------- test summary section |
|
410 |
//------------------------------------------------- standard end section |
|
411 |
||
412 |
pipe.println("quit"); |
|
413 |
log2("waiting for the debuggee to finish ..."); |
|
414 |
debuggee.waitFor(); |
|
415 |
||
416 |
int status = debuggee.getStatus(); |
|
417 |
if (status != PASSED + PASS_BASE) { |
|
418 |
log3("debuggee returned UNEXPECTED exit status: " + |
|
419 |
status + " != PASS_BASE"); |
|
420 |
testExitCode = FAILED; |
|
421 |
} else { |
|
422 |
log2("debuggee returned expected exit status: " + |
|
423 |
status + " == PASS_BASE"); |
|
424 |
} |
|
425 |
||
426 |
if (testExitCode != PASSED) { |
|
427 |
System.out.println("TEST FAILED"); |
|
428 |
} |
|
429 |
return testExitCode; |
|
430 |
} |
|
431 |
||
432 |
||
433 |
||
434 |
/* |
|
435 |
* private BreakpointRequest settingBreakpoint(String, String, String) |
|
436 |
* |
|
437 |
* It sets up a breakpoint within a given method at given line number |
|
438 |
* for the thread2 only. |
|
439 |
* Third parameter is required for any case in future debugging, as if. |
|
440 |
* |
|
441 |
* Return codes: |
|
442 |
* = BreakpointRequest object in case of success |
|
443 |
* = null in case of an Exception thrown within the method |
|
444 |
*/ |
|
445 |
||
446 |
private BreakpointRequest settingBreakpoint ( String methodName, |
|
447 |
String bpLine, |
|
448 |
String property) { |
|
449 |
||
450 |
log2("setting up a breakpoint: method: '" + methodName + "' line: " + bpLine ); |
|
451 |
||
452 |
List alllineLocations = null; |
|
453 |
Location lineLocation = null; |
|
454 |
BreakpointRequest breakpRequest = null; |
|
455 |
||
456 |
try { |
|
457 |
Method method = (Method) testedclass.methodsByName(methodName).get(0); |
|
458 |
||
459 |
alllineLocations = method.allLineLocations(); |
|
460 |
||
461 |
int n = |
|
462 |
( (IntegerValue) testedclass.getValue(testedclass.fieldByName(bpLine) ) ).value(); |
|
463 |
if (n > alllineLocations.size()) { |
|
464 |
log3("ERROR: TEST_ERROR_IN_settingBreakpoint(): number is out of bound of method's lines"); |
|
465 |
} else { |
|
466 |
lineLocation = (Location) alllineLocations.get(n); |
|
467 |
try { |
|
468 |
breakpRequest = eventRManager.createBreakpointRequest(lineLocation); |
|
469 |
breakpRequest.putProperty("number", property); |
|
470 |
breakpRequest.addThreadFilter(thread2); |
|
471 |
breakpRequest.setSuspendPolicy( EventRequest.SUSPEND_EVENT_THREAD); |
|
472 |
} catch ( Exception e1 ) { |
|
473 |
log3("ERROR: inner Exception within settingBreakpoint() : " + e1); |
|
474 |
breakpRequest = null; |
|
475 |
} |
|
476 |
} |
|
477 |
} catch ( Exception e2 ) { |
|
478 |
log3("ERROR: ATTENTION: outer Exception within settingBreakpoint() : " + e2); |
|
479 |
breakpRequest = null; |
|
480 |
} |
|
481 |
||
482 |
if (breakpRequest == null) |
|
483 |
log2(" A BREAKPOINT HAS NOT BEEN SET UP"); |
|
484 |
else |
|
485 |
log2(" a breakpoint has been set up"); |
|
486 |
||
487 |
return breakpRequest; |
|
488 |
} |
|
489 |
||
490 |
||
491 |
/* |
|
492 |
* private int breakpoint () |
|
493 |
* |
|
494 |
* It removes events from EventQueue until gets first BreakpointEvent. |
|
495 |
* To get next EventSet value, it uses the method |
|
496 |
* EventQueue.remove(int timeout) |
|
497 |
* The timeout argument passed to the method, is "waitTime*60000". |
|
498 |
* Note: the value of waitTime is set up with |
|
499 |
* the method ArgumentHandler.getWaitTime() at the beginning of the test. |
|
500 |
* |
|
501 |
* Return codes: |
|
502 |
* = returnCode0 - success; |
|
503 |
* = returnCode2 - Exception when "eventSet = eventQueue.remove()" is executed |
|
504 |
* = returnCode3 - default case when loop of processing an event, that is, |
|
505 |
* an unspecified event was taken from the EventQueue |
|
506 |
*/ |
|
507 |
||
508 |
private int breakpoint () { |
|
509 |
||
510 |
int returnCode = returnCode0; |
|
511 |
||
512 |
log2(" waiting for BreakpointEvent"); |
|
513 |
||
514 |
labelBP: |
|
515 |
for (;;) { |
|
516 |
||
517 |
log2(" new: eventSet = eventQueue.remove();"); |
|
518 |
try { |
|
519 |
eventSet = eventQueue.remove(waitTime*60000); |
|
520 |
if (eventSet == null) { |
|
521 |
log3("ERROR: timeout for waiting for a BreakpintEvent"); |
|
522 |
returnCode = returnCode3; |
|
523 |
break labelBP; |
|
524 |
} |
|
525 |
} catch ( Exception e ) { |
|
526 |
log3("ERROR: Exception for eventSet = eventQueue.remove(); : " + e); |
|
527 |
returnCode = 1; |
|
528 |
break labelBP; |
|
529 |
} |
|
530 |
||
531 |
if (eventSet != null) { |
|
532 |
||
533 |
log2(" : eventSet != null; size == " + eventSet.size()); |
|
534 |
||
535 |
EventIterator eIter = eventSet.eventIterator(); |
|
536 |
Event ev = null; |
|
537 |
||
538 |
for (; eIter.hasNext(); ) { |
|
539 |
||
540 |
if (returnCode != returnCode0) |
|
541 |
break; |
|
542 |
||
543 |
ev = eIter.nextEvent(); |
|
544 |
||
545 |
ll: for (int ifor =0; ; ifor++) { |
|
546 |
||
547 |
try { |
|
548 |
switch (ifor) { |
|
549 |
||
550 |
case 0: AccessWatchpointEvent awe = (AccessWatchpointEvent) ev; |
|
551 |
log2(" AccessWatchpointEvent removed"); |
|
552 |
break ll; |
|
553 |
case 1: BreakpointEvent be = (BreakpointEvent) ev; |
|
554 |
log2(" BreakpointEvent removed"); |
|
555 |
break labelBP; |
|
556 |
case 2: ClassPrepareEvent cpe = (ClassPrepareEvent) ev; |
|
557 |
log2(" ClassPreparEvent removed"); |
|
558 |
break ll; |
|
559 |
case 3: ClassUnloadEvent cue = (ClassUnloadEvent) ev; |
|
560 |
log2(" ClassUnloadEvent removed"); |
|
561 |
break ll; |
|
562 |
case 4: ExceptionEvent ee = (ExceptionEvent) ev; |
|
563 |
log2(" ExceptionEvent removed"); |
|
564 |
break ll; |
|
565 |
case 5: MethodEntryEvent mene = (MethodEntryEvent) ev; |
|
566 |
log2(" MethodEntryEvent removed"); |
|
567 |
break ll; |
|
568 |
case 6: MethodExitEvent mexe = (MethodExitEvent) ev; |
|
569 |
log2(" MethodExiEvent removed"); |
|
570 |
break ll; |
|
571 |
case 7: ModificationWatchpointEvent mwe = (ModificationWatchpointEvent) ev; |
|
572 |
log2(" ModificationWatchpointEvent removed"); |
|
573 |
break ll; |
|
574 |
case 8: StepEvent se = (StepEvent) ev; |
|
575 |
log2(" StepEvent removed"); |
|
576 |
break ll; |
|
577 |
case 9: ThreadDeathEvent tde = (ThreadDeathEvent) ev; |
|
578 |
log2(" ThreadDeathEvent removed"); |
|
579 |
break ll; |
|
580 |
case 10: ThreadStartEvent tse = (ThreadStartEvent) ev; |
|
581 |
log2(" ThreadStartEvent removed"); |
|
582 |
break ll; |
|
583 |
case 11: VMDeathEvent vmde = (VMDeathEvent) ev; |
|
584 |
log2(" VMDeathEvent removed"); |
|
585 |
break ll; |
|
586 |
case 12: VMStartEvent vmse = (VMStartEvent) ev; |
|
587 |
log2(" VMStartEvent removed"); |
|
588 |
break ll; |
|
589 |
case 13: WatchpointEvent we = (WatchpointEvent) ev; |
|
590 |
log2(" WatchpointEvent removed"); |
|
591 |
break ll; |
|
592 |
||
593 |
default: log3("ERROR: default case for casting event"); |
|
594 |
returnCode = returnCode3; |
|
595 |
break ll; |
|
596 |
} // switch |
|
597 |
} catch ( ClassCastException e ) { |
|
598 |
} // try |
|
599 |
} // ll: for (int ifor =0; ; ifor++) |
|
600 |
} // for (; ev.hasNext(); ) |
|
601 |
} |
|
602 |
} |
|
603 |
if (returnCode == returnCode0) |
|
604 |
log2(" : eventSet == null: EventQueue is empty"); |
|
605 |
||
606 |
return returnCode; |
|
607 |
} |
|
608 |
||
609 |
} |