Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.2 9/5/84; site reed.UUCP
Path: utzoo!watmath!clyde!cbosgd!ihnp4!mhuxn!mhuxr!mhuxt!houxm!vax135!cornell!uw-beaver!tektronix!reed!maclab
From: maclab@reed.UUCP ( S. Gillespie )
Newsgroups: net.sources.mac
Subject: SegWatcher.doc -- DA which tracks CODE segments
Message-ID: <1928@reed.UUCP>
Date: Wed, 25-Sep-85 05:21:07 EDT
Article-I.D.: reed.1928
Posted: Wed Sep 25 05:21:07 1985
Date-Received: Sat, 28-Sep-85 04:48:57 EDT
Organization: Reed College, Portland, Oregon
Lines: 94



This article contains a bit of documentation for a new desk accessory 
(SegWatcher) which gives programmers the opportunity to observe the loading 
and unloading of CODE segments at run-time.  I have also posted the 
following file to Net.Sources.Mac:
    
    SegWatcher.hqx  -- The desk accessory, as an Apple Font/DA Mover file,
                       in BinHex 4.0 format. (about a 2.7K D/A).

It is not too sophisticated, but it does the job.  It was, of course, 
written with the Rascal Development System, and I will send the source 
directly to anyone who is interested.


Scott Gillespie
Reed College

UUCP:
{decvax, ucbvax, pur-ee, uw-beaver, masscomp, cbosg, aat,
 mit-ems, psu-cs, uoregon, orstcs, 
                        ihnp4, uf-cgrl, ssc-vax}!tektronix 
                                                          \
                                                           +--!reed!maclab 
{teneron, ogcvax, muddcs, cadic, oresoft, grpwre,         /
     harvard, psu-cs, omen, isonvax, nsc-pdc}------------+


-------------------------------------------------------------


SegWatcher.Doc

V.85.09.24.spg

    
SegWatcher is a Desk Accessory which tracks the loading and unloading of 
program segments.  The CODE segment numbers of the current application are 
listed in the D/A window;  squares to the right of the segment numbers 
indicate:
        
          (M) -- Segment is in Memory
          (L) -- Segment is Locked
          
As long as the current application calls SystemEvent regularly (as it 
should), SegWatcher will update itself 5 times per second.

Note:  Code Segment 0 (the jump table) is not included in the display.
Another Note:  The SegWatcher display will screw up if the current
		application has more than about 26 segments.
      
Some Applications (notably, Rascal!), will close desk accessories before 
beginning some operations.  Selecting items from the standard Edit menu 
while SegWatcher is the front window will cause SegWatcher to hide itself 
for a few seconds (the window's WindowKind field is changed to a positive 
number, and the window is hidden), thus tricking the application into 
thinking there are no D/A windows open :
      
        Cut:  Hide for 2 seconds;
        Copy: Hide for 4 seconds;
        Paste: Hide for 6 seconds;
        Clear: Hide for 8 seconds;
        
Holding the mouse button down with the cursor in SegWatcher's window will 
cause everything to stop (if the application is calling GetNextEvent, as it 
should), until you let up on the mouse button (SegWatcher does this so that 
you can freeze the display at any particular moment).
      
A typical SegWatcher display might look like this (interpretation follows):

------------|
 #  M  L    |
 1  X  X    |
 2          |
 3  X       |
 4          |
 5  X  X    |
 6  X       |
 7          |
-------------

A display such as that above, would indicate the following:

    --  CODE segment 1 is in memory, and Locked (as it should be:
            segment 1 is the blank segment).
    --  Segments 2, 4 and 7 are not in memory.
    --  Segments 3 and 6 are in memory, but they have been marked
        'purgeable.' i.e. the segment has been 'unloaded.'
    --  Segment 5 is in memory, and locked.


End of documentation.

----------