Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 202109

Summary: flexible hierarchy bug/optimization causes query with incorrect IChildrenUpdate[] array length
Product: [Tools] CDT Reporter: Ted Williams <ted>
Component: cdt-debug-dsfAssignee: Ted Williams <ted>
Status: CLOSED FIXED QA Contact:
Severity: critical    
Priority: P3 CC: cdtdoug, dgaff.eclipse, pawel.1.piech, Randy.Rohrbach
Version: 0 DD 1.0   
Target Milestone: DD 1.0   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
Workaround, respect getData() != null instead of IStatus.OK, override VMElementsUpdate.done() to set elements regardless of count cdtdoug: iplog-

Description Ted Williams CLA 2007-09-04 00:01:46 EDT
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.
Comment 1 Ted Williams CLA 2007-09-04 00:04:02 EDT
Created attachment 77612 [details]
Workaround, respect getData() != null instead of IStatus.OK, override VMElementsUpdate.done() to set elements regardless of count

Pawel & Randy: please review
Comment 2 Pawel Piech CLA 2007-09-04 11:06:28 EDT
Patch looks good to me.  I'm still unclear how the code could've worked when caching is disabled, but that's OK.  Please don't forget to file the platform bug when you have time for it.
Comment 3 Ted Williams CLA 2007-09-04 17:18:09 EDT
It worked without VMCache, because only the cache uses VMElementsUpdate to wrap the original update request. 

VMElementsUpdate.done() contains:
        if (fElements.size() == fLength || fLength == -1 ) {
            rm.setData(fElements);
        } else {
            rm.setStatus(new Status(IStatus.ERROR, DsfUIPlugin.PLUGIN_ID, IDsfService.REQUEST_FAILED, "Incomplete elements of updates", null));
        }
Comment 4 Ted Williams CLA 2007-09-04 17:29:13 EDT
Patch committed with comments.
Comment 5 Pawel Piech CLA 2007-09-05 01:21:18 EDT
Thanks Ted, looks good to me.
Comment 6 Pawel Piech CLA 2008-08-13 13:04:22 EDT
Closing out 1.0 bugs.