Bug 3834

Summary: DOM classes could be arranged more efficiently
Product: frysk Reporter: Mike Cvet <mcvet>
Component: generalAssignee: Mike Cvet <mcvet>
Status: RESOLVED FIXED    
Severity: enhancement    
Priority: P2    
Version: unspecified   
Target Milestone: ---   
Host: Target:
Build: Last reconfirmed:
Bug Depends on:    
Bug Blocks: 3392    

Description Mike Cvet 2007-01-05 19:28:28 UTC
Currently, all DOMSources and DOMFunctions are at the same level in the tree, 
meaning when an iteration is done to find a particular function, it must search 
through every function in the source tree even though we know which source file 
it is located in.

This can be fixed by making the function jdom objects children of source 
objects.
Comment 1 Mike Cvet 2007-01-05 23:35:00 UTC
Log message:
        frysk-core/frysk/dom:
        2007-01-05  Mike Cvet  <mcvet@redhat.com>
        
        * DOMFunction.java (parent): Changed to a DOMSource. Now resides
        with DOMSource as a parent rather than DOMImage. Fixes #3834.
        (createDOMFunction): Takes a DOMSource.
        (setParent): Ditto.
        (getSource): Can now just return the parent, being a DOMSource.
        * DOMImage.java (addFunction): Moved to DOMSource.
        (getFunction): Ditto.
        (getFunctions): Ditto.
        (findFunction): Ditto.
        * DOMInlineInstance.java: Applied GNU formatting.
        (NUM_LINE): Added - tag for source line this inline instance
        is called from.
        (parent): Added.
        (setParent): Added.
        (DOMInlineInstance): Now takes another int, being the line number
        of this inline instance in the source.
        (getDeclaration): Now returns the function from the DOMSource parent.
        (getLine): Added.
        (addInlineInst): Takes an extra int for line number.
        * DOMLine.java (getInlines): Moved to DOMSource.
        (addInlineInst): Ditto.
        (getInlineInst): Ditto.
        * DOMSource.java: Now is a DOM parent for DOMInlineInstance and
        DOMFunction. Fixes #3834.
        (addFunction): Moved from DOMImage.
        (getFunction): Ditto.
        (findFunction): Ditto.
        (getFunctions): Ditto.
        (addInlineInst): Moved from DOMLine.
        (getInlineInst): Ditto.
        (getInlines): Ditto (also takes an int for line number).
        * TestDOM.java (testDOMSource): Added some inline tests.
        (testDOMLine): Removed some inline tests.
        (testDOMInlineInstance): Now calls a
        * cparser/CDTParser.c (image): Removed. Made redundant by
        new DOMSource.
        (enterFunctionBody): Now uses DOMSource and calls updated
        addFunction() method.
        (exitFunctionBody): Calls source instead of image.
        
        frysk-gui/frysk/gui/srcwin:
        2007-01-05  Mike Cvet  <mcvet@redhat.com>
        
        * SourceWindow.java (generateProcStackTrace): Calls
        updated findFunction in DOMSource.
        * SourceBuffer.java (getInlineInstance): Gets inlines
        from DOMSource.
        (createTags): Ditto.
        * InlineBuffer.java: Applied GNU formatting.
        (createTags): Gets inlines from DOMSource.