Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: "taylor, david" <david.taylor@emc.com>
To: Pedro Alves <palves@redhat.com>,
	"gdb@sourceware.org" <gdb@sourceware.org>
Subject: RE: multiple live inferiors
Date: Thu, 11 Aug 2016 17:13:00 -0000	[thread overview]
Message-ID: <63F1AEE13FAE864586D589C671A6E18B06CAB4@MX203CL03.corp.emc.com> (raw)
In-Reply-To: <dd5b140f-9257-1f19-83c5-0416a7138e0f@redhat.com>

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8", Size: 3327 bytes --]

> From: Pedro Alves [mailto:palves@redhat.com]
> Sent: Thursday, August 11, 2016 11:22 AM
> 
> On 08/11/2016 03:56 PM, taylor, david wrote:
> > Currently GDB supports having multiple non-live inferiors.  But, if I try to
> > add a second live inferior it wants to kill the current live inferior.
> 
> By "non-live", I assume you mean file_stratum inferiors
> (executable files, etc.).  GDB does not support having multiple
> core dump inferiors loaded.

I wasn't  thinking about core files and was unaware of that limitation.  I don't
currently have a need for multiple core dump inferiors.

I was thinking of non-live as targets for which target_has_execution returns false.

> gdb _does_ however support having multiple live inferiors.  It works
> as long as they're all behind the same target connection.  E.g.,
> multiple inferiors with the native target.  Or
> multiple inferiors against gdbserver.  The simplest to get them
> is to enable following forks, with "set detach-on-fork off".

The targets involved all have different elf files.  They are running on different boards
within our box.  Neither is the ancestor / descendant of the other.

> You're trying to add a second target connection, which is
> a bit orthogonal.


> > That is, I can do:
> >
> >     gdb some-file.elf
> >     set non-stop on
> >     set target-async on
> >     target extended-remote | program with some arguments
> 
> "program" here will be the server.
> 
> >     add-inferior -exec new-file.elf
> >     info inferiors
> >     inferior 2
> >     target extended-remote | program with different arguments
> >
> 
> So here replace the second "target extended-remote"
> with "attach" or "run" to start the new inferior under
> control of the first server.

Neither attach nor run is suitable.

The elf files are the kernels.  The model is one a single process consisting
of a bunch of threads in a common address space.

The arguments to the program, which runs on the desktop, not the target,
include a user name and password (used for authentication) and an IP address.
The program establishes a TCP/IP connection to the GDB stub port on the board.
It passes the user name and password to the box.  Once the connection is authenticated,
the program just copies, without examination, remote protocol packets back and
forth until the connection is broken (e.g., GDB disconnects).

There is no support for switching to a different board whether within the desktop
program or within the GDB stub running on a board within the box.

I want to have multiple inferiors each with their own dedicated (extended-)remote target.

While my current use case is for multiple boards within the same box, I can envision a future
where the inferiors might be in different boxes in different buildings...

> > at which point GDB will say:
> >
> >     A program is being debugged already.  Kill it? (y or n)
> >
> > I'd be okay with the question if the current inferior was live.  But, it is just
> an executable.
> >
> > I assume that there's more to changing this than just modifying
> target_preopen.
> > What else is likely to break or need modification?
> 
> See here:
> 
>   https://sourceware.org/gdb/wiki/MultiTarget
> 
> Thanks,
> Pedro Alves

\x16º&ÖëzÛ«ŸŽvÛ¹b²Ö«r\x18\x1d

  reply	other threads:[~2016-08-11 17:13 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-11 14:57 taylor, david
2016-08-11 15:22 ` Pedro Alves
2016-08-11 17:13   ` taylor, david [this message]
2016-08-11 17:35     ` Pedro Alves

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=63F1AEE13FAE864586D589C671A6E18B06CAB4@MX203CL03.corp.emc.com \
    --to=david.taylor@emc.com \
    --cc=gdb@sourceware.org \
    --cc=palves@redhat.com \
    /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