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

  1. Path: sparky!uunet!decwrl!sun-barr!cs.utexas.edu!usc!news.bbn.com!daedalus.bbn.com!wsadkin
  2. From: wsadkin@bbn.com (Will Sadkin)
  3. Newsgroups: comp.unix.questions
  4. Subject: spawning dbx on ones' self
  5. Date: 2 Sep 1992 23:08:34 GMT
  6. Lines: 37
  7. Sender: wsadkin@daedalus.bbn.com (Will Sadkin)
  8. Distribution: world
  9. Message-ID: <laaibiINNkd6@news.bbn.com>
  10. NNTP-Posting-Host: daedalus.bbn.com
  11.  
  12.  
  13. To Unix wizards who read this group,
  14.  
  15. I have an application where I need to have it start up a dbx on itself
  16. a certain point in it's execution.  (For reasons I won't go into here, running
  17. dbx on the process from the start just won't do...) The basic scheme I came 
  18. up with is to:
  19.     get the pid for the process
  20.     fork
  21.     in child:  
  22.     run dbx on the pid of the parent
  23.     in parent: 
  24.     stop 
  25.  
  26. Unfortunately, I cannot get this to work...
  27.  
  28. If the parent sends itself a SIGSTOP, using kill, the dbx cannot
  29. attach, and just blocks forever.
  30.  
  31. It seems that when dbx first attaches to a process it sends its own
  32. SIGSTOP.  So I tried doing a sigpause(SIGSTOP), but this is not allowed.
  33.  
  34. I tried calling just pause in the parent; this results in the dbx 
  35. wedging, not accepting keyboard input; the same result happens if
  36. I simply call sleep. (What is happening here?)
  37.  
  38. Am I violating any fundamental rules?  If so, please let me know 
  39. where I've gone wrong, and if not, does anyone out there have a 
  40. solution to this problem?
  41.  
  42. /Will
  43.  
  44. -------------------------------------------------------------------------------
  45. Will Sadkin                | "Never draw what you can copy;
  46. BBN Systems & Technologies |  never copy what you can trace;
  47. wsadkin@bbn.com            |  never trace what you can cut out and paste down!"
  48. -------------------------------------------------------------------------------
  49.