aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gdb/doc/ChangeLog4
-rw-r--r--gdb/doc/gdb.texinfo25
2 files changed, 29 insertions, 0 deletions
diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog
index ba926d1..24d28fd 100644
--- a/gdb/doc/ChangeLog
+++ b/gdb/doc/ChangeLog
@@ -1,3 +1,7 @@
+Mon Jan 23 14:23:37 1995 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * gdb.texinfo (Processes): New node.
+
Tue Jan 17 14:09:03 1995 Ian Lance Taylor <ian@sanguine.cygnus.com>
* remote.texi: Update documentation of set/show mipsfpu.
diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
index 5db9253..f727326 100644
--- a/gdb/doc/gdb.texinfo
+++ b/gdb/doc/gdb.texinfo
@@ -1400,6 +1400,7 @@ already running process, or kill a child process.
* Kill Process:: Killing the child process
* Process Information:: Additional process information
* Threads:: Debugging programs with multiple threads
+* Processes:: Debugging programs with multiple processes
@end ifclear
@end menu
@@ -1985,6 +1986,30 @@ programs with multiple threads.
watchpoints in programs with multiple threads.
@end ifclear
+@node Processes
+@section Debugging programs with multiple processes
+
+@cindex fork, debugging programs which call
+@cindex multiple processes
+@cindex processes, multiple
+@value{GDBN} has no special support for debugging programs which create
+additional processes using the @code{fork} function. When a program
+forks, @value{GDBN} will continue to debug the parent process and the
+child process will run unimpeded. If you have set a breakpoint in any
+code which the child then executes, the child will get a @code{SIGTRAP}
+signal which (unless it catches the signal) will cause it to terminate.
+
+However, if you want to debug the child process there is a workaround
+which isn't too painful. Put a call to @code{sleep} in the code which
+the child process executes after the fork. It may be useful to sleep
+only if a certain environment variable is set, or a certain file exists,
+so that the delay need not occur when you don't want to run @value{GDBN}
+on the child. While the child is sleeping, use the @code{ps} program to
+get its process ID. Then tell @value{GDBN} (a new invocation of
+@value{GDBN} if you are also debugging the parent process) to attach to
+the child process (see @ref{Attach}). From that point on you can debug
+the child process just like any other process which you attached to.
+
@node Stopping
@chapter Stopping and Continuing