Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoreutarass2011-08-03 22:24:57 +0000
committereutarass2011-08-03 22:24:57 +0000
commit8e89b1f6fffdacc46b6123e3f95abf7dd7bf3457 (patch)
treee1e0eebaed38315803158993aa916535a67c1597 /plugins/org.eclipse.tm.tcf.cdt.ui/src
parente424b0946a595f4d08933fa3f027db4774ad68c5 (diff)
downloadorg.eclipse.tcf-8e89b1f6fffdacc46b6123e3f95abf7dd7bf3457.tar.gz
org.eclipse.tcf-8e89b1f6fffdacc46b6123e3f95abf7dd7bf3457.tar.xz
org.eclipse.tcf-8e89b1f6fffdacc46b6123e3f95abf7dd7bf3457.zip
TCF Debugger: changed TCFDebugTextHover code to abort data retrieval when TCF connection is closed.
Diffstat (limited to 'plugins/org.eclipse.tm.tcf.cdt.ui/src')
-rw-r--r--plugins/org.eclipse.tm.tcf.cdt.ui/src/org/eclipse/tm/internal/tcf/cdt/ui/hover/TCFDebugTextHover.java33
1 files changed, 10 insertions, 23 deletions
diff --git a/plugins/org.eclipse.tm.tcf.cdt.ui/src/org/eclipse/tm/internal/tcf/cdt/ui/hover/TCFDebugTextHover.java b/plugins/org.eclipse.tm.tcf.cdt.ui/src/org/eclipse/tm/internal/tcf/cdt/ui/hover/TCFDebugTextHover.java
index bde62b932..fcaf3ecb3 100644
--- a/plugins/org.eclipse.tm.tcf.cdt.ui/src/org/eclipse/tm/internal/tcf/cdt/ui/hover/TCFDebugTextHover.java
+++ b/plugins/org.eclipse.tm.tcf.cdt.ui/src/org/eclipse/tm/internal/tcf/cdt/ui/hover/TCFDebugTextHover.java
@@ -67,19 +67,13 @@ public class TCFDebugTextHover extends AbstractDebugTextHover implements ITextHo
}
public Object getHoverInfo2(ITextViewer textViewer, IRegion hoverRegion) {
- if (!useExpressionExplorer()) {
- return getHoverInfo(textViewer, hoverRegion);
- }
+ if (!useExpressionExplorer()) return getHoverInfo(textViewer, hoverRegion);
final TCFNodeStackFrame activeFrame = getActiveFrame();
- if (activeFrame == null) {
- return null;
- }
+ if (activeFrame == null) return null;
final String text = getExpressionText(textViewer, hoverRegion);
- if (text == null || text.length() == 0) {
- return null;
- }
+ if (text == null || text.length() == 0) return null;
try {
- return new TCFTask<TCFNode>() {
+ return new TCFTask<TCFNode>(activeFrame.getChannel()) {
public void run() {
TCFNode evalContext = activeFrame.isEmulated() ? activeFrame.getParent() : activeFrame;
TCFChildren cache = evalContext.getModel().getHoverExpressionCache(evalContext, text);
@@ -110,21 +104,16 @@ public class TCFDebugTextHover extends AbstractDebugTextHover implements ITextHo
@Override
protected boolean canEvaluate() {
- if (getActiveFrame() == null) {
- return false;
- }
- return true;
+ return getActiveFrame() != null;
}
private TCFNodeStackFrame getActiveFrame() {
IAdaptable context = getSelectionAdaptable();
- if (context instanceof TCFNodeStackFrame) {
- return (TCFNodeStackFrame) context;
- }
+ if (context instanceof TCFNodeStackFrame) return (TCFNodeStackFrame) context;
if (context instanceof TCFNodeExecContext) {
try {
final TCFNodeExecContext exe = (TCFNodeExecContext) context;
- return new TCFTask<TCFNodeStackFrame>() {
+ return new TCFTask<TCFNodeStackFrame>(exe.getChannel()) {
public void run() {
TCFChildrenStackTrace stack = exe.getStackTrace();
if (!stack.validate(this)) return;
@@ -146,12 +135,10 @@ public class TCFDebugTextHover extends AbstractDebugTextHover implements ITextHo
@Override
protected String evaluateExpression(final String expression) {
final TCFNodeStackFrame activeFrame = getActiveFrame();
- if (activeFrame == null) {
- return null;
- }
- return new TCFTask<String>() {
+ if (activeFrame == null) return null;
+ final IChannel channel = activeFrame.getChannel();
+ return new TCFTask<String>(channel) {
public void run() {
- IChannel channel = activeFrame.getChannel();
final IExpressions exprSvc = channel.getRemoteService(IExpressions.class);
if (exprSvc != null) {
TCFNode evalContext = activeFrame.isEmulated() ? activeFrame.getParent() : activeFrame;

Back to the top