Re: Tools to debug multiple cores/processes at the same time?

John Baldwin <[email protected]>
Newsgroups gmane.comp.gdb.devel
Message-ID <[email protected]>
On 8/18/21 12:55 PM, Paul Smith via Gdb wrote:
> What I'm really wondering is, has anyone heard of something like this,
> or is there any support (even partial support) for something like this
> in GDB today?  I get that it seems like a somewhat specialized request.
> 
> Debugging multiple live processes at the same time would also be great,
> of course.

I haven't tried this myself, but you might be able to do this by adding
multiple inferiors (one inferior per process).  You can use 'add-inferior'
to add new inferiors and 'info inferiors' to list them.  'inferior N'
switches between inferiors, though 'info threads' also shows threads
from all inferiors and you can switch by threads as well.  When
debugging a process that forks and have detach-on-fork disabled, each
process ends up in a separate inferior.  I haven't tried, but you can
perhaps use 'core' or 'attach' in each inferior to attach to multiple
cores or processes.  There is a knob that affects scheduling (does
a continue all processes or just the current one?) for the live case.
I'm not sure if you can have convenience variables be per-inferior,
and I'm not sure if we currently have a convenience variable that
exposes the current inferior.  I suspect you probably would have access
to that if you were to write your custom commands in python rather
than as user commands.

-- 
John Baldwin
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.