1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00
Ted Williams 2007-09-04 21:23:45 +00:00
parent be0f1bcf2c
commit d96a8c57e6
3 changed files with 43 additions and 5 deletions

View file

@ -29,7 +29,7 @@ import org.eclipse.debug.internal.ui.viewers.model.provisional.IElementContentPr
public class VMElementsUpdate extends VMViewerUpdate implements IChildrenUpdate {
private final int fOffset;
private final int fLength;
private final List<Object> fElements;
protected final List<Object> fElements;
public VMElementsUpdate(IChildrenUpdate clientUpdate, int offset, int length, DataRequestMonitor<List<Object>> requestMonitor) {
super(clientUpdate, requestMonitor);

View file

@ -504,7 +504,9 @@ abstract public class AbstractDMVMLayoutNode<V extends IDMData> extends Abstract
protected void fillUpdateWithVMCs(IChildrenUpdate update, IDMContext<V>[] dmcs) {
int startIdx = update.getOffset() != -1 ? update.getOffset() : 0;
int endIdx = update.getLength() != -1 ? startIdx + update.getLength() : dmcs.length;
for (int i = startIdx; i < endIdx; i++) {
// Ted: added bounds limitation of dmcs.length
// see https://bugs.eclipse.org/bugs/show_bug.cgi?id=202109
for (int i = startIdx; i < endIdx && i < dmcs.length; i++) {
update.setChild(createVMContext(dmcs[i]), i);
}
}

View file

@ -272,9 +272,9 @@ public abstract class VMCache
@Override
protected void handleCompleted()
{
if(getStatus().isOK())
if(getData() != null)
{
for(int j = 0; j < update.getLength(); j++)
for(int j = 0; j < getData().size(); j++)
{
if(isCacheWriteEnabled())
{
@ -289,7 +289,43 @@ public abstract class VMCache
}
update.done();
}
});
})
{
/* See https://bugs.eclipse.org/bugs/show_bug.cgi?id=202109
*
* A flexible hierarchy bug/optimization causes query with incorrect
* IChildrenUpdate[] array length.
*
* We found this while deleting a register node. Example:
*
* the register view displays:
* PC
* EAX
* EBX
* ECX
* EDX
*
* we delete EBX and force a context refresh.
*
* flexible hierarchy queries for IChildrenUpdate[5] and IChildrenCountUpdate at
* the same time.
*
* VMElementsUpdate, used by VMCache to wrap the IChildrenUpdate, generates an
* IStatus.ERROR with message "Incomplete elements of updates" when fElements
* count (provided by service) does not match the length provided by the original
* update query.
*
* Workaround, respect getData() != null instead of IStatus.OK, override
* VMElementsUpdate.done() to set elements regardless of count
*/
@Override
public void done() {
@SuppressWarnings("unchecked")
DataRequestMonitor<List<Object>> rm = (DataRequestMonitor<List<Object>>)fRequestMonitor;
rm.setData(fElements);
super.done();
}
};
}
return updates;