home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!think.com!ames!saimiri.primate.wisc.edu!tik.vtt.fi!tik.vtt.fi!tml
- From: tml@tik.vtt.fi (Tor Lillqvist)
- Newsgroups: comp.sys.hp
- Subject: Re: Sun-like trace(1) for 7xx's running 8.07?
- Date: 19 Nov 92 00:06:06
- Organization: Technical Research Centre of Finland, Laboratory for Information
- Processing (VTT/TIK)
- Lines: 38
- Message-ID: <TML.92Nov19000606@hemuli.tik.vtt.fi>
- References: <Nov.18.14.23.17.1992.21700@klinzhai.rutgers.edu>
- NNTP-Posting-Host: tik.vtt.fi
- In-reply-to: juo@klinzhai.rutgers.edu's message of 18 Nov 92 19:23:17 GMT
-
- In article <Nov.18.14.23.17.1992.21700@klinzhai.rutgers.edu> juo@klinzhai.rutgers.edu (John Oleynick) writes:
- Has anyone created/ported a utility like Sun's trace(1) (creates or attaches
- to a process and prints the system calls it makes) to the HP 7xx's running
- 8.07?
-
- I once started writing a tool like this in 7.0, but then came 8.0 and
- shared libraries and I lost interest... My program worked like this:
-
- - fork, the child does a PT_SETTRC, and execs the program to
- be traced
- - the parent reads through the a.out file searching for
- syscalls, replaces syscalls in the child with breakpoints
- (and remembers what syscall was at what breakpoint).
- - continue the child
- - when the child hits a breakpoint, print the syscall name and
- arguments
- - set a breakpoint after the syscall, restore the syscall,
- continue the child
- - print the syscall result, restore the breakpoint at the syscall,
- restore the instruction after the syscall, and continue
-
- You get the idea. Now that I look at the code again, I seem to have
- done it for the series 300 only, although in principle it could have
- worked in a similar way on the series 800.
-
- But, with shared libraries, the above wouldn't work any longer.
- Instead you'll have to wait until the process has mapped in the shared
- library code, and then search through the library code and put in
- breakpoints. Or something like that. (Furious hand waving here, I
- have no idea if this could possibly work.)
-
- I am sure HP uses system call tracing and other kernel instrumentation
- when testing their software, why can't these features be left in when
- the kernel is compiled for the customers...?
- --
- Tor Lillqvist,
- working, but not speaking, for the Technical Research Centre of Finland,
- Laboratory for Information Processing (VTT/TIK).
-