|
Lines 171-176
Link Here
|
| 171 |
private boolean fSuspended = true; |
171 |
private boolean fSuspended = true; |
| 172 |
|
172 |
|
| 173 |
/** |
173 |
/** |
|
|
174 |
* When handling a breakpoint, the VM is quietly suspended and may resume |
| 175 |
* depending on conditional breakpoints, breakpoint listeners, etc. |
| 176 |
*/ |
| 177 |
private boolean fConsideringBreakpoint = false; |
| 178 |
|
| 179 |
/** |
| 174 |
* Whether the VM should be resumed on startup |
180 |
* Whether the VM should be resumed on startup |
| 175 |
*/ |
181 |
*/ |
| 176 |
private boolean fResumeOnStartup = false; |
182 |
private boolean fResumeOnStartup = false; |
|
Lines 529-536
Link Here
|
| 529 |
* @see ISuspendResume#canResume() |
535 |
* @see ISuspendResume#canResume() |
| 530 |
*/ |
536 |
*/ |
| 531 |
public boolean canResume() { |
537 |
public boolean canResume() { |
| 532 |
return (isSuspended() || canResumeThreads()) |
538 |
if (isAvailable()) { |
| 533 |
&& isAvailable() && !isPerformingHotCodeReplace(); |
539 |
if (isConsideringBreakpoint()) { |
|
|
540 |
return false; |
| 541 |
} |
| 542 |
return (isSuspended() || canResumeThreads()) && !isPerformingHotCodeReplace(); |
| 543 |
} |
| 544 |
return false; |
| 534 |
} |
545 |
} |
| 535 |
|
546 |
|
| 536 |
/** |
547 |
/** |
|
Lines 552-566
Link Here
|
| 552 |
* @see ISuspendResume#canSuspend() |
563 |
* @see ISuspendResume#canSuspend() |
| 553 |
*/ |
564 |
*/ |
| 554 |
public boolean canSuspend() { |
565 |
public boolean canSuspend() { |
| 555 |
if (!isSuspended() && isAvailable()) { |
566 |
if (isAvailable()) { |
| 556 |
// only allow suspend if no threads are currently suspended |
567 |
if (isConsideringBreakpoint()) { |
| 557 |
IThread[] threads= getThreads(); |
568 |
// quietly suspended.. still pretend to be running |
| 558 |
for (int i= 0, numThreads= threads.length; i < numThreads; i++) { |
569 |
return true; |
| 559 |
if (!((JDIThread)threads[i]).canSuspend()) { |
570 |
} |
| 560 |
return false; |
571 |
if (!isSuspended()) { |
|
|
572 |
// only allow suspend if no threads are currently suspended |
| 573 |
IThread[] threads= getThreads(); |
| 574 |
for (int i= 0, numThreads= threads.length; i < numThreads; i++) { |
| 575 |
if (!((JDIThread)threads[i]).canSuspend()) { |
| 576 |
return false; |
| 577 |
} |
| 561 |
} |
578 |
} |
|
|
579 |
return true; |
| 562 |
} |
580 |
} |
| 563 |
return true; |
|
|
| 564 |
} |
581 |
} |
| 565 |
return false; |
582 |
return false; |
| 566 |
} |
583 |
} |
|
Lines 950-955
Link Here
|
| 950 |
} |
967 |
} |
| 951 |
|
968 |
|
| 952 |
/** |
969 |
/** |
|
|
970 |
* When a VM is suspended it may just be considering a breakpoint - evaluating its condition |
| 971 |
* and notifying listeners, etc. |
| 972 |
* |
| 973 |
* @return whether the VM considering to suspend at a breakpoint |
| 974 |
*/ |
| 975 |
public boolean isConsideringBreakpoint() { |
| 976 |
return fConsideringBreakpoint; |
| 977 |
} |
| 978 |
|
| 979 |
/** |
| 953 |
* Sets whether this VM is suspended. |
980 |
* Sets whether this VM is suspended. |
| 954 |
* |
981 |
* |
| 955 |
* @param suspended whether this VM is suspended |
982 |
* @param suspended whether this VM is suspended |
|
Lines 1302-1309
Link Here
|
| 1302 |
* @param breakpoint the breakpoint that caused the |
1329 |
* @param breakpoint the breakpoint that caused the |
| 1303 |
* suspension |
1330 |
* suspension |
| 1304 |
*/ |
1331 |
*/ |
| 1305 |
public void prepareToSuspendByBreakpoint(JavaBreakpoint breakpoint) { |
1332 |
protected void prepareToSuspendByBreakpoint(JavaBreakpoint breakpoint) { |
| 1306 |
setSuspended(true); |
1333 |
setSuspended(true); |
|
|
1334 |
fConsideringBreakpoint = true; |
| 1307 |
suspendThreads(); |
1335 |
suspendThreads(); |
| 1308 |
} |
1336 |
} |
| 1309 |
|
1337 |
|
|
Lines 1315-1320
Link Here
|
| 1315 |
* suspension |
1343 |
* suspension |
| 1316 |
*/ |
1344 |
*/ |
| 1317 |
protected void suspendedByBreakpoint(JavaBreakpoint breakpoint, boolean queueEvent, EventSet set) { |
1345 |
protected void suspendedByBreakpoint(JavaBreakpoint breakpoint, boolean queueEvent, EventSet set) { |
|
|
1346 |
fConsideringBreakpoint = false; |
| 1318 |
if (queueEvent) { |
1347 |
if (queueEvent) { |
| 1319 |
queueSuspendEvent(DebugEvent.BREAKPOINT, set); |
1348 |
queueSuspendEvent(DebugEvent.BREAKPOINT, set); |
| 1320 |
} else { |
1349 |
} else { |
|
Lines 1329-1334
Link Here
|
| 1329 |
* suspension |
1358 |
* suspension |
| 1330 |
*/ |
1359 |
*/ |
| 1331 |
protected void cancelSuspendByBreakpoint(JavaBreakpoint breakpoint) throws DebugException { |
1360 |
protected void cancelSuspendByBreakpoint(JavaBreakpoint breakpoint) throws DebugException { |
|
|
1361 |
fConsideringBreakpoint = false; |
| 1332 |
setSuspended(false); |
1362 |
setSuspended(false); |
| 1333 |
resumeThreads(); |
1363 |
resumeThreads(); |
| 1334 |
} |
1364 |
} |