Bug 3834 - DOM classes could be arranged more efficiently
Summary: DOM classes could be arranged more efficiently
Status: RESOLVED FIXED
Alias: None
Product: frysk
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
: P2 enhancement
Target Milestone: ---
Assignee: Mike Cvet
URL:
Keywords:
Depends on:
Blocks: 3392
  Show dependency treegraph
 
Reported: 2007-01-05 19:28 UTC by Mike Cvet
Modified: 2007-01-05 23:35 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.