mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-29 20:05:35 +02:00
[268254] Unnecessary call to getExpressionData() from the register service.
This commit is contained in:
parent
56d9382ab8
commit
7191ded39d
1 changed files with 25 additions and 30 deletions
|
@ -19,10 +19,10 @@ import org.eclipse.cdt.dsf.datamodel.AbstractDMContext;
|
||||||
import org.eclipse.cdt.dsf.datamodel.DMContexts;
|
import org.eclipse.cdt.dsf.datamodel.DMContexts;
|
||||||
import org.eclipse.cdt.dsf.datamodel.IDMContext;
|
import org.eclipse.cdt.dsf.datamodel.IDMContext;
|
||||||
import org.eclipse.cdt.dsf.debug.service.ICachingService;
|
import org.eclipse.cdt.dsf.debug.service.ICachingService;
|
||||||
|
import org.eclipse.cdt.dsf.debug.service.IExpressions;
|
||||||
import org.eclipse.cdt.dsf.debug.service.IRegisters;
|
import org.eclipse.cdt.dsf.debug.service.IRegisters;
|
||||||
import org.eclipse.cdt.dsf.debug.service.IRunControl;
|
import org.eclipse.cdt.dsf.debug.service.IRunControl;
|
||||||
import org.eclipse.cdt.dsf.debug.service.IExpressions.IExpressionDMContext;
|
import org.eclipse.cdt.dsf.debug.service.IExpressions.IExpressionDMContext;
|
||||||
import org.eclipse.cdt.dsf.debug.service.IExpressions.IExpressionDMData;
|
|
||||||
import org.eclipse.cdt.dsf.debug.service.IRunControl.IContainerDMContext;
|
import org.eclipse.cdt.dsf.debug.service.IRunControl.IContainerDMContext;
|
||||||
import org.eclipse.cdt.dsf.debug.service.IRunControl.StateChangeReason;
|
import org.eclipse.cdt.dsf.debug.service.IRunControl.StateChangeReason;
|
||||||
import org.eclipse.cdt.dsf.debug.service.command.CommandCache;
|
import org.eclipse.cdt.dsf.debug.service.command.CommandCache;
|
||||||
|
@ -510,36 +510,31 @@ public class MIRegisters extends AbstractDsfService implements IRegisters, ICach
|
||||||
final MIRegisterDMC regDmc = (MIRegisterDMC)regCtx;
|
final MIRegisterDMC regDmc = (MIRegisterDMC)regCtx;
|
||||||
// There is only one group and its number must be 0.
|
// There is only one group and its number must be 0.
|
||||||
if ( grpDmc.getGroupNo() == 0 ) {
|
if ( grpDmc.getGroupNo() == 0 ) {
|
||||||
final MIExpressions exprService = getServicesTracker().getService(MIExpressions.class);
|
final IExpressions exprService = getServicesTracker().getService(IExpressions.class);
|
||||||
String regName = regDmc.getName();
|
String regName = regDmc.getName();
|
||||||
final IExpressionDMContext exprCtxt = exprService.createExpression(regCtx, "$" + regName); //$NON-NLS-1$
|
final IExpressionDMContext exprCtxt = exprService.createExpression(regCtx, "$" + regName); //$NON-NLS-1$
|
||||||
exprService.getExpressionData(exprCtxt, new DataRequestMonitor<IExpressionDMData>(getExecutor(), rm) {
|
|
||||||
@Override
|
final FormattedValueDMContext valueDmc = exprService.getFormattedValueContext(exprCtxt, formatId);
|
||||||
protected void handleSuccess() {
|
exprService.getFormattedExpressionValue(
|
||||||
// Evaluate the expression - request HEX since it works in every case
|
valueDmc,
|
||||||
final FormattedValueDMContext valueDmc = exprService.getFormattedValueContext(exprCtxt, formatId);
|
new DataRequestMonitor<FormattedValueDMData>(getExecutor(), rm) {
|
||||||
exprService.getFormattedExpressionValue(
|
@Override
|
||||||
valueDmc,
|
protected void handleSuccess() {
|
||||||
new DataRequestMonitor<FormattedValueDMData>(getExecutor(), rm) {
|
if(! regValue.equals(getData().getFormattedValue()) || ! valueDmc.getFormatID().equals(formatId)){
|
||||||
@Override
|
exprService.writeExpression(exprCtxt, regValue, formatId, new DataRequestMonitor<MIInfo>(getExecutor(), rm) {
|
||||||
protected void handleSuccess() {
|
@Override
|
||||||
if(! regValue.equals(getData().getFormattedValue()) || ! valueDmc.getFormatID().equals(formatId)){
|
protected void handleSuccess() {
|
||||||
exprService.writeExpression(exprCtxt, regValue, formatId, new DataRequestMonitor<MIInfo>(getExecutor(), rm) {
|
generateRegisterChangedEvent(regDmc);
|
||||||
@Override
|
rm.done();
|
||||||
protected void handleSuccess() {
|
}
|
||||||
generateRegisterChangedEvent(regDmc);
|
});
|
||||||
rm.done();
|
}//if
|
||||||
}
|
else {
|
||||||
});
|
rm.done();
|
||||||
}//if
|
}
|
||||||
else {
|
}//handleSuccess
|
||||||
rm.done();
|
}
|
||||||
}
|
);
|
||||||
}//handleOK
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
rm.setStatus(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, NOT_SUPPORTED, "Invalid group = " + grpDmc, null)); //$NON-NLS-1$
|
rm.setStatus(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, NOT_SUPPORTED, "Invalid group = " + grpDmc, null)); //$NON-NLS-1$
|
||||||
|
|
Loading…
Add table
Reference in a new issue