Lines 13-22
Link Here
|
13 |
|
13 |
|
14 |
import java.util.HashMap; |
14 |
import java.util.HashMap; |
15 |
import java.util.Map; |
15 |
import java.util.Map; |
|
|
16 |
import java.util.concurrent.ExecutionException; |
16 |
|
17 |
|
17 |
import org.eclipse.cdt.debug.core.model.ICastToArray; |
18 |
import org.eclipse.cdt.debug.core.model.ICastToArray; |
18 |
import org.eclipse.cdt.debug.core.model.ICastToType; |
19 |
import org.eclipse.cdt.debug.core.model.ICastToType; |
|
|
20 |
import org.eclipse.cdt.dsf.concurrent.DataRequestMonitor; |
19 |
import org.eclipse.cdt.dsf.concurrent.IDsfStatusConstants; |
21 |
import org.eclipse.cdt.dsf.concurrent.IDsfStatusConstants; |
|
|
22 |
import org.eclipse.cdt.dsf.concurrent.Query; |
20 |
import org.eclipse.cdt.dsf.datamodel.AbstractDMEvent; |
23 |
import org.eclipse.cdt.dsf.datamodel.AbstractDMEvent; |
21 |
import org.eclipse.cdt.dsf.datamodel.DMContexts; |
24 |
import org.eclipse.cdt.dsf.datamodel.DMContexts; |
22 |
import org.eclipse.cdt.dsf.debug.service.IExpressions.IExpressionChangedDMEvent; |
25 |
import org.eclipse.cdt.dsf.debug.service.IExpressions.IExpressionChangedDMEvent; |
Lines 57-64
Link Here
|
57 |
this.memento = createCastedExpressionMemento(exprDMC); |
60 |
this.memento = createCastedExpressionMemento(exprDMC); |
58 |
} |
61 |
} |
59 |
|
62 |
|
|
|
63 |
public class TestExpressions2Query extends Query<Boolean> { |
64 |
|
65 |
public TestExpressions2Query() { |
66 |
super(); |
67 |
} |
68 |
|
69 |
@Override |
70 |
protected void execute(final DataRequestMonitor<Boolean> rm) { |
71 |
/* |
72 |
* We're in another dispatch, so we must guard against executor |
73 |
* shutdown again. |
74 |
*/ |
75 |
final DsfSession session = DsfSession.getSession( |
76 |
dmvmProvider.getSession().getId()); |
77 |
if (session == null) { |
78 |
cancel(false); |
79 |
rm.done(); |
80 |
return; |
81 |
} |
82 |
|
83 |
DsfServicesTracker tracker = new DsfServicesTracker( |
84 |
DsfUIPlugin.getBundleContext(), dmvmProvider.getSession().getId()); |
85 |
IExpressions2 expressions2 = tracker.getService(IExpressions2.class); |
86 |
rm.setData(expressions2 != null); |
87 |
rm.done(); |
88 |
tracker.dispose(); |
89 |
} |
90 |
} |
91 |
|
60 |
private boolean isValid() { |
92 |
private boolean isValid() { |
61 |
return (serviceTracker.getService(IExpressions2.class) != null && exprDMC != null); |
93 |
TestExpressions2Query query = new TestExpressions2Query(); |
|
|
94 |
dmvmProvider.getSession().getExecutor().execute(query); |
95 |
|
96 |
try { |
97 |
/* |
98 |
* Return value is irrelevant, any error would come through with an |
99 |
* exception. |
100 |
*/ |
101 |
return query.get(); |
102 |
} catch (InterruptedException e) { |
103 |
assert false; |
104 |
return false; |
105 |
} catch (ExecutionException e) { |
106 |
return false; |
107 |
} |
62 |
} |
108 |
} |
63 |
|
109 |
|
64 |
private void throwIfNotValid() throws DebugException { |
110 |
private void throwIfNotValid() throws DebugException { |