[comp.sys.ibm.pc] Debugging Question

hlison@bbn.com (Herb Lison) (01/07/89)

I've got an application on a PC using the PC-NFS socket libraries provided
by SUN.  The application also talks to some custom hardware via a TSR
driver installed through config.sys.  My problem is debugging the damn
thing.  The application crashes the PC in a somewhat unpredictable
fashion.  I've tried using CodeView, but there doesn't appear anyway
to find out where the program is crashing. The manual says that you
can interrupt a running program with Ctrl-C, Break or SysReq.  None
of these have any effect.

Anybody have any ideas?  Thanks in advance.

Herb Lison

john@stiatl.UUCP (John DeArmond) (01/07/89)

In article <12479@emerald.BBN.COM> hlison@bbn.com (Herb Lison) writes:
>I've got an application on a PC using the PC-NFS socket libraries provided
>by SUN.  The application also talks to some custom hardware via a TSR
>driver installed through config.sys.  My problem is debugging the damn
>thing.  The application crashes the PC in a somewhat unpredictable
>fashion.  I've tried using CodeView, but there doesn't appear anyway
>to find out where the program is crashing. The manual says that you
>can interrupt a running program with Ctrl-C, Break or SysReq.  None
>of these have any effect.
>
>Anybody have any ideas?  Thanks in advance.
>
>Herb Lison

An Atron Probe hardware debugger would make this debugging kinda trivial.
If you have a 386, a software substitute is the Soft-ICE/Magic-CV product
from Nu-Mega.  This uses the protected mode and debug registers of the 
386 to run codeview in another partition separate from your application
and gives you hardware breakpoints.

In any event, I would start out by looking at my detailed link map
(/MAP for the linker) and determine where the code resides.  I'd then set
breakpoints around the code space so the debugger would break if the
IP leaves the code space.  That will catch errant function pointers or
other things that cause the code to take the merry walk thru memory.  

The program should either go errant which will trigger a breakpoint or it
will hang in a loop, in which case, the hardware/software  debugger  can
break out.  All three products (atron, soft-ice, & CV) have a stack trace-back
function (CV's is the most limited, Atron's the best).  You should be able to
see where you are from a register dump and where you came from from the
trace-back dump.   

Then you simply figure out what's wrong.  simple, no?

I've been using the Nu-Mega products for several months and am extremely
happy (compaq 386).  I've yet to have to get the Atron out since i got the
2.  See any of the popular software journals for advertisments.

john

-- 
John De Armond, WD4OQC                     | "I can't drive 85!"
Sales Technologies, Inc.    Atlanta, GA    | Sammy Hagar driving 
...!gatech!stiatl!john                     | thru Atlanta!