Creating a Search Path Directory Tree

 

The previous tip of the week mentioned the $tree function that you can add to the Source tab of the Search Path dialog box.

Here's how $tree was defined (slightly rewritten):

$tree(string)

TotalView search all the subdirectories contained in string, including the string directory itself for a file.

This tip provides more details on using this function.

TotalView uses the directories you name in the $tree function as a starting point to walk through the subdirectories contained with the arguments to $tree. That is, you are adding this directory and all of the directories underneath it to the TotalView search path list. Assume that your source files are underneath:

/home/foo/source

In addition, foo/source contains other directories:

database gui objects...

Each of these directories contains its own series of subdirectories that organize your program into different related areas. If this hierarchy continues for multiple levels, it is tedious to add each individual directory to the search path. Using $tree, all you have to do is type:

$tree(/home/foo/source)

This function tells TotalView to search all the subdirectories underneath source as well as the files contained within source.

If you only need to include one or two directories, you can enter each as an argument to a $tree function. Do this by separating the arguments with colons (:). Here's an example:

$tree(/home/foo/source/database:/home/foo/source/objects)

TotalView searches the path rules in the Source tab from top to bottom, and you cannot add a $tree function as the first or last line in this tab's list. However, you can enter more than one $tree function and you can use the colon separators to name more than one top-level directory.


You can find tips that we've already sent out in our Tip Archive

Help us improve these tips!