Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Blackburn2009-11-24 10:12:35 -0500
committerJames Blackburn2009-11-24 10:12:35 -0500
commit3d3b6c4b4c1f02e96bb84e43a1d914f3a8fb2810 (patch)
treefb97ea6bf050d6fabb1cb3ae36b028a2a37a9d6c /debug/org.eclipse.cdt.debug.mi.core
parentca19a9fd5902f74ca1ef139e62513228716f4455 (diff)
downloadorg.eclipse.cdt-3d3b6c4b4c1f02e96bb84e43a1d914f3a8fb2810.tar.gz
org.eclipse.cdt-3d3b6c4b4c1f02e96bb84e43a1d914f3a8fb2810.tar.xz
org.eclipse.cdt-3d3b6c4b4c1f02e96bb84e43a1d914f3a8fb2810.zip
Bug 296006 nullify cached underlying Expression Variable if it's unable to provide value string
Diffstat (limited to 'debug/org.eclipse.cdt.debug.mi.core')
-rw-r--r--debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/model/Expression.java16
1 files changed, 12 insertions, 4 deletions
diff --git a/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/model/Expression.java b/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/model/Expression.java
index 8a0df26e4b..828404ff64 100644
--- a/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/model/Expression.java
+++ b/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/model/Expression.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2006 QNX Software Systems and others.
+ * Copyright (c) 2000, 2009 QNX Software Systems 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
@@ -105,11 +105,18 @@ public class Expression extends CObject implements ICDIExpression {
mgr.deleteVariable(fVariable);
fVariable = null;
}
+ fContext = context;
+ if (fVariable != null) {
+ // Reuse the variable so we don't have to ask gdb to create another one. Bug 150565.
+ try {
+ // It's possible this variable is no longer valid... (Bug 296006)
+ fVariable.getValue().getValueString();
+ } catch (CDIException e) {
+ fVariable = null;
+ }
+ }
if (fVariable == null)
- { // Reuse the variable so we don't have to ask gdb to create another one. Bug 150565.
fVariable = mgr.createVariable((StackFrame)context, getExpressionText());
- }
- fContext = context;
return fVariable.getValue();
}
@@ -122,6 +129,7 @@ public class Expression extends CObject implements ICDIExpression {
mgr.destroyExpressions((Target)getTarget(), new Expression[] {this});
if (fVariable != null)
mgr.deleteVariable(fVariable);
+ fVariable = null;
}
}

Back to the top