Lines 45-50
Link Here
|
45 |
* This class implements a debugger expression evaluator as a DSF service. The primary |
45 |
* This class implements a debugger expression evaluator as a DSF service. The primary |
46 |
* interface that clients of this class should use is IExpressions. |
46 |
* interface that clients of this class should use is IExpressions. |
47 |
*/ |
47 |
*/ |
|
|
48 |
@SuppressWarnings("nls") |
48 |
public class ExpressionService extends AbstractDsfService implements IExpressions |
49 |
public class ExpressionService extends AbstractDsfService implements IExpressions |
49 |
{ |
50 |
{ |
50 |
/** |
51 |
/** |
Lines 108-119
Link Here
|
108 |
return null; |
109 |
return null; |
109 |
} |
110 |
} |
110 |
|
111 |
|
111 |
public String getNaturalValue() |
|
|
112 |
{ |
113 |
// ISSUE: Is this correct? |
114 |
return Integer.toString(Integer.parseInt(expressionValue, 10)); |
115 |
} |
116 |
|
117 |
public IRegisterDMContext getRegister() |
112 |
public IRegisterDMContext getRegister() |
118 |
{ |
113 |
{ |
119 |
return null; |
114 |
return null; |
Lines 134-149
Link Here
|
134 |
return null; |
129 |
return null; |
135 |
} |
130 |
} |
136 |
|
131 |
|
137 |
/** |
|
|
138 |
* @see IExpressions.getArrayLength() |
139 |
*/ |
140 |
public long getArrayLength() { |
132 |
public long getArrayLength() { |
141 |
return -1; |
133 |
return -1; |
142 |
} |
134 |
} |
143 |
|
135 |
|
144 |
/** |
|
|
145 |
* @see IExpressions.getFields() |
146 |
*/ |
147 |
public Iterator<String> getFields() { |
136 |
public Iterator<String> getFields() { |
148 |
return null; |
137 |
return null; |
149 |
} |
138 |
} |
Lines 162-168
Link Here
|
162 |
*/ |
151 |
*/ |
163 |
private void doInitialize(RequestMonitor requestMonitor) |
152 |
private void doInitialize(RequestMonitor requestMonitor) |
164 |
{ |
153 |
{ |
165 |
fServiceDMC = new ServiceDMContext<ExpressionService>(this, "#expression"); //$NON-NLS-1$ |
154 |
fServiceDMC = new ServiceDMContext<ExpressionService>(this, "#expression"); |
166 |
|
155 |
|
167 |
// Obtain a reference to the MIRunControl object that enables this service to |
156 |
// Obtain a reference to the MIRunControl object that enables this service to |
168 |
// communication with GDB using the MI protocol. |
157 |
// communication with GDB using the MI protocol. |
Lines 234-240
Link Here
|
234 |
}; |
223 |
}; |
235 |
|
224 |
|
236 |
// Create an MIVarEvaluateExpression command and have GDB execute it. |
225 |
// Create an MIVarEvaluateExpression command and have GDB execute it. |
237 |
DsfMIVarEvaluateExpression varEvalExpressionCmd = new DsfMIVarEvaluateExpression("expr"); //$NON-NLS-1$ |
226 |
DsfMIVarEvaluateExpression varEvalExpressionCmd = new DsfMIVarEvaluateExpression("expr"); |
238 |
|
227 |
|
239 |
fExpressionCache.execute(varEvalExpressionCmd, varEvalCallback); |
228 |
fExpressionCache.execute(varEvalExpressionCmd, varEvalCallback); |
240 |
} |
229 |
} |
Lines 242-248
Link Here
|
242 |
|
231 |
|
243 |
// Create an MIVarCreate command and have GDB execute it. |
232 |
// Create an MIVarCreate command and have GDB execute it. |
244 |
|
233 |
|
245 |
DsfMIVarCreate varCreateCmd = new DsfMIVarCreate(null, "expr", dmc.getExpression()); //$NON-NLS-1$ |
234 |
DsfMIVarCreate varCreateCmd = new DsfMIVarCreate(null, "expr", dmc.getExpression()); |
246 |
|
235 |
|
247 |
fExpressionCache.execute(varCreateCmd, varCreateCallback); |
236 |
fExpressionCache.execute(varCreateCmd, varCreateCallback); |
248 |
} |
237 |
} |
Lines 347-353
Link Here
|
347 |
@Override |
336 |
@Override |
348 |
public String toString() |
337 |
public String toString() |
349 |
{ |
338 |
{ |
350 |
return baseToString() + ".expr[" + expression + "]"; //$NON-NLS-1$ //$NON-NLS-2$ $NON-NLS-2$ |
339 |
return baseToString() + ".expr[" + expression + "]"; |
351 |
} |
340 |
} |
352 |
|
341 |
|
353 |
/** |
342 |
/** |
Lines 439-445
Link Here
|
439 |
rm.done(); |
428 |
rm.done(); |
440 |
} else { |
429 |
} else { |
441 |
rm.setStatus(new Status(IStatus.ERROR, DsfMIPlugin.PLUGIN_ID, -1, |
430 |
rm.setStatus(new Status(IStatus.ERROR, DsfMIPlugin.PLUGIN_ID, -1, |
442 |
"Unknown DMC type", null)); //$NON-NLS-1$ |
431 |
"Unknown DMC type", null)); |
443 |
rm.done(); |
432 |
rm.done(); |
444 |
} |
433 |
} |
445 |
} |
434 |
} |
Lines 525-543
Link Here
|
525 |
public void getBaseExpressions(IExpressionDMContext exprContext, |
514 |
public void getBaseExpressions(IExpressionDMContext exprContext, |
526 |
DataRequestMonitor<IExpressionDMContext[]> rm) |
515 |
DataRequestMonitor<IExpressionDMContext[]> rm) |
527 |
{ |
516 |
{ |
528 |
rm.setStatus(new Status(IStatus.ERROR, DsfMIPlugin.PLUGIN_ID, NOT_SUPPORTED, "Not supported", null)); //$NON-NLS-1$ |
517 |
rm.setStatus(new Status(IStatus.ERROR, DsfMIPlugin.PLUGIN_ID, NOT_SUPPORTED, "Not supported", null)); |
529 |
rm.done(); |
518 |
rm.done(); |
530 |
} |
519 |
} |
531 |
|
520 |
|
532 |
public void getSubExpressions(IExpressionDMContext exprCtx, |
521 |
public void getSubExpressions(IExpressionDMContext exprCtx, |
533 |
DataRequestMonitor<Iterable<IExpressionDMContext>> rm) |
522 |
DataRequestMonitor<Iterable<IExpressionDMContext>> rm) |
534 |
{ |
523 |
{ |
535 |
rm.setStatus(new Status(IStatus.ERROR, DsfMIPlugin.PLUGIN_ID, NOT_SUPPORTED, "Not supported", null)); //$NON-NLS-1$ |
524 |
rm.setStatus(new Status(IStatus.ERROR, DsfMIPlugin.PLUGIN_ID, NOT_SUPPORTED, "Not supported", null)); |
536 |
rm.done(); |
525 |
rm.done(); |
537 |
} |
526 |
} |
538 |
|
527 |
|
539 |
public void getAvailableFormattedValues(IFormattedDataDMContext<?> dmc, DataRequestMonitor<String[]> rm) { |
528 |
public void getAvailableFormattedValues(IFormattedDataDMContext<?> dmc, DataRequestMonitor<String[]> rm) { |
540 |
rm.setStatus(new Status(IStatus.ERROR, DsfMIPlugin.PLUGIN_ID, NOT_SUPPORTED, "Not supported", null)); //$NON-NLS-1$ |
529 |
rm.setStatus(new Status(IStatus.ERROR, DsfMIPlugin.PLUGIN_ID, NOT_SUPPORTED, "Not supported", null)); |
541 |
rm.done(); |
530 |
rm.done(); |
542 |
} |
531 |
} |
543 |
|
532 |
|