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 >
Text File  |  1991-04-28  |  6KB  |  114 lines

  1. /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
  2. /* |_o_o|\\ Copyright (c) 1986 The Software Distillery.  All Rights Reserved */
  3. /* |. o.| || This program may not be distributed without the permission of   */
  4. /* | .  | || the authors.                                                    */
  5. /* | o  | ||    Dave Baker    Ed Burnette        Stan Chow         BBS:      */
  6. /* |  . |//     Jay Denebeim  Gordon Keener      Jack Rouse   (919)-471-6436 */
  7. /* ======       John Toebes   Mary Ellen Toebes  Doug Walker                 */
  8. /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
  9.  
  10. MemWatch by John Toebes © 1987 The Software Distillery.  All Rights Reserved
  11.  235 Trillingham Lane, Cary, NC 27513
  12.  
  13. Contributions to continue development of this and other fine products for the
  14. Amiga should be sent to the Software Distillery at the above address.
  15.  
  16. Other Products produced by the Software Distillery are:
  17.    BLINK      - the Turbo-charged Alink replacement
  18.    POPCLI III - Screen saver and Pop up CLI hotkey
  19.    HACK       - The Amiga port of the famous UNIX game
  20.    LARN       - Another famous UNIX game
  21.    MAKE       - A software development tool one shouldn't be without
  22.    KERMIT     - The World renown file transfer protocol brought to the Amiga
  23.    ICONEXEC, SETALTERNATE, SETWINDOW - Icon manipulation tools
  24.    WBRUN      - A tool to run active workbench icons from CLI
  25.    TSIZE      - A short utility for determining directory sizes.
  26. All of these are available on our BBS.
  27.  
  28. Permission is hereby granted to distribute this program provided both this
  29. documentation accompanies the executable and that no charge is made for its
  30. distribution.  Contributions to the Distillery are encouraged (particularly if
  31. this program is of any benefit to you).  If you wish to include this program
  32. in a comercial product, contact us first.
  33.  
  34. MemWatch is a program intended to sit in the background and watch for
  35. random trashing of low memory by an application under development.
  36. If it detects a write to low memory, it repairs it to what used to be there,
  37. then puts up a requester indicating what damage had been done.
  38.  
  39. There is no guarentee that this program will catch all trashes (particularly
  40. those to location 4) or that it will always be able to repair the trash in
  41. time.  All is dependent upon how often it gets run and how much damage has
  42. been done.
  43.  
  44. Starting MemWatch:
  45.  
  46. The syntax to invoke MemWatch II is:
  47.    MemWatch [<n>]
  48.  
  49. Where <n> is the optional number of microseconds between memory checking.
  50. It defaults to 2500 with a lower limit of 20.  Note that in reality, any
  51. value less than 20000 is not likely to have a great difference because the
  52. task switching occurs about every 20miliseconds.
  53.  
  54. Unlike the first version of MemWatch, it is not necessary to do a RUN (although
  55. it is not harmful).  If MemWatch has already been installed, entering the
  56. MemWatch command again with a different number will change the interval
  57. of time checking.
  58.  
  59. Terminating MemWatch II:
  60.    MemWatch QUIT
  61. When you enter this, MemWatch will leave memory and stop watching for memory
  62. stomping.
  63.  
  64. What happens when memory is trashed:
  65. MemWatch II puts up a small alert of the form:
  66. ||======================================================================||
  67. ||      MemWatch II - Copyright © 1987 By the Software Distillery       ||
  68. ||     Someone stomped on low memory $aaaaaaaa with $dddddddd cccc!     ||
  69. ||                                                                      ||
  70. ||    Left Button to correct location       Right button to continue    ||
  71. ||======================================================================||
  72.  
  73. where $aaaaaaaa is the address that got trashed, $dddddddd is the value
  74. that someone tried to sneak into there and cccc are the ASCII characters
  75. coresponding to that data.
  76.  
  77. At this point, if you press the left mouse button, MemWatch II will repair
  78. the damaged location and resume normal machine operation.  If however, you
  79. press the right mouse button, MemWatch will allow the area to be changed.
  80.  
  81. MemWatch is not intended for the casual user.  It is useful as a debugging
  82. assist in developing an application program to catch wild pointers 
  83. (especially referencing through a NULL pointer).
  84.  
  85.  
  86. Known Bugs:
  87.   Sometimes seems to interfere when the Amiga really wants to crash.  I haven't
  88. been able to come up with a satisfactory solution to solve this problem.  Adding
  89. the right mouse button support at least allows you to find out the exact nature
  90. of the impending GURU.
  91.  
  92. How it works:
  93.   MemWatch II saves a copy of the first 100 bytes of memory in it's own space.
  94. Then every after the specified number of micro seconds, it compares what
  95. is there with what it has in its copy.  If they differ, it patches up
  96. low memory with what it has and then puts up an alert indicating the
  97. offending values.
  98.  
  99.   MemWatch achieves the load and stay resident magic through the use of CBack.o
  100. which performs the necessary seglist splitting to allow the code to stay around.
  101. Subsequent invocations of MemWatch communicate with the original task through
  102. a global message port called 'MemWatch_Port'.
  103.  
  104. Changes since the original MemWatch:
  105.    1) Use of CBack.o for load and stay resident.
  106.    2) Addition of the ability to dynamically change the time interval used.
  107.    3) Addition of allowing the damaged location to stay damaged.
  108.    4) Fixing the ability to terminate MemWatch.
  109.    5) Increasing the Height of the Alert to prevent interference with the
  110.       standard Amiga alerts.
  111.  
  112. MemWatch is written under Lattice C Version 4.0 and is linked with Blink 6.9.
  113. It is not likely that it can compile under any other version.
  114.