Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!purdue!haven!mimsy!chris From: chris@mimsy.UUCP (Chris Torek) Newsgroups: comp.unix.wizards Subject: Re: Wanted: Machine language trace Message-ID: <16785@mimsy.UUCP> Date: 7 Apr 89 15:50:41 GMT References: <315@v7fs1.UUCP> Distribution: na Organization: U of Maryland, Dept. of Computer Science, Coll. Pk., MD 20742 Lines: 100 In article <315@v7fs1.UUCP> mvp@v7fs1.UUCP (Mike Van Pelt) writes: >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 .... Not being familiar with this, all I can do is talk about adb: >[adb's] 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! adb can do it. adb can do anything. :-) >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.) `:s' steps: it runs single instructions until the count runs out, or until adb hits a breakpoint. When it stops, it prints the reason (breakpoint or `stopped' or illegal memory access or whatnot) and the pc, and decodes the instruction at that location. >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.) That parenthetical remark sounds like the real problem (but maybe not; see below). The script above works, but you can do it directly in adb, although you need an auxiliary file: put the commands :s $r $