Bug 559579 - Wrong Debug view selection, if view is opened post launch

When opening the Debug view after a Java launch is started, the already
suspended threads are not recorded in ThreadEventHandler.fThreadQueue.

As a result, the following sequence breaks the Debug view selection:

1. Open the Debug view after Thread-1 is already suspended.
2. Thread-2 becomes suspended.
3. Resume Thread-2.
4. Thread-1 (which is still suspended) is not selected. Instead, e.g.
the debug launch itself is selected, or the resumed Thread-2 is

This behavior is not seen if the Debug view is opened prior the Java
application debug launch.

In the case of JDT, the set of suspended threads
ThreadEventHandler.fThreadQueue is updated on JVM thread suspend events
and Debug view tree expand events. However, the way
TreeModelContentProvider "expands" suspended threads does not trigger
SWT expand events, when the Debug view is opened and
JavaDebugTargetProxy installs itself.

This change ensures that JavaThreadEventHandler is initialized with the
already suspended threads, on Debug view open. JavaDebugTargetProxy will
go over the suspended thread delta and add suspended threads to

Change-Id: I9dfc581b25105bbca0a82f9bf974a7bc7c496e4f
Signed-off-by: Simeon Andreev <simeon.danailov.andreev@gmail.com>
2 files changed