Mail Archives: djgpp/1997/09/04/09:35:35
I hope to perhaps make this a frequent, maybe weekly feature of the
newsgroup/mailing list. Debugging tips, coding tips, other stuff.
Debugging tip: If you have a program that is crashing and add debug
instructions to dump info to a file, or to stdout or stderr redirected to
a file, and the program hangs or makes the machine reboot, you will
probably get an improperly-closed file (what C-64 users used to call a
"splat file"). When you go to read your precious debugging data, you'll
find it's a zero length file. Never fear: Microsoft Scandisk to the
rescue. Run it (DOS or the Win 95 version as appropriate). Don't bother
with the surface scan in the DOS one; for the Windows uncheck Thorough,
check Standard. When it runs you should get a message about lost clusters.
Save them to a file and "skip undo".
Now, comb your disk for *.CHK files. For each one found, more it to the
screen: more file0001.chk for instance. (If that doesn't work you have a
weird/old DOS, and can try more <file0001.chk instead. Note the '<'
added.) Chances are one is your precious debugging output. Rename it,
delete any other .CHK files, and browse to your heart's content. And
remember, Microsoft does have *some* good ideas. (They have a lot, it's
usually implementation/debugging that leaves a lot to be desired, as per
the old anti-Microsoft joke: "It compiled, no errors, 30 warnings?! Ship it!")
--
.*. Where feelings are concerned, answers are rarely simple [GeneDeWeese]
-() < When I go to the theater, I always go straight to the "bag and mix"
`*' bulk candy section...because variety is the spice of life... [me]
Paul Derbyshire ao950 AT freenet DOT carleton DOT ca, http://chat.carleton.ca/~pderbysh
- Raw text -