summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Dumais2013-02-15 09:14:34 (EST)
committer Marc Khouzam2013-06-20 12:32:27 (EDT)
commit0045ca7172abb33691aa85776c5696906107094c (patch)
treeeae5020ba2f920d908e41bf7c01cd5fd96f26469
parent94a7ef56dd0dbc27676a6c823e709e9db6dfa653 (diff)
downloadorg.eclipse.cdt-0045ca7172abb33691aa85776c5696906107094c.zip
org.eclipse.cdt-0045ca7172abb33691aa85776c5696906107094c.tar.gz
org.eclipse.cdt-0045ca7172abb33691aa85776c5696906107094c.tar.bz2
Bug 396269 - [visualizer] NPE in MulticoreVisualizerCanvas.paintCanvas()refs/changes/56/9156/5
Change-Id: Id14d62c18db200c4f71ec3e9afaa6d9a39d5a8f4 Reviewed-on: https://git.eclipse.org/r/9156 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.java9
1 files changed, 9 insertions, 0 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 d0e71eb..d4af4ca 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
@@ -10,6 +10,7 @@
* Marc Dumais (Ericsson) - Bug 400231
* Marc Dumais (Ericsson) - Bug 399419
* Marc Dumais (Ericsson) - Bug 405390
+ * Marc Dumais (Ericsson) - Bug 396269
*******************************************************************************/
package org.eclipse.cdt.dsf.gdb.multicorevisualizer.internal.ui.view;
@@ -188,6 +189,14 @@ public class MulticoreVisualizerEventListener {
assert cores.length == 1; // A thread belongs to a single core
int coreId = Integer.parseInt(cores[0]);
VisualizerCore vCore = fVisualizer.getModel().getCore(coreId);
+ // There is a race condition that sometimes happens here. We can reach
+ // here because we were notified that a thread is started, but the model
+ // is not yet completely constructed. If the model doesn't yet contain the
+ // core the thread runs-on, the getCore() call above will return null. This
+ // will later cause a problem when we try to draw this thread, if we allow
+ // this to pass. See Bug 396269/
+ if (vCore == null)
+ return;
int pid = Integer.parseInt(processContext.getProcId());
int tid = execDmc.getThreadId();