This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]