home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / sys / hp / 13079 < prev    next >
Encoding:
Internet Message Format  |  1992-11-18  |  2.3 KB

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