Bug 551465 - [Moka] When a thread is suspended the top stack frame is
not automatically selected

In ThreadEventHandler.fireDeltaUpdatingSelectedFrame() this method check
the index of Thread.getTopStackFrame() in the list of StackFrame
Thread.getStackFrames() but in the case of the ExecutionEngineThread the
top stackFrame was not part of the list of stackFrame since a new object
was created each time.

Change-Id: I187fc5a630c7f694fe3a84114cd64fca65c51cb8
Signed-off-by: Pauline DEVILLE <pauline.deville@cea.fr>
diff --git a/plugins/org.eclipse.papyrus.moka.kernel.debug/src/org/eclipse/papyrus/moka/debugtarget/ExecutionEngineThread.java b/plugins/org.eclipse.papyrus.moka.kernel.debug/src/org/eclipse/papyrus/moka/debugtarget/ExecutionEngineThread.java
index 94cae0f..ef475aa 100644
--- a/plugins/org.eclipse.papyrus.moka.kernel.debug/src/org/eclipse/papyrus/moka/debugtarget/ExecutionEngineThread.java
+++ b/plugins/org.eclipse.papyrus.moka.kernel.debug/src/org/eclipse/papyrus/moka/debugtarget/ExecutionEngineThread.java
@@ -29,11 +29,17 @@
 	 * ID of the thread running the active object
 	 */
 	private String id;
+	
+	/**
+	 * The stack frame of the thread
+	 */
+	private ExecutionEngineStackFrame stackFrame;
 
 	public ExecutionEngineThread(IDebugTarget target) {
 		super(target);
 		status = DebugElementStatus.RUNNING;
 		statusLock = new ReentrantLock(true);
+		stackFrame = new ExecutionEngineStackFrame(this);
 	}
 
 	/**
@@ -203,7 +209,7 @@
 	@Override
 	public IStackFrame[] getStackFrames() throws DebugException {
 		if (isSuspended()) {
-			return new IStackFrame[]{new ExecutionEngineStackFrame(this)};
+			return new IStackFrame[]{stackFrame};
 		}
 		return new IStackFrame[0];
 	}
@@ -227,7 +233,7 @@
 	public IStackFrame getTopStackFrame() throws DebugException {
 		IStackFrame top = null;
 		if (isSuspended()) {
-			top = new ExecutionEngineStackFrame(this);
+			top = stackFrame;
 		}
 		return top;
 	}