8.   Rich Trees

<< Previous Table of Contents   |   Detailed Index Next >>
Rich Trees are call-trees or caller-trees where each function-node contains additional information for easy browsing and understanding of project code.
1. Create a Rich Tree

1.   Create the desired Call-tree or Caller-tree

2.   Click < Search in Tree > in the Tree window toolbar to open the Search in Tree dialog.

3.   In the Enable Display card, select the additional information that should be shown with each
      function node.

4.   Click < Apply >

5.   Also use the "Object Search" card to search for specific data objects and display them in the relevant
      tree nodes

2. The "Search in Tree" dialog Click the < Search in Tree > in the Tree Window toolbar to view the "Search in Tree dialog".
      The Enable Display card

Use this card to:

-   Enable/disable information that is displayed alongside each node

      The Highlight Occurrences card

Use this card to:

-   Select the criterion by which other occurrences of a node are highlighted

      The Object Search card

In this card,

1.   Specify the data object or struct name, etc

2.   Find in what functions the data object is used - by clicking < Search > or < Search All >

      The Advanced Search card

Using this card, you can:

-   find the next occurrence of a function in the tree.

-   find the next function used from a specific file.

-   use the "history list" to search for a particular object, struct, class, type or #define

-   search for a string in all the text that is being displayed in the tree-nodes..

3. Attach information to tree nodes Use the "Enable Display" card in the "Search in Tree" dialog
      View parameters of functions Select "Function Parameter List"; click < Apply >.
      View stack depth at each node Select "Stack Size"; click < Apply >.
      File Names where Functions
    are defined
Select "File Names"; click < Apply >.
      Attach Comments to tree nodes

At each tree-node, view the comment associated with the function call:

Select "Associated Comment "; click < Apply >.

      Objects used by functions

Select "Object Name"; click < Apply >.

Use the "Object Search" card to search for specific data objects and display them in the relevant tree nodes

4. Which functions use a category of objects Use the "Object Search" card of the Search in Tree dialog
      View list of globals used by
    each function

-   Set "Type of Object" to <Globals>

-   Set "Select From" to <Any Global>.

At this point, "Object Name" contains < Any Global >

-   Click < Search >

      List of Structures used by
    each function

-   Set "Type of Object" to <Structures/Unions>

-   Set "Select From" to <Any Structure/Any Union>.

Now "Object Name" contains < Any Structure/Any Union >.

-   Click < Search >

      Which members of a Structure
    are used by the functions

-   Set "Type of Object" to < Structures/Unions >

-   In "Select From", select the name of the structure you are interested in

At this point, "Object Name" contains the name of the structure

-   From ‘Members’ Click on the dot or arrow i.e. "." or "->"

-   Set "Select From" to <Any Member>.

Now "Object Name" contains: name-of-the-desired-structure.< Any Member >

-   Click < Search >

5. Which functions use a specific object : Use the "Object Search" card of the Search in Tree dialog
      Which functions use a specific
    global

-   Set "Type of Object" to <Globals>

-   In "Select From", use the drop-down list to select the name of the global variable you are
     interested in

Now "Object Name" contains the name of the global variable

-   Click < Search >

      Which functions use a specific
    member of a specific structure
    variable

-   Set "Type of Object" to < Structures/Unions >

-   In "Select From", select the name of the structure variable you are interested in

At this point, "Object Name" contains the name of the structure variable

-   From ‘Members’ Click on the dot or arrow i.e. "." or "->"

-   In "Select From", select the name of the specific member you are interested in

Now "Object Name" contains: name-of-the-desired-structure. name-of-the-desired-member

-   Click < Search >

6. Advanced Search In the "Advanced Search" card of the "Search in Tree" dialog:
      Go to next node that is from a
    specific file

-   Select the "File Name" checkbox. (the "Search String" check box should be OFF)

-   Use the drop-down list to select the filename you are interested in.

-   Click < Search > to find the next tree node that is from the selected file; Click < Search All > to
     find all nodes that are from the selected file.

      Go to the next node that uses a
    specific object

-   Select the "Object Name" checkbox. (the "Search String" check box should be OFF)

-   Use the history list to select the object you are interersted in.

-   Click < Search > to find the next node containing the object name; Click < Search All > to find all
     nodes containing a match for the selected object.

      Search for a string in tree-nodes

-   Select the "Search String" checkbox.

-   Enter the name of the string you wish to search for.

-   Click < Search > to find the next node containing the string; Click < Search All > to find all nodes
     containing a match for the selected string.

7. Highlight other Occurrences Use the "Enable Display" card in the "Search in Tree" dialog
      Highlight nodes that have the
    same function name as the
    current node
Select "Function Name"; click <Apply>.
      Highlight nodes that are from the
    same file as the current node
Select "File Name"; click <Apply>.
      Highlight nodes that has the
    same object-name attached as
    the current node
Select "Object Name"; click <Apply>.
8. Single-click to go to the function-call

A single click on a node in the Call-Tree:

-   moves the cursor to the first call of the function in the parent’s code

-   Subsequent clicks will move the cursor to the next call of the function in the parent’s code

9. View the DataFlow of the data object

-   Click to select a tree-node that has a data-object displayed alongside it

-   Right-click anywhere in the Tree Window, then click < DataFlow for the Current Object > in the pop-up
    menu.

10. Filtering the tree After searching for a specific function in the tree, or when information is attached to the tree nodes, you can filter the tree so that only the nodes of interest are visible and the rest of the tree becomes hidden.
      View only the nodes that have objects

After you search for an object and, as a result, that object is displayed alongside a few nodes in the tree:

-   Right click anywhere in the Tree Window.

-   Click < Show All Paths for Object >.

Now only the sub-trees that contain the nodes-with-objects are visible, the rest of the tree becomes hidden.

      View nodes that are from a specific file

After you enable display of filenames, so that filenames are displayed alongside the tree-nodes:

1.   Select a node that contains the filename of interest.

2.   Right click anywhere in the Tree Window.

3.   Click < Show All Paths for Filename >.
 

Now the sub-trees that contain the nodes-with-filename of interest are visible, the rest of the tree becomes hidden.

      Search ALL

How "Search ALL" works: Crystal will search to find all the nodes based on the search criterion.

If any unexpanded parts of the tree contain search-matches, those parts will be automatically expanded.

Only the sub-trees that contain search-matches remain visible, the rest of the tree becomes hidden.

      Show Whole Tree

When a few sub-trees are visible and the rest of the tree is hidden, new searches and a few other operations can not be performed.

To display the whole tree again:

-   Right click anywhere in the Tree Window.

-   Click < Show Whole Tree >.

<< Previous Table of Contents   |   Detailed Index Next >>