mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Bug 306555: It is valid for the platform to request more children that what we have
This commit is contained in:
parent
efccb72208
commit
62f7695977
1 changed files with 8 additions and 4 deletions
|
@ -869,16 +869,20 @@ public class MIExpressions extends AbstractDsfService implements IExpressions, I
|
|||
protected void handleSuccess() {
|
||||
IExpressionDMContext[] subExpressions = getData();
|
||||
|
||||
if (startIndex >= subExpressions.length || startIndex + length > subExpressions.length) {
|
||||
if (startIndex >= subExpressions.length) {
|
||||
rm.setStatus(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, REQUEST_FAILED, "Invalid range for evaluating sub expressions.", null)); //$NON-NLS-1$
|
||||
rm.done();
|
||||
return;
|
||||
}
|
||||
|
||||
IExpressionDMContext[] subRange = new IExpressionDMContext[length];
|
||||
for (int i=0; i<subRange.length; i++) {
|
||||
subRange[i] = subExpressions[i+startIndex];
|
||||
int realLength = length;
|
||||
if (startIndex + length > subExpressions.length) {
|
||||
realLength = subExpressions.length - startIndex;
|
||||
}
|
||||
|
||||
IExpressionDMContext[] subRange = new IExpressionDMContext[realLength];
|
||||
System.arraycopy(subExpressions, startIndex, subRange, 0, realLength);
|
||||
|
||||
rm.setData(subRange);
|
||||
rm.done();
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue