public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: John Baldwin <jhb@FreeBSD.org>
To: psmith@gnu.org, gdb@sourceware.org
Subject: Re: Tools to debug multiple cores/processes at the same time?
Date: Wed, 18 Aug 2021 13:25:21 -0700	[thread overview]
Message-ID: <63ff89cc-d0ef-7d38-577e-7e099e0250f8@FreeBSD.org> (raw)
In-Reply-To: <3ba28620390947de2a84cabbd1958852aad97d5e.camel@gnu.org>

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

  reply	other threads:[~2021-08-18 20:25 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-18 19:55 Paul Smith
2021-08-18 20:25 ` John Baldwin [this message]
2021-08-18 20:53 ` Paul Koning
2021-08-18 21:09   ` Paul Smith
2021-08-19 10:56     ` Philippe Waroquiers
2021-08-20  6:28     ` Aktemur, Tankut Baris
2021-08-19 11:04 ` Andrew Burgess

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=63ff89cc-d0ef-7d38-577e-7e099e0250f8@FreeBSD.org \
    --to=jhb@freebsd.org \
    --cc=gdb@sourceware.org \
    --cc=psmith@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).