Re: UPS tracing

From: Rod Armstrong (
Date: Tue May 21 2002 - 19:31:21 BST

  • Next message: Rod Armstrong: "Using one ups to follow a child"
    >From: "Tom S" <>
    >Subject: UPS tracing
    >Date: Fri, 17 May 2002 21:45:41 +0000
    >Hi Rod,
    >Could you tell me how to instruct UPS to follow the child process after 
    >doing a 'fork', or if it is even possible.
    >Thanks in advance,
         You will need to attach another ups to the forked process. Assuming
    that you want to debug the child from the beginning, you can use
    breakpoint code in the parent to stop it running. An alternative is
    to spawn ups on the child (maybe using a script) rather than forking
    the child directly. I did this on Solaris:
    1. ups parent &
       The parent code did this:
      if((child_pid = vfork()) == FALSE)
        /* this is the child */
        /* 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
    2. Use the pid printed out to start ups on the stopped child:
       ups child <pid> &
    3. Continue the child:
       kill -CONT <pid>
    4. In the child ups, put a break on main() or whatever, and continue.

    This archive was generated by hypermail 2.1.4 : Thu May 23 2002 - 15:54:14 BST