aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Keller2012-08-23 08:58:01 (EDT)
committerDani Megert2012-08-23 08:58:01 (EDT)
commit37bafda5d7d586d8f0104a437c3f7725e81010f5 (patch)
tree18d2178746bf22d5bc75096b45d16765005a1abd
parente68d36cd780cb0487929d4b03a8a40a9af092b03 (diff)
downloadeclipse.jdt.debug-37bafda5d7d586d8f0104a437c3f7725e81010f5.zip
eclipse.jdt.debug-37bafda5d7d586d8f0104a437c3f7725e81010f5.tar.gz
eclipse.jdt.debug-37bafda5d7d586d8f0104a437c3f7725e81010f5.tar.bz2
Fixed bug 372030: Cannot resume single thread after VM suspended
-rw-r--r--org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/JDIModelPresentation.java3
-rw-r--r--org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIDebugTarget.java8
-rw-r--r--org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIThread.java5
3 files changed, 9 insertions, 7 deletions
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/JDIModelPresentation.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/JDIModelPresentation.java
index a29ba56..b0b7b60 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/JDIModelPresentation.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/JDIModelPresentation.java
@@ -692,9 +692,6 @@ public class JDIModelPresentation extends LabelProvider implements IDebugModelPr
}
if (item instanceof JDIThread) {
JDIThread jt = (JDIThread) item;
- if (jt.getDebugTarget().isSuspended()) {
- return DebugUITools.getImage(IDebugUIConstants.IMG_OBJS_THREAD_SUSPENDED);
- }
if (jt.isSuspendVoteInProgress()) {
return DebugUITools.getImage(IDebugUIConstants.IMG_OBJS_THREAD_RUNNING);
}
diff --git a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIDebugTarget.java b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIDebugTarget.java
index 717a345..ccdc101 100644
--- a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIDebugTarget.java
+++ b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIDebugTarget.java
@@ -604,7 +604,7 @@ public class JDIDebugTarget extends JDIDebugElement implements
* @see ISuspendResume#canSuspend()
*/
public boolean canSuspend() {
- if (!isSuspended() && isAvailable()) {
+ if (isAvailable()) {
// allow suspend when one or more threads are currently running
IThread[] threads = getThreads();
for (IThread thread : threads) {
@@ -612,7 +612,7 @@ public class JDIDebugTarget extends JDIDebugElement implements
return true;
}
}
- return false;
+ return !isSuspended();
}
return false;
}
@@ -1338,6 +1338,10 @@ public class JDIDebugTarget extends JDIDebugElement implements
*/
public void suspend() throws DebugException {
if (isSuspended()) {
+ IThread[] threads = getThreads();
+ for (IThread thread : threads) {
+ ((JDIThread) thread).suspend();
+ }
return;
}
try {
diff --git a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIThread.java b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIThread.java
index 33d6212..8d5175a 100644
--- a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIThread.java
+++ b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIThread.java
@@ -396,7 +396,8 @@ public class JDIThread extends JDIDebugElement implements IJavaThread {
public boolean canResume() {
return isSuspended()
&& (!isPerformingEvaluation() || isInvokingMethod())
- && !isSuspendVoteInProgress();
+ && !isSuspendVoteInProgress()
+ || getDebugTarget().isSuspended();
}
/*
@@ -1481,7 +1482,7 @@ public class JDIThread extends JDIDebugElement implements IJavaThread {
* @see org.eclipse.debug.core.model.ISuspendResume#resume()
*/
public synchronized void resume() throws DebugException {
- if (getDebugTarget().isSuspended()) {
+ if (!isSuspended() && getDebugTarget().isSuspended()) {
getDebugTarget().resume();
} else {
fClientSuspendRequest = false;