Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!pt.cs.cmu.edu!rochester!rit!tropix!moscom!ur-valhalla!uhura.cc.rochester.edu!sunybcs!rutgers!cs.utexas.edu!uunet!allbery
From: allbery@uunet.UU.NET (Brandon S. Allbery - comp.sources.misc)
Newsgroups: comp.sources.misc
Subject: v07i059: DBUG Package (Part 3 of 3)
Message-ID: <59236@uunet.UU.NET>
Date: 8 Aug 89 00:10:59 GMT
Sender: allbery@uunet.UU.NET
Reply-To: fnf@estinc.UUCP
Lines: 1050
Approved: allbery@uunet.UU.NET (Brandon S. Allbery - comp.sources.misc)

Posting-number: Volume 7, Issue 59
Submitted-by: fnf@estinc.UUCP
Archive-name: dbug/part03

This is the latest version of my dbug package, a relatively portable and
machine independent macro based C debugging package.  The dbug package
has proven to be a very flexible and useful tool for debugging, testing,
and porting C programs.

All of the features of the dbug package can be enabled or disabled
dynamically at execution time.  This means that production programs will
run normally when debugging is not enabled, and eliminates the need to
maintain two separate versions of a program during testing.

Many of the things easily accomplished with conventional debugging tools,
such as symbolic debuggers, are difficult or impossible with this package,
and vice versa.  Thus the dbug package should not be thought of as a
replacement or substitute for other debugging tools, but simply as a useful
addition to the program development and maintenance environment.

One of the new features with this version is stack usage accounting.  You
can discover the total amount of stack used by your program, and the amount
used by each individual function.  You will need to know in which direction
you stack grows (up or down).

-Fred Fish   12-Jun-89

#--------CUT---------CUT---------CUT---------CUT--------#
#########################################################
#                                                       #
# This is a shell archive file.  To extract files:      #
#                                                       #
#    1)	Make a directory for the files.                 #
#    2) Write a file, such as "file.shar", containing   #
#       this archive file into the directory.           #
#    3) Type "sh file.shar".  Do not use csh.           #
#                                                       #
#########################################################
#
#
echo Extracting user.t.uu:
sed 's/^Z//' >user.t.uu <<\STUNKYFLUFF
Zbegin 664 user.t
ZM"@H*(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @1"!"(%4@1PH*
ZM(" @(" @(" @(" @(" @(" @(" @("!#(%!R;V=R86T@1&5B=6=G:6YG(%!A
ZM8VMA9V4*"B @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(&)Y
ZM"@H@(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @($9R960@1FES: H*
ZM"@H*(" @(" @($D(20A)"$E."$X(3@A.5 A4"%0(5%((4@A2"%)/"$\(3PA/
ZM1 A$"$0(1%4(50A5"%5#"$,(0PA#5 A4"%0(5$D(20A)"$E/"$\(3PA/3@A.
ZM"$X(3@H*"B @(" @(" @(" @($%L;6]S="!E=F5R>2!P2 @;V8*(" @(" @('1H92 @;F%M
ZM92!P0H@(" @(" @=&AI'1E&%M<&QE7-T96TN"@H*(" @
ZM(" @(" @(" @3VYE(&]F('1H92!P2 @;F]T("!A('!R;V)L96T@9F]R('1H90H@
ZM(" @(" @9&5V96QO<&5R('-I;F-E(&AE(&ES+"!O2!T;R!H879E('-U8V@@9F%M:6QI87)I='D@('=I
ZM=&@@('1H92 @<')O9W)A;2 @8F5I;F<*(" @(" @(&UA:6YT86EN960L("!M
ZM;V1I9FEE9"P@;W(@<&]R=&5D('1O(&%N;W1H97(@96YV:7)O;FUE;G0N("!)
ZM= H@(" @(" @:7,@86QS;R!A('!R;V)L96TL(&5V96X@9F]R('1H92!D979E
ZM;&]P97(L('=H96X@=&AE("!P&5C=71E("!I
ZM;B @86YY("!E;G9I2!L97-S(&-A<&%B;&4L(&9O6UB;VP@8F]T:"!O9B!T
ZM:&5S92!C86X*(" @(" @(&)E(')E9'5C960@=&\@>F5R;R!W:71H(&YO(&-H
ZM86YG97,@2 @(&]F(" @=&AE"B @(" @("!C87!A8FEL:71I97,@
ZM(&]F("!T:&4@(%\(9%\(8E\(=5\(9R!P86-K86=E+B @16%C:"!C87!A8FEL
ZM:71Y(&-A;B!B90H@(" @(" @:6YD:79I9'5A;&QY(&5N86)L960@;W(@9&ES
ZM86)L960@870@=&AE('1I;64@(&$@('!R;V=R86T@(&ES"B @(" @("!I;G9O
ZM:V5D(" @8GD@("!S<&5C:69Y:6YG(" @=&AE(" @87!P7!I8V%L;'DL(" @(G!R:6YT('-T871E
ZM;65N=',B(" @87)E"B @(" @("!I;G-E2P@(&%N
ZM9" @=7-U86QL>2 @869T97(@("!A=" @(&QE87-T(" @2!D96QE=&4@=&AE;0H@(" @(" @86QL+B @0F5G:6YN97)S('5S
ZM=6%L;'D@9&\@=&AI&%M<&QE(&]F(&%L; H@(" @(" @=&AR964@=&5C:&YI<75E
ZMPH@(" @(" @
ZM(" @(" @(" @(" @(" O*B!P2!L96%D
ZM2 @
ZM86YD"B @(" @("!M86EN=&%I;F%B:6QI='D@('=H96X@(&UU;'1I<&QE(" C
ZM"",((P@C:0AI"&D(:68(9@AF"&9D"&0(9 AD90AE"&4(968(9@AF"&8@('-Y
ZM;6)O;',@(&%R92 @=&\@8F4*(" @(" @(&1E9FEN960@;W(@('5N9&5F:6YE
ZM9" @8F%S960@(&]N("!S<&5C:69I8R @='EP97,@(&]F("!D96)U9PH@(" @
ZM(" @9&5S:7)E9"X@(%1H92!S;W5R8V4@8V]D92!C86X@8F4@;6%D92!S;&EG
ZM:'1L>2!M;W)E(')E861A8FQE"B @(" @("!B>2!S=6ET86)L92!I;F1E;G1A
ZM=&EO;B!O9B!T:&4@(P@C"",((VD(:0AI"&EF"&8(9@AF9 AD"&0(9&4(90AE
ZM"&5F"&8(9@AF(&%R9W5M96YT2 @(&%N9 H@(" @(" @=6YR96%S;VYA8FQE("!R97-T'1E" \(&%R9V,@)B8@87)G
ZM=EMI>%U;,%T@/3T@)RTG.R!I>"LK*2!["B @(" @(" @(" @(" @(" @(" @
ZM(" @("!S=VET8V@@*&%R9W9;:7A=6S%=*2!["B @(" @(" @(" @(" @(" @
ZM(" @(" @(" @(" @8V%S92 G(R"LK*2!["B @(" @
ZM(" @(" @(" @(" @(" @(" @("!$0E5'7U!224Y4("@B87)G2X@("A4:&4@=F5R2!U
ZM2 @96YA8FQE9" @9&5B=6=G97(@(&%C
ZM=&EO;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@(" @(" @1$)5
ZM1U]%3E1%4B @57-E9"!T;R!T96QL('1H92!R=6YT:6UE('-U<'!O&5C=71E9"X@("!!("!T>7!I8V%L(&%R9W5M96YT(&9O2!P=7-H:6YG('1H90H@(" @(" @(" @(" @(" @
ZM(" @(" @(" @("!C=7)R96YT("!D"&0(9 AD8@AB"&((8G4(=0AU"'5G"&<(
ZM9PAG("!S=&%T92 @;VYT;R @86X@(&EN=&5R;F%L"@H*"B @(" @(" @(" @
ZM(" @(" @(" @(" @(" @(" @(" @(" M(#$U("T*"@H*"@H*"B @(" @("!$
ZM0E5'(%5S97(@36%N=6%L(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @
ZM($IU;F4@,3(L(#$Y.#D*"@H*(" @(" @(" @(" @(" @(" @(" @(" @(" @
ZM0H@(" @(" @
ZM(" @(" @(" @(" @(" @(" @("!P;W!P:6YG("!T:&4@2 @8F5C
ZM875S92P@(&QI:V4@=&AE"B @(" @(" @(" @(" @(" @(" @(" @(" @($1"
ZM54=?4%))3E0@;6%C2!O8G-O;&5T92!A;F0@=VEL;"!B90H@(" @(" @(" @(" @(" @(" @(" @
ZM(" @("!R96UO=F5D(&EN(&$@9G5T=7)E("!R96QE87-E+B @(%5S92 @=&AE
ZM"B @(" @(" @(" @(" @(" @(" @(" @(" @(&YE=R!$0E5'7U!224Y4(&UA
ZM8W)O+@H*"@H@(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @+2 Q
ZM-B M"@H*"@H*"@H@(" @(" @1$)51R!52 @9G5N8W1I;VX@(&]N("!T:&4@8W5R7!E(BP@*")T>7!E(&ES("5X(BP*(" @(" @(" @(" @(" @(" @(" @(" @
ZM(" @='EP92DI.PH@(" @(" @(" @(" @(" @(" @(" @(" @("!%6#H@1$)5
ZM1U]04DE.5" H(G-T<"(L("@B)7@@+3X@)7,B+"!S=' L"B @(" @(" @(" @
ZM(" @(" @(" @(" @(" @('-T<" M/B!N86UE*2D["@H@(" @(" @(" @(" @
ZM($1"54=?4T542DU0("!52!A
ZM;&P@:6YS=&%N8V5S"B @(" @(" @(" @(" @(" @(" @(" @(" @(&]F("!$
ZM0E5'7U-%5$I-4" @;75S=" @;V-C=7(@('=I=&AI;B!T:&4*(" @(" @(" @
ZM(" @(" @(" @(" @(" @(" @2 @("!A;&P@("!$
ZM0E5'7TQ/3D=*35 @("!M86-R;W,*(" @(" @(" @(" @(" @(" @(" @(" @
ZM(" @2 @(&AA=FEN9R @('1H90H@(" @(" @(" @(" @(" @(" @(" @
ZM(" @("!D96)U9V=EF5S('1H92!C=7)R96YT;'D@879A:6QA8FQE(&1E8G5G9V5R(&]P=&EO;G,@
ZM86YD("!T:&4*(" @(" @(&9L86<@(&-H87)A8W1E7=O7=OF5R;RX*"B @(" @(" @(" @(" @(&9;+&9U;F-T:6]NF4B"B @(" @(" @(" @(" @(" @(" @(" @(" @(" @
ZM<')O9W)A;2X@(%1H92!A8V-U2!O9B!T:&ES(&9E871U2 @=&AE("!P2 @;G5M8F5R
ZM(" @96%C:" @(&1E8G5G9V5R"B @(" @(" @(" @(" @(" @(" @(" @(" @
ZM(" @;W5T<'5T("!L:6YE("!S=&%R=&EN9R @870@,2X@(%1H:7,@:7,*(" @
ZM(" @(" @(" @(" @(" @(" @(" @(" @("!U0H@(" @(" @(" @(" @(" @(" @
ZM(" @(" @(" @(&%L=&5R('1H92!D96)U9V=E7!I8V%L;'D@9&]N
ZM92!B>2!E>&5C=71I;F<*(" @(" @('1H92!P2!C;VUP87)E9"!T;R!D971E2!W:&5R92!E>&5C=71I;VX*(" @(" @(&]F('1H92!T=V\@<')O8V5S2!M:6YO2 @=&AE
ZM("!A=71H;W(@(&EN("!L97-S"B @(" @("!T:&%N("!A("!D87DN(" @2&]W
ZM979E2 @9'5M<&5D("!I;G1O("!A"B @(" @("!F:6QE(&9O
ZM&%M:6YA=&EO;BX*"@H@(" @(" @(" @("!0
ZM0H;.0H@(" @(" @(" @(" @(" @(" @(" @
ZM(" @(" @(" @($9R960@1FES: H;.0H*"B @(" @(" @(" @(" @(" @(" @
ZM(" @(" @(" @(" @(%\(05\(0E\(4U\(5%\(4E\(05\(0U\(5 H*"@H@(" @
ZM(" @5&AI&EB;&4@86YD('5S
ZM969U; H@(" @(" @=&]O;"!F;W(@9&5B=6=G:6YG+"!T97-T:6YG+"!A;F0@
ZM<&]R=&EN9R!#('!R;V=R86US+@H*"B @(" @(" @(" @($%L;"!O9B!T:&4@
ZM9F5A='5R97,@;V8@=&AE(%\(9%\(8E\(=5\(9R!P86-K86=E(&-A;B!B92 @
ZM96YA8FQE9 H@(" @(" @;W(@(&1I2 @(&%C8V]M<&QI