home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Fred Fish Collection 1.5
/
ffcollection-1-5-1992-11.iso
/
ff_disks
/
misc
/
gold03.lzh
/
GF_003
/
MEMWATCH
/
MEMWATCH.DOC
< prev
next >
Wrap
Text File
|
1991-04-28
|
6KB
|
114 lines
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* |_o_o|\\ Copyright (c) 1986 The Software Distillery. All Rights Reserved */
/* |. o.| || This program may not be distributed without the permission of */
/* | . | || the authors. */
/* | o | || Dave Baker Ed Burnette Stan Chow BBS: */
/* | . |// Jay Denebeim Gordon Keener Jack Rouse (919)-471-6436 */
/* ====== John Toebes Mary Ellen Toebes Doug Walker */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
MemWatch by John Toebes © 1987 The Software Distillery. All Rights Reserved
235 Trillingham Lane, Cary, NC 27513
Contributions to continue development of this and other fine products for the
Amiga should be sent to the Software Distillery at the above address.
Other Products produced by the Software Distillery are:
BLINK - the Turbo-charged Alink replacement
POPCLI III - Screen saver and Pop up CLI hotkey
HACK - The Amiga port of the famous UNIX game
LARN - Another famous UNIX game
MAKE - A software development tool one shouldn't be without
KERMIT - The World renown file transfer protocol brought to the Amiga
ICONEXEC, SETALTERNATE, SETWINDOW - Icon manipulation tools
WBRUN - A tool to run active workbench icons from CLI
TSIZE - A short utility for determining directory sizes.
All of these are available on our BBS.
Permission is hereby granted to distribute this program provided both this
documentation accompanies the executable and that no charge is made for its
distribution. Contributions to the Distillery are encouraged (particularly if
this program is of any benefit to you). If you wish to include this program
in a comercial product, contact us first.
MemWatch is a program intended to sit in the background and watch for
random trashing of low memory by an application under development.
If it detects a write to low memory, it repairs it to what used to be there,
then puts up a requester indicating what damage had been done.
There is no guarentee that this program will catch all trashes (particularly
those to location 4) or that it will always be able to repair the trash in
time. All is dependent upon how often it gets run and how much damage has
been done.
Starting MemWatch:
The syntax to invoke MemWatch II is:
MemWatch [<n>]
Where <n> is the optional number of microseconds between memory checking.
It defaults to 2500 with a lower limit of 20. Note that in reality, any
value less than 20000 is not likely to have a great difference because the
task switching occurs about every 20miliseconds.
Unlike the first version of MemWatch, it is not necessary to do a RUN (although
it is not harmful). If MemWatch has already been installed, entering the
MemWatch command again with a different number will change the interval
of time checking.
Terminating MemWatch II:
MemWatch QUIT
When you enter this, MemWatch will leave memory and stop watching for memory
stomping.
What happens when memory is trashed:
MemWatch II puts up a small alert of the form:
||======================================================================||
|| MemWatch II - Copyright © 1987 By the Software Distillery ||
|| Someone stomped on low memory $aaaaaaaa with $dddddddd cccc! ||
|| ||
|| Left Button to correct location Right button to continue ||
||======================================================================||
where $aaaaaaaa is the address that got trashed, $dddddddd is the value
that someone tried to sneak into there and cccc are the ASCII characters
coresponding to that data.
At this point, if you press the left mouse button, MemWatch II will repair
the damaged location and resume normal machine operation. If however, you
press the right mouse button, MemWatch will allow the area to be changed.
MemWatch is not intended for the casual user. It is useful as a debugging
assist in developing an application program to catch wild pointers
(especially referencing through a NULL pointer).
Known Bugs:
Sometimes seems to interfere when the Amiga really wants to crash. I haven't
been able to come up with a satisfactory solution to solve this problem. Adding
the right mouse button support at least allows you to find out the exact nature
of the impending GURU.
How it works:
MemWatch II saves a copy of the first 100 bytes of memory in it's own space.
Then every after the specified number of micro seconds, it compares what
is there with what it has in its copy. If they differ, it patches up
low memory with what it has and then puts up an alert indicating the
offending values.
MemWatch achieves the load and stay resident magic through the use of CBack.o
which performs the necessary seglist splitting to allow the code to stay around.
Subsequent invocations of MemWatch communicate with the original task through
a global message port called 'MemWatch_Port'.
Changes since the original MemWatch:
1) Use of CBack.o for load and stay resident.
2) Addition of the ability to dynamically change the time interval used.
3) Addition of allowing the damaged location to stay damaged.
4) Fixing the ability to terminate MemWatch.
5) Increasing the Height of the Alert to prevent interference with the
standard Amiga alerts.
MemWatch is written under Lattice C Version 4.0 and is linked with Blink 6.9.
It is not likely that it can compile under any other version.