This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: debugging a program which spawns multiple children
- From: Simon Marchi <simark at simark dot ca>
- To: Christian Groessler <chris at groessler dot org>, "gdb at sourceware dot org" <gdb at sourceware dot org>
- Cc: John Baldwin <jhb at FreeBSD dot org>
- Date: Mon, 12 Feb 2018 20:24:32 -0500
- Subject: Re: debugging a program which spawns multiple children
- Authentication-results: sourceware.org; auth=none
- References: <b30d21ed-f035-27f4-0d2c-3269d99fef13@groessler.org>
On 2018-02-12 08:19 PM, Christian Groessler wrote:
> Hi,
>
> I'm trying to debug a problem in FreeBSD's "dump" command. The dump
> command creates 4 or 5 child processes,
> and in my use case one of them gets a SIGSEGV.
>
> Is it possible to monitor all spawned processes simultaneously? I'm
> currently using gdb version 7.12.1 from the FreeBSD ports.
> I would have to problem to use a newer version of gdb and compile it
> locally.
>
> regards,
> chris
>
Hi Christian,
If GDB for FreeBSD supports it, you can keep debugging the parent process as
well as child processes by using "set detach-on-fork off". John (in CC) may
give more info about the support for multi process debugging with FreeBSD.
You might want to read more about the "all-stop" vs "non-stop" modes in the GDB
documentation and their related settings.
Simon