system() handling

ngaix.gif (1051 bytes)Restriction: This is supported on only.

When a program running in a UNIX environment starts another program using a call to system(), the system() function calls both fork() and exec(). The following describes the Distributed Debugger's behavior after you perform a Step Over command on a line containing a system() call, and tells you what actions you should take to begin debugging the child process.

  1. The system() function calls fork(). The Distributed Debugger stops execution and raises a Process fork action dialog.
  2. At this point you should choose to debug the child process. Once the Process fork action dialog closes, issue the Run command to continue debugging the child process.
  3. The new child process calls exec() to load /bin/sh, and the debugger opens a New process dialog and the active Distributed debugger Source pane shows a disassembly view of the initial runtime entry point of /bin/sh.
  4. Click OK to start debugging the child process.
  5. The Distributed Debugger stops in the main function of /bin/sh.
  6. Issue the Run command.
  7. The /bin/sh process issues a fork() call. Again, the Distributed Debugger stops and brings up a Fork action dialog.
  8. At this point you should choose to debug the Child process. Once the Process fork action dialog closes, issue the Run command to continue debugging the child process.
  9. The new child process calls exec() to load the program specified in the call to system() in the original program. The Distributed Debugger opens a New process dialog and the active Distributed Debugger Source pane shows a disassembly view of the initial runtime entry point of the program specified in the call to system().
  10. Click OK. The Distributed Debugger stops at main(). From here you can continue debugging.

ngrelr.gif (548 bytes)
exec() handling
fork() handling