home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / sys / hp / 9993 < prev    next >
Encoding:
Internet Message Format  |  1992-09-02  |  1.9 KB

  1. Path: sparky!uunet!cs.utexas.edu!ut-emx!tivoli!TIVOLI.COM!stuart
  2. From: stuart@TIVOLI.COM (Stuart Jarriel)
  3. Newsgroups: comp.sys.hp
  4. Subject: attaching xdb to a running process...
  5. Message-ID: <3739@tivoli.UUCP>
  6. Date: 3 Sep 92 02:15:05 GMT
  7. Sender: news@tivoli.UUCP
  8. Organization: Tivoli Systems, Inc
  9. Lines: 37
  10.  
  11. This is more of a signals question I think.  I would like to be able to 
  12. fork/exec xdb in a hpterm window that in turn will attach to the parent 
  13. process.  The code flow looks like this:
  14.  
  15.                 main
  16.                   |
  17.                   |
  18.                  fork----------------|
  19.          (parent) |                  | (child  PID = XXX)
  20.                   |                  |
  21.                  wait()              |
  22.                                      | 
  23.                                     fork--------------------|
  24.                                      |                      |
  25.                                      |                      | (child)
  26.                                      |                      |
  27.                                      |                      | 
  28.                                    pause()                exec()
  29.                                      |                 (hpterm -e xdb -P XXX)
  30.                                      |
  31.                                  (debug code here)
  32.  
  33. Well, this works REALLY well except that after the debugger attached to the
  34. code that is in the pause(), I cant get it to start.  SIGCONT has no effect.
  35.  
  36. As for signal handlers, the main has a handler for SIGCLD prior to the first
  37. fork, and after the fork ignores SIGHUP, SIGINT and SIGPIPE.
  38.  
  39. I suspect that I just dont know enough about xdb to see what it needs to 
  40. do to get a process started, but the only manual Ive seen is a really good
  41. users manual, and this is a little beyond that.
  42.  
  43. If anyone knows more about xdb and what signals it uses to start/stop a 
  44. process once it has gotten it with ptrace, please let me know.  
  45.  
  46. Thanks
  47. stuart
  48.