30.01.2013 Views

TotalView Users Guide - CI Wiki

TotalView Users Guide - CI Wiki

TotalView Users Guide - CI Wiki

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Setting the CLI EXECUTABLE_PATH Variable<br />

Setting the CLI EXECUTABLE_PATH<br />

Variable<br />

The following macro recursively descends through all directories, starting<br />

at a location that you enter. (This is indicated by the root argument.) The<br />

macro ignores directories named in the filter argument. The result is set as<br />

the value of the CLI EXECUTABLE_PATH state variable.<br />

# Usage:<br />

#<br />

# rpath [root] [filter]<br />

#<br />

# If root is not specified, start at the current<br />

# directory. filter is a regular expression that removes<br />

# unwanted entries. If it is not specified, the macro<br />

# automatically filters out CVS/RCS/SCCS directories.<br />

#<br />

# The search path is set to the result.<br />

proc rpath {{root "."} {filter "/(CVS|RCS|SCCS)(/|$)"}} {<br />

}<br />

# Invoke the UNIX find command to recursively obtain<br />

# a list of all directory names below "root".<br />

set find [split [exec find $root –type d –print] \n]<br />

set npath ""<br />

# Filter out unwanted directories.<br />

foreach path $find {<br />

if {! [regexp $filter $path]} {<br />

append npath ":"<br />

append npath $path<br />

}<br />

}<br />

# Tell <strong>TotalView</strong> to use it.<br />

dset EXECUTABLE_PATH $npath<br />

In this macro, the last statement sets the EXECUTABLE_PATH state variable.<br />

This is the only statement that is unique to the CLI. All other statements<br />

are standard Tcl.<br />

The dset command, like most interactive CLI commands, begins with the<br />

letter d. (The dset command is only used in assigning values to CLI state<br />

variables. In contrast, values are assigned to Tcl variables by using the standard<br />

Tcl set command.)<br />

214 Chapter 11: Seeing the CLI at Work

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!