This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
gdbserver multiprocess debugging
- From: Xingxing Pan <forandom at gmail dot com>
- To: gdb <gdb at sourceware dot org>
- Date: Mon, 24 Dec 2012 16:03:44 +0800
- Subject: gdbserver multiprocess debugging
Hi all,
I'm using gdbserver in gdb 7.5 to debug a program which calls fork(),
but gdbserver cannot stop the child.
1 #include <unistd.h>
2 #include <stdio.h>
3 #include <stdlib.h>
4
5 void main()
6 {
7 pid_t pid;
8 if((pid = fork()) == 0) {
9 printf("child\n");
10 exit(0);
11 }
12 printf("parent\n");
13 while(1);
14 }
gdb>break 9
gdb>set follow-fork-mode child
gdb>continue
I'm using gcc 4.6.3 on x86_64 ubuntu 12.04.
Did I miss anything?
Thanks,
Xingxing