Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDarin Wright2008-01-15 17:53:03 +0000
committerDarin Wright2008-01-15 17:53:03 +0000
commit30b9604c85356693dbde0ffca5fc7cc648904e46 (patch)
tree5705c052373f872c047479d74b8893492ab13218 /org.eclipse.debug.ui
parent6c436b1863ecb8bfe1b8f4cfcfc7672c88fd53d0 (diff)
downloadeclipse.platform.debug-30b9604c85356693dbde0ffca5fc7cc648904e46.tar.gz
eclipse.platform.debug-30b9604c85356693dbde0ffca5fc7cc648904e46.tar.xz
eclipse.platform.debug-30b9604c85356693dbde0ffca5fc7cc648904e46.zip
Bug 215242 - Debuggers cannot set the selected frame for Suspend events
Diffstat (limited to 'org.eclipse.debug.ui')
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/ThreadEventHandler.java25
1 files changed, 17 insertions, 8 deletions
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/ThreadEventHandler.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/ThreadEventHandler.java
index 2cfad005c..aa952bb45 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/ThreadEventHandler.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/ThreadEventHandler.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2007 IBM Corporation and others.
+ * Copyright (c) 2005, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -89,7 +89,7 @@ public class ThreadEventHandler extends DebugEventHandler {
if (event.getDetail() == DebugEvent.BREAKPOINT | event.getDetail() == DebugEvent.CLIENT_REQUEST) {
extras = IModelDelta.EXPAND;
}
- fireDeltaUpdatingTopFrame(thread, IModelDelta.NO_CHANGE | extras, event);
+ fireDeltaUpdatingSelectedFrame(thread, IModelDelta.NO_CHANGE | extras, event);
}
}
@@ -108,7 +108,7 @@ public class ThreadEventHandler extends DebugEventHandler {
fireDeltaAndClearTopFrame(thread, IModelDelta.STATE | IModelDelta.CONTENT | IModelDelta.SELECT);
thread = getNextSuspendedThread();
if (thread != null) {
- fireDeltaUpdatingTopFrame(thread, IModelDelta.NO_CHANGE, event);
+ fireDeltaUpdatingSelectedFrame(thread, IModelDelta.NO_CHANGE, event);
}
}
@@ -149,7 +149,7 @@ public class ThreadEventHandler extends DebugEventHandler {
} catch (DebugException e) {
}
} else {
- fireDeltaUpdatingTopFrame(thread, IModelDelta.CONTENT | IModelDelta.EXPAND, resume);
+ fireDeltaUpdatingSelectedFrame(thread, IModelDelta.CONTENT | IModelDelta.EXPAND, resume);
}
}
@@ -202,7 +202,7 @@ public class ThreadEventHandler extends DebugEventHandler {
fireDelta(delta);
}
- private void fireDeltaUpdatingTopFrame(IThread thread, int flags, DebugEvent event) {
+ private void fireDeltaUpdatingSelectedFrame(IThread thread, int flags, DebugEvent event) {
ModelDelta delta = buildRootDelta();
ModelDelta node = addPathToThread(delta, thread);
IStackFrame prev = null;
@@ -211,7 +211,12 @@ public class ThreadEventHandler extends DebugEventHandler {
}
IStackFrame frame = null;
try {
- frame = thread.getTopStackFrame();
+ Object frameToSelect = event.getData();
+ if (frameToSelect == null || !(frameToSelect instanceof IStackFrame)) {
+ frame = thread.getTopStackFrame();
+ } else {
+ frame = (IStackFrame)frameToSelect;
+ }
} catch (DebugException e) {
}
int threadIndex = indexOf(thread);
@@ -260,11 +265,15 @@ public class ThreadEventHandler extends DebugEventHandler {
/**
* Returns the index of the given frame, relative to its parent in the view.
*
- * @param frame frame
+ * @param frame stack frame
* @return index of the frame, relative to its thread
*/
protected int indexOf(IStackFrame frame) {
- return 0;
+ try {
+ return indexOf(frame.getThread().getStackFrames(), frame);
+ } catch (DebugException e) {
+ return -1;
+ }
}
/**

Back to the top