public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* gdbserver multiprocess debugging
@ 2012-12-24  8:03 Xingxing Pan
  2012-12-24 10:18 ` Yao Qi
  0 siblings, 1 reply; 2+ messages in thread
From: Xingxing Pan @ 2012-12-24  8:03 UTC (permalink / raw)
  To: gdb

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: gdbserver multiprocess debugging
  2012-12-24  8:03 gdbserver multiprocess debugging Xingxing Pan
@ 2012-12-24 10:18 ` Yao Qi
  0 siblings, 0 replies; 2+ messages in thread
From: Yao Qi @ 2012-12-24 10:18 UTC (permalink / raw)
  To: Xingxing Pan; +Cc: gdb

On 12/24/2012 04:03 PM, Xingxing Pan wrote:
> Hi all,
>
> I'm using gdbserver in gdb 7.5 to debug a program which calls fork(),
> but gdbserver cannot stop the child.

>
> Did I miss anything?
>

I had a vague impression that GDBserver doesn't support following fork.
I find this PR in bugzilla,

   fork support in the remote protocol
   http://sourceware.org/bugzilla/show_bug.cgi?id=13584

This PR was open one year ago, and I didn't see patches for this issue. 
  I think that is the reason about your fail.

-- 
Yao (齐尧)

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-12-24 10:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-12-24  8:03 gdbserver multiprocess debugging Xingxing Pan
2012-12-24 10:18 ` Yao Qi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).