From: Bob Carragher (dancebob_at_mindspring.com)
Date: Wed May 22 2002 - 06:06:35 BST
Rod Armstrong <rod_at_san-jose.tt.slb.com> sez: > I forgot to add that one can follow the child using just one instance of > ups if you want: > > 1. ups parent & > The parent code did this: > if((child_pid = vfork()) == FALSE) > { > /* this is the child */ > .... > } > else > { > /* this is the parent */ > kill(child_pid, 23); <<< insert this breakpoint code. 23 is SIGSTOP > printf("child pid is %d\n", child_pid); << breakpoint code to get pid > .... > } > #stop; <<<<<<<<< stop here to follow the child > > 2. At the #stop, edit the target name to the child name, press RET. > > 3. Attach to the <pid>. > > 4. From an xterm, continue the child: > kill -CONT <pid> > > 5. In ups, put a break on main() or whatever, and continue. Okay, now I'm intrigued by whether this can be done to enable ups to follow threads under Linux. Some may remember that I asked about this at the beginning of this year. Basically, ups will hang under Linux if a breakpoint is enabled in code that is normally run under a created thread. (Actually, I finally traced the code a bit. It hangs at the call to wait() on line 215 of ao_ptrace.c.) I realize the fix is not simple, otherwise it would've been done by now, but I'm curious as to whether anyone knows what is going on, and whether I can insert workarounds in my code. Thanks! Bob
This archive was generated by hypermail 2.1.4 : Thu May 23 2002 - 15:54:16 BST