[comp.binaries.amiga] snoop

ain@j.cc.purdue.edu (Patrick White) (06/03/88)

Submitted by:	mjl@alison  (Martin J. Laubach)
Summary:	snoop that prints on stdout instead of a 9600 baud terminal.
Poster Boy:	Patrick White	(ain@j.cc.purdue.edu)
Archive Name:	binaries/amiga/volume6/snoop.sh.Z
tested.
 
NOTES:
   This has been tested and it worked, but I don't know who tested it.
 
 
-- Pat White   (co-moderator comp.sources/binaries.amiga)
ARPA/UUCP: j.cc.purdue.edu!ain  BITNET: PATWHITE@PURCCVM  PHONE: (317) 743-8421
U.S.  Mail:  320 Brown St. apt. 406,    West Lafayette, IN 47906
[How do you get to heaven?   Go to Pluto and hang a left.]
 
========================================
 
#	This is a shell archive.
#	Remove everything above and including the cut line.
#	Then run the rest of the file through sh.
#----cut here-----cut here-----cut here-----cut here----#
#!/bin/sh
# shar:    Shell Archiver
#	Run the following text with /bin/sh to create:
#	pmsn.uu pmsn.doc
# This archive created: Fri Mar  4 00:13:26 1988
echo shar: extracting pmsn.uu
sed 's/^XX//' << \SHAR_EOF > pmsn.uu
XXbegin 777 pmsn
XXM   #\P         "          $   #P     0   ^D   #P+'@ !$GZ N\B
XXM3C!\_SH@/    ;Y.KOY<*4  "3!\_RX@/    @A.KOY<*4  #4/Z WYP(4ZN
XXM_=@I0  !+$!.KO_$*4  !2QZ JYR?TZN_SH(.0 ' +_@ 68 _^PL>  $(#H"
XXMG"!\____.B).3J[^7&$  =8@.@*,('S___\N(DY.KOY<+'H"<"(Z G D/   
XXM J8F/    $].KO_02?H"5TJL #%G  ""('H"?"EH !@ *2 H  1V"F$  'P@
XXM>@)H("@ "'8580  ;@RL   #;  I9P  $"!Z DX@*  ,=B%A  !4('H"0" H
XXM !!V+&$  $8@>@(R("@ %'8W80  .")Z B0I40 Q<" L>  $3J[_+BQZ >(B
XXM.@'B)#H" G9"3J[_T&  _W8L>  $(GH!R$ZN_F).=2!Z >9!\#  2.> @$) 
XXM2$!R$'0$80  &$S? 0%8B *   #__W(0= 1A   $3G5(YQ]^0_H 1"Q(@,%(
XXM0!#Q  !30D) 2$!*0&8 _^Y@   &$/P ,$I"7\K_^$'H__\J2! 0$)8<P$'H
XXM__^]R&\ __)P $S??OA.=3 Q,C,T-38W.#EA8F-D969(Y\  3J[_?$S?  ,C
XXMP    PHCP0   PXCUP   Q8C[P $   #&B!Z 1A.D"/    #$B\ (_P   ,J
XXM   #!F$  &!.KO]V(!].=4CG@$!.KO]\3-\" 2/)   #"B/    ##B/7   #
XXM%B/O  0   ,:('H TDZ0(_P   -L   #!F$  !Y.KO]V3G5!^@!<,CP 3A 0
XXM"@   A# 4<G_]DYU2.?__G @<@$@>@"63I B0$*1(WH F  $(WH E@ ((WH 
XXME  ,(WH D@ 0(WH D  4(WH =@ 8('H C"")(\    ,B3-]__TYU#P@B(B(B
XXM(E)M;7 B3V-L)7$B46QM;7(/"*LB,SLZ.B)@>R)/8W!V:VPB2").8W=@8V%J
XXM#P@B(B)#;FXB<&ME:G9Q(G!G<6=P=&=F#P@("                       
XXM                           D)%!-4TXR,    R8     06QL;V--96TH
XXM(" @(" @(" @("P@(" @(" @(" I(#T@(" @(" @(" @(%L@(" @(" @(%T@
XXM6R @(" @(" @70T*1G)E94UE;2 H(" @(" @(" @("P@(" @(" @(" I(" @
XXM(" @(" @(" @(%L@(" @(" @(%T@6R @(" @(" @70T*9&]S+FQI8G)A<GD 
XXM(" @("D@   #[    !,         $    "(   ".    S    <P   '2   !
XXMV    >    'L   !]    ?@   (6   "'    B(   (J   "-@   CH   *<
XX8   #(@        /R   #ZP    $   /R
XX 
XXend
SHAR_EOF
if test 1543 -ne "`wc -c pmsn.uu`"
then
echo shar: error transmitting pmsn.uu '(should have been 1543 characters)'
fi
echo shar: extracting pmsn.doc
sed 's/^XX//' << \SHAR_EOF > pmsn.doc
XX*****************************************************************
XX*                                                               *
XX*                       Poor Man's Snoop                        *
XX*                                                               *
XX*             Copyright 1988 by Martin J Laubach                *
XX*                     All rights reserved                       *
XX*                                                               *
XX*****************************************************************
XX
XXThis program is inspired by the snoop command of the developers
XXtoolkit disk.  As it's "bigger brother" it helps to trace the
XXmemory allocations made -- only that it writes its output not on
XXthe serial line at 9600 Bd, but to the standard output stream
XX(therefore the name "poor man's" -- for people without a 9k6
XXterminal standing around (like me)).
XX
XXTo use it, just call it by typing "pmsn" at the cli prompt (or,
XXeven better "run pmsn").  Warning:  you should not use it with
XXthe popular metacomco shell, since the shell makes a lot of small
XXallocations (for the command history), which make it very hard to
XXtrace what's really going on.  So you'd better start a NewCli,
XXand run it there.  Also, you should take care to redirect the
XXoutput to a file, since some 20k of data aren't unusual.  PMSN
XXstays dormant in the background, recording all the memory
XXallocation/deallocation calls to AllocMem() and FreeMem(), until
XXyou hold the left mousebutton about 3 seconds down - of a mouse
XXconnected to the second gameport (a joystick firebutton will do).
XXThen all the accumulated data is dumped to the standard output
XXstream.
XX
XX
XX
XXThe format of the dump is really straightforward and quite easy
XXto understand:
XX
XX   AllocMem( 00000100, 00010001) = 00200090  [00209000] [000000198]
XX      |         |          |           |         |             |
XX      |         |          |           |       (a7)           4(a7)
XX      |         |          |           |
XX      |         |          |  Result returned by AllocMem
XX      |         |  second argument (MEMF_CLEAR|MEMF_PUBLIC)
XX      |   first argument (256 bytes to allocate)
XXfunction called
XX
XX
XX   FreeMem ( 00200000, 00000010)              [00202020] [00202021]
XX      |         |          |                      |             |
XX      |         |          |                    (a7)           4(a7)
XX      |         |          |
XX      |         |  second argument (16 bytes to free)
XX      |  first argument (address of block to be freed)
XXfunction called
XX
XX
XXEach line contains the function name, the arguments for this
XXfunction, the result (if any), as well as the first two longs on
XXthe stack (these are included to find out where the call came
XXfrom -- an address in the 00fxxxxx usally means the function was
XXcalled by the OS).
XX
XXHope it'll help you,
XX---mjl
XX
XXPS: Comments are *very* welcome. Mail me at mjl@alison.uucp or
XX    uunet!tuvie!alison!mjl.SHAR_EOF
if test 2913 -ne "`wc -c pmsn.doc`"
then
echo shar: error transmitting pmsn.doc '(should have been 2913 characters)'
fi
#	End of shell archive
exit 0