Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: florent vion <florent.vion@gmail.com>, gdb@sourceware.org
Subject: Re: Debugging Multiple Inferiors
Date: Thu, 07 Sep 2017 12:50:00 -0000	[thread overview]
Message-ID: <de306b15-7d76-941e-9b33-ad3ff3f3091a@redhat.com> (raw)
In-Reply-To: <CAPkd_ax2i+pR98UXAtEbsE_O4KMs6UQoSzQp7S4Si5v4x7V6=A@mail.gmail.com>

On 09/07/2017 01:09 PM, florent vion wrote:
> Hi the experts,
> 
> Do you know if it is possible to debug two cortex-m in parallel with
> one gdb session using inferiors?

Interesting!  And apropos too.  If possible, I'd love to
hear more about the use case.

It's not possible today, but hopefully that won't be for too long.
See below.

> Do I need to enable the non stop mode if I use the remote protocol?

...

> It seems that the remote target behaves as an Highlander, "there can
> be only one"...

Indeed.  However, I've actually been working on lifting
that limitation.

You can find my WIP branch here:

  https://github.com/palves/gdb/commits/palves/multi-target

It's a WIP, still with a couple of quick hacks in place, but
it's good enough to debug multiple remote connections at the
same time using that, provided the remote stubs support the
same set of remote protocol extensions (which is not an
issue if you have two exactly equal boards) and provided
the remote target/stub supports non-stop mode.  If you want
to give it a try, know that user-visible all-stop mode does
work, however you'll need to do "maint set target-non-stop on"
before connecting to force the remote connection itself
to use non-stop mode.

I've been focusing on "target extended-remote" (+ "run"), but
I expect that "target remote" should work too.  (If it doesn't
yet, I'll want to fix it.)

FYI, if you're curious about implementation details, earlier
attempts at multi-target are described here:

  https://sourceware.org/gdb/wiki/MultiTarget

While my new implementation is different/new, a good part
of the info on that page is still relevant, since it lists
the problem that need to be addressed.  Perhaps the main
difference in my approach is that nowadays GDB is a C++ program
and I'm making target_ops a C++ class hierarchy, and that
I'm not extending PTID, but instead making core of gdb use
thread_info/inferior/target_ops pointers more.

Thanks,
Pedro Alves


      reply	other threads:[~2017-09-07 12:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-07 12:09 florent vion
2017-09-07 12:50 ` Pedro Alves [this message]

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=de306b15-7d76-941e-9b33-ad3ff3f3091a@redhat.com \
    --to=palves@redhat.com \
    --cc=florent.vion@gmail.com \
    --cc=gdb@sourceware.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