mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Bugzilla 247572 - simplified and speeded up the code a little bit.
This commit is contained in:
parent
440f96fa1a
commit
3a7f114e31
1 changed files with 25 additions and 54 deletions
|
@ -259,8 +259,8 @@ public class VariableVMNode extends AbstractExpressionVMNode
|
||||||
if (localColumns == null)
|
if (localColumns == null)
|
||||||
localColumns = new String[] { IDebugVMConstants.COLUMN_ID__NAME };
|
localColumns = new String[] { IDebugVMConstants.COLUMN_ID__NAME };
|
||||||
|
|
||||||
boolean weAreExtractingFormattedData = false;
|
int extractingFormattedDataIndex = -1;
|
||||||
boolean weAreExtractingAddressData = false;
|
int extractingAddressDataIndex = -1;
|
||||||
|
|
||||||
for (int idx = 0; idx < localColumns.length; idx++) {
|
for (int idx = 0; idx < localColumns.length; idx++) {
|
||||||
if (IDebugVMConstants.COLUMN_ID__NAME.equals(localColumns[idx])) {
|
if (IDebugVMConstants.COLUMN_ID__NAME.equals(localColumns[idx])) {
|
||||||
|
@ -268,9 +268,9 @@ public class VariableVMNode extends AbstractExpressionVMNode
|
||||||
} else if (IDebugVMConstants.COLUMN_ID__TYPE.equals(localColumns[idx])) {
|
} else if (IDebugVMConstants.COLUMN_ID__TYPE.equals(localColumns[idx])) {
|
||||||
update.setLabel(getData().getTypeName(), idx);
|
update.setLabel(getData().getTypeName(), idx);
|
||||||
} else if (IDebugVMConstants.COLUMN_ID__VALUE.equals(localColumns[idx])) {
|
} else if (IDebugVMConstants.COLUMN_ID__VALUE.equals(localColumns[idx])) {
|
||||||
weAreExtractingFormattedData = true;
|
extractingFormattedDataIndex = idx;
|
||||||
} else if (IDebugVMConstants.COLUMN_ID__ADDRESS.equals(localColumns[idx])) {
|
} else if (IDebugVMConstants.COLUMN_ID__ADDRESS.equals(localColumns[idx])) {
|
||||||
weAreExtractingAddressData = true;
|
extractingAddressDataIndex = idx;
|
||||||
} else if (IDebugVMConstants.COLUMN_ID__DESCRIPTION.equals(localColumns[idx])) {
|
} else if (IDebugVMConstants.COLUMN_ID__DESCRIPTION.equals(localColumns[idx])) {
|
||||||
update.setLabel("", idx);
|
update.setLabel("", idx);
|
||||||
} else if (IDebugVMConstants.COLUMN_ID__EXPRESSION.equals(localColumns[idx])) {
|
} else if (IDebugVMConstants.COLUMN_ID__EXPRESSION.equals(localColumns[idx])) {
|
||||||
|
@ -285,7 +285,7 @@ public class VariableVMNode extends AbstractExpressionVMNode
|
||||||
update.setFontData(JFaceResources.getFontDescriptor(IInternalDebugUIConstants.VARIABLE_TEXT_FONT).getFontData()[0], idx);
|
update.setFontData(JFaceResources.getFontDescriptor(IInternalDebugUIConstants.VARIABLE_TEXT_FONT).getFontData()[0], idx);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( ! weAreExtractingFormattedData && ! weAreExtractingAddressData ) {
|
if ( ( extractingFormattedDataIndex == -1 ) && ( extractingAddressDataIndex == 1 ) ) {
|
||||||
update.done();
|
update.done();
|
||||||
} else {
|
} else {
|
||||||
/*
|
/*
|
||||||
|
@ -299,15 +299,10 @@ public class VariableVMNode extends AbstractExpressionVMNode
|
||||||
new MultiRequestMonitor<RequestMonitor>(dsfExecutor, null) {
|
new MultiRequestMonitor<RequestMonitor>(dsfExecutor, null) {
|
||||||
@Override
|
@Override
|
||||||
public void handleCompleted() {
|
public void handleCompleted() {
|
||||||
// Now that all the calls to getModelData() are complete, we create an
|
|
||||||
// IExpressionDMContext object for each local variable name, saving them all
|
|
||||||
// in an array.
|
|
||||||
|
|
||||||
if (!isSuccess()) {
|
if (!isSuccess()) {
|
||||||
handleFailedUpdate(update);
|
handleFailedUpdate(update);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
update.done();
|
update.done();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -315,13 +310,8 @@ public class VariableVMNode extends AbstractExpressionVMNode
|
||||||
/*
|
/*
|
||||||
* Deal with the value.
|
* Deal with the value.
|
||||||
*/
|
*/
|
||||||
if ( weAreExtractingFormattedData ) {
|
if ( extractingFormattedDataIndex != -1 ) {
|
||||||
boolean found = false;
|
RequestMonitor rm = new RequestMonitor(dsfExecutor, null) {
|
||||||
for (int idx = 0; idx < localColumns.length; idx++) {
|
|
||||||
if (IDebugVMConstants.COLUMN_ID__VALUE.equals(localColumns[idx])) {
|
|
||||||
found = true;
|
|
||||||
RequestMonitor rm =
|
|
||||||
new RequestMonitor(dsfExecutor, null) {
|
|
||||||
@Override
|
@Override
|
||||||
public void handleCompleted() {
|
public void handleCompleted() {
|
||||||
mrm.requestMonitorDone(this);
|
mrm.requestMonitorDone(this);
|
||||||
|
@ -329,26 +319,14 @@ public class VariableVMNode extends AbstractExpressionVMNode
|
||||||
};
|
};
|
||||||
|
|
||||||
mrm.add(rm);
|
mrm.add(rm);
|
||||||
updateFormattedExpressionValue(update, idx, dmc, getData(),rm);
|
updateFormattedExpressionValue(update, extractingFormattedDataIndex, dmc, getData(),rm);
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!found && ! weAreExtractingAddressData) {
|
|
||||||
update.done();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Deal with the address.
|
* Deal with the address.
|
||||||
*/
|
*/
|
||||||
if ( weAreExtractingAddressData ) {
|
if ( extractingAddressDataIndex != -1 ) {
|
||||||
boolean found = false;
|
RequestMonitor rm = new RequestMonitor(dsfExecutor, null) {
|
||||||
for (int idx = 0; idx < localColumns.length; idx++) {
|
|
||||||
if (IDebugVMConstants.COLUMN_ID__ADDRESS.equals(localColumns[idx])) {
|
|
||||||
found = true;
|
|
||||||
RequestMonitor rm =
|
|
||||||
new RequestMonitor(dsfExecutor, null) {
|
|
||||||
@Override
|
@Override
|
||||||
public void handleCompleted() {
|
public void handleCompleted() {
|
||||||
mrm.requestMonitorDone(this);
|
mrm.requestMonitorDone(this);
|
||||||
|
@ -356,14 +334,7 @@ public class VariableVMNode extends AbstractExpressionVMNode
|
||||||
};
|
};
|
||||||
|
|
||||||
mrm.add(rm);
|
mrm.add(rm);
|
||||||
updateAddressData(update, idx, dmc, rm);
|
updateAddressData(update, extractingAddressDataIndex, dmc, rm);
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!found && ! weAreExtractingFormattedData) {
|
|
||||||
update.done();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue