1

I'm trying to debug a forking process on remote host, but getting the gdbserver process end on me every time with child exit.

Tried to setting "set follow-fork-mode child" in .gdbinit, didn't help.

Is there a good solution for this one?

Thanks.

SyBer
  • 5,407
  • 13
  • 55
  • 64
  • Have you tried setting that in an interactive GDB session? – Nikolai Fetissov Jan 17 '11 at 19:54
  • This is Eclipse-RSE based session, so it's only automated. – SyBer Jan 17 '11 at 20:19
  • Related, see [How do I debug the child process after fork() in gdb?](https://stackoverflow.com/q/6199270/608639), [Debugging child process after fork (follow-fork-mode child configured)](https://stackoverflow.com/q/15126925/608639), etc. – jww Sep 03 '18 at 11:43

1 Answers1

1

Does the forking process fork more than once? If not, you can use the --attach option to attach to the child.

David1235
  • 119
  • 3
  • Only once, but I can't figure out how to make gdbserver re-attach to forked process. – SyBer Jan 18 '11 at 09:20
  • Wait for the child to fork and just attach to it. Use a separate pair of gdb and gdbserver instances if you want to debug the parent and the child. – David1235 Jan 18 '11 at 20:01