3 lines
9.6 KiB
HTML
3 lines
9.6 KiB
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/><title>18-MASTERSCOPE</title><link href="navigation.css" rel="stylesheet" type="text/css"/><link href="document.css" rel="stylesheet" type="text/css"/></head><body><p class="top_nav"><a href="part20.htm">< Previous</a><span> | </span><a href="../Medley-Primer.html">Contents</a><span> | </span><a href="part22.htm">Next ></a></p><h1 style="padding-top: 3pt;padding-left: 35pt;text-indent: 0pt;text-align: left;"><a name="bookmark20">18. MASTERSCOPE</a></h1><p style="padding-left: 35pt;text-indent: 0pt;line-height: 6pt;text-align: left;"><span><img width="640" height="8" alt="image" src="Image_125.png"/></span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-top: 15pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">Masterscope is a tool that allows you to quickly examine the structure of complex</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">programs. As your programs enlarge, you may forget what variables are global, what functions call other functions, and so forth. Masterscope keeps track of this for you.</p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">To use Masterscope, first load <span class="s3">MASTERSCOPE.DFASL </span>and <span class="s3">EXPORTS.ALL</span>.</p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;line-height: 107%;text-align: left;">Suppose that <span class="s3">JVTO </span>is the name of a file that contains many of the functions involved in a complex system and that <span class="s3">LINTRANS </span>is the file containing the remaining functions. The first step is to ask Masterscope to analyze these files. These files must be loaded.</p><p style="padding-left: 107pt;text-indent: 0pt;line-height: 11pt;text-align: left;">All Masterscope queries and commands begin with a period followed by a space, as in</p><p class="s3" style="padding-top: 7pt;padding-left: 143pt;text-indent: 0pt;text-align: left;">. ANALYZE FNS ON MSCOPEDEMO</p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;line-height: 107%;text-align: left;">The <span class="s3">ANALYZE </span>process takes a while, so the system prints a period on the screen for each function it has analyzed. (See Figure 18-1)</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 136pt;text-indent: 0pt;text-align: left;"><span><img width="402" height="85" alt="image" src="Image_126.gif"/></span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 111pt;text-indent: 0pt;text-align: center;">Figure 18-1. Executive Window After Analyzing Files</p><p style="padding-top: 7pt;padding-left: 106pt;text-indent: 0pt;line-height: 107%;text-align: left;">If you are not quite sure what functions were just analyzed, type the file’s <span class="s3">COMS </span>variable (see the File Variables section in Chapter 7) into the Executive Window. The names of</p><p style="padding-left: 107pt;text-indent: 0pt;line-height: 11pt;text-align: left;">the functions stored on the file will be a part of the value of this variable.</p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">A variety of commands are now possible, all referring to individual functions within the analyzed files. Substantial variation in exact wording is permitted. Some commands</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">are:</p><p class="s3" style="padding-top: 7pt;padding-left: 106pt;text-indent: 0pt;text-align: left;">. SHOW PATHS FROM ANY TO ANY</p><p class="s3" style="padding-left: 106pt;text-indent: 0pt;text-align: left;">. EDIT WHERE ANY CALLS <span class="s4">functionname</span></p><p class="s3" style="padding-left: 106pt;text-indent: 0pt;text-align: left;">. EDIT WHERE ANY USES <span class="s4">variablename</span></p><p class="s3" style="padding-left: 106pt;text-indent: 0pt;text-align: left;">. WHO CALLS WHOM</p><p class="s3" style="padding-left: 106pt;text-indent: 0pt;text-align: left;">. WHO CALLS <span class="s4">functionname</span></p><p class="s3" style="padding-left: 106pt;text-indent: 0pt;text-align: left;">. BY WHOM IS <span class="s4">functionname </span>CALLED</p><p class="s3" style="padding-left: 107pt;text-indent: 0pt;text-align: left;">. WHO USES <span class="s4">variablename </span>AS FIELD</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 106pt;text-indent: 0pt;text-align: left;">Note that the function is being called to invoke each command. Refer to the <i>IRM </i>for commands not listed here.</p><p style="padding-top: 7pt;padding-left: 106pt;text-indent: 0pt;line-height: 107%;text-align: left;">Figure 18-2 shows the Executive Window after the commands <span class="s3">. WHO CALLS GobbleDump </span>and <span class="s3">. WHO DOES JVL inScan CALL</span>.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 135pt;text-indent: 0pt;text-align: left;"><span><img width="402" height="86" alt="image" src="Image_127.gif"/></span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 111pt;text-indent: 0pt;text-align: center;">Figure 18-2. Sample Masterscope Output</p><p class="s7" style="padding-top: 3pt;padding-left: 35pt;text-indent: 0pt;text-align: left;"> 18. MASTERSCOPE </p><p style="text-indent: 0pt;text-align: left;"><br/></p><h2 style="padding-top: 4pt;padding-left: 35pt;text-indent: 0pt;text-align: left;">SHOW DATA Command and GRAPHER </h2><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-top: 4pt;padding-left: 107pt;text-indent: 0pt;line-height: 107%;text-align: left;">When the library package <span class="s3">GRAPHER </span>is loaded (to load this package, type <span class="s3">(FILESLOAD GRAPHER)</span>), Masterscope’s <span class="s3">SHOWPATHS </span>command is modified. The command will be</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">changed to generate a tree structure showi ng how the program’s functions interact instead of a tabular printout into the Executive window. For example, typing:</p><p class="s3" style="padding-top: 6pt;padding-left: 143pt;text-indent: 0pt;text-align: left;">. SHOW PATHS FROM ProcessEND</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">produced the display shown in Figure 18-3.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 126pt;text-indent: 0pt;text-align: left;"><span><img width="428" height="152" alt="image" src="Image_128.gif"/></span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 111pt;text-indent: 0pt;text-align: center;">Figure 18-3. <span class="s3">SHOW PATHS </span>Display Example</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">All the functions in the display are part of this analyzed file or a previously analyzed file. Boxed functions indicate that the function name has been duplicated in another place on the display.</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">Selecting any function name on the display will pretty print the function in a window (see Figure 18-4).</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 126pt;text-indent: 0pt;text-align: left;"><span><img width="428" height="152" alt="image" src="Image_129.gif"/></span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 177pt;text-indent: 0pt;text-align: left;"><span><img width="356" height="86" alt="image" src="Image_130.gif"/></span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 111pt;text-indent: 0pt;text-align: center;">Figure 18-4. Browser Printout Example</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-top: 7pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">Selecting it again with the left mouse button will produce a desription of the function’s role in the overall system (see Figure 18-5).</p><p class="s6" style="padding-top: 3pt;text-indent: 0pt;text-align: right;">18. MASTERSCOPE</p><p style="padding-left: 35pt;text-indent: 0pt;line-height: 1pt;text-align: left;"><span><img width="665" height="1" alt="image" src="Image_131.png"/></span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 110pt;text-indent: 0pt;text-align: left;"><span><img width="428" height="152" alt="image" src="Image_132.gif"/></span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 188pt;text-indent: 0pt;text-align: left;"><span><img width="259" height="106" alt="image" src="Image_133.gif"/></span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-top: 4pt;padding-left: 212pt;text-indent: 0pt;text-align: left;">Figure 18-5. Browser Description Example</p><p class="nav"> </p><p class="nav"> </p><p class="nav"><a href="part20.htm">< Previous</a><span> | </span><a href="../Medley-Primer.html">Contents</a><span> | </span><a href="part22.htm">Next ></a></p><p class="nav"> </p></body></html>
|