summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Dumais2013-06-19 08:46:30 (EDT)
committerMarc Khouzam2013-06-20 15:51:03 (EDT)
commitbd43cfa615d340fde95bca263dc8a5bcd5741f36 (patch)
tree7e8f89e2014599bfc6e49a06dec8bf33b77142ee
parent0045ca7172abb33691aa85776c5696906107094c (diff)
downloadorg.eclipse.cdt-bd43cfa615d340fde95bca263dc8a5bcd5741f36.zip
org.eclipse.cdt-bd43cfa615d340fde95bca263dc8a5bcd5741f36.tar.gz
org.eclipse.cdt-bd43cfa615d340fde95bca263dc8a5bcd5741f36.tar.bz2
Bug 409512 - [visualizer] Threads not cleaned-up after process detachedrefs/changes/04/13904/6
Change-Id: I5fe41468eb7f1a857ca52e48d8891f77f1800aa8 Reviewed-on: https://git.eclipse.org/r/13904 Reviewed-by: Marc Khouzam <marc.khouzam@ericsson.com> IP-Clean: Marc Khouzam <marc.khouzam@ericsson.com> Tested-by: Marc Khouzam <marc.khouzam@ericsson.com>
-rw-r--r--dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/src/org/eclipse/cdt/dsf/gdb/multicorevisualizer/internal/ui/view/MulticoreVisualizerEventListener.java39
1 files changed, 37 insertions, 2 deletions
diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/src/org/eclipse/cdt/dsf/gdb/multicorevisualizer/internal/ui/view/MulticoreVisualizerEventListener.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/src/org/eclipse/cdt/dsf/gdb/multicorevisualizer/internal/ui/view/MulticoreVisualizerEventListener.java
index d4af4ca..146d195 100644
--- a/dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/src/org/eclipse/cdt/dsf/gdb/multicorevisualizer/internal/ui/view/MulticoreVisualizerEventListener.java
+++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/src/org/eclipse/cdt/dsf/gdb/multicorevisualizer/internal/ui/view/MulticoreVisualizerEventListener.java
@@ -11,6 +11,7 @@
* Marc Dumais (Ericsson) - Bug 399419
* Marc Dumais (Ericsson) - Bug 405390
* Marc Dumais (Ericsson) - Bug 396269
+ * Marc Dumais (Ericsson) - Bug 409512
*******************************************************************************/
package org.eclipse.cdt.dsf.gdb.multicorevisualizer.internal.ui.view;
@@ -229,15 +230,49 @@ public class MulticoreVisualizerEventListener {
@DsfServiceEventHandler
public void handleEvent(IExitedDMEvent event) {
IDMContext context = event.getDMContext();
+ final MulticoreVisualizerCanvas canvas = fVisualizer.getMulticoreVisualizerCanvas();
+
if (context instanceof IContainerDMContext) {
- // We don't deal with processes
+ // process exited
+
+ // Note: this is required because we noticed that in GDB 7.6 and older,
+ // the "thread exited" signal is not sent for the local detach case.
+ // see bug 409512
+ DsfServicesTracker tracker =
+ new DsfServicesTracker(MulticoreVisualizerUIPlugin.getBundleContext(),
+ context.getSessionId());
+ IProcesses procService = tracker.getService(IProcesses.class);
+ tracker.dispose();
+
+ // get all threads associated to this process and
+ // mark them as exited in the model.
+ procService.getProcessesBeingDebugged(context,
+ new ImmediateDataRequestMonitor<IDMContext[]>() {
+ @Override
+ protected void handleSuccess() {
+ assert getData() != null;
+
+ IDMContext[] contexts = getData();
+ for (IDMContext c : contexts) {
+ if (c instanceof IMIExecutionDMContext) {
+ int tid = ((IMIExecutionDMContext)c).getThreadId();
+ fVisualizer.getModel().markThreadExited(tid);
+ }
+ }
+
+ if (canvas != null) {
+ canvas.requestUpdate();
+ }
+ }
+ });
+
+
} else if (context instanceof IMIExecutionDMContext) {
// Thread exited
int tid = ((IMIExecutionDMContext)context).getThreadId();
fVisualizer.getModel().markThreadExited(tid);
- MulticoreVisualizerCanvas canvas = fVisualizer.getMulticoreVisualizerCanvas();
if (canvas != null) {
canvas.requestUpdate();
}