Wanted: Machine language trace

Mike Van Pelt mvp at v7fs1.UUCP
Fri Apr 7 16:32:41 AEST 1989


On the Sun 386i, I just discovered the desperate need to trace a
program at the machine language level -- the kind of thing that MessDos
DEBUG does, just print the instructions and register contents.  In fact,
what I want to do in Unix is precisely what DEBUG would do if I typed
T 9999999999.

First I looked at adb.  That ought to be low-level enough, I thought.
Its command structure is certainly weird and cryptic enough.  But
after wading through the manual for a couple of hours trying to figure
out how to put that bignum after the T, I came to the horrible
realization -- IT AIN'T THERE!  Sure, you can type ,9999999 :s, but
that will only list the instructions, not any of the invaluble register
contents.  Worse, I lied about the 's' at the end of "instructions" --
It silently executes them, then prints the last, and only the last,
instruction executed.  (Still no registers.)

In desperation, I piped the script 

while true
do
echo ':s ; $r'
done

to adb, but this is getting too gross for me to deal with any more.
(Besides, it filled up my file system before getting to the part of the
program I need to look at.)  The area I need to scan is far, far too
big to dink at it one instruction at a time.  I need to go grep'ing
through the trace file for IO instructions megabytes at a time.

There's also dbx, but dbx won't condescend to touch anything that
wasn't compiled with the 'g' option, and if I had the source to
recompile the thing, I wouldn't be trying to use adb on it.  (I sure
wish I had the old Univac debugger, FLIT, on Unix...)

Am I missing something obvious?  It sure seems like I must be.  There
*HAS* to be some trace-the-damn-program-an-instruction-at-a-time-AND-
TELL-ME-WHAT-IT-DID type of debugger on Unix... doesn't there?

-- 
Mike Van Pelt                     "I'm not a biologist, but I play one in 
Video Seven                        front of Congressional hearings."
...ames!vsi1!v7fs1!mvp                        -- Meryl Streep



More information about the Comp.unix.wizards mailing list