From: Pedro Alves <palves@redhat.com>
To: "taylor, david" <david.taylor@emc.com>,
"gdb@sourceware.org" <gdb@sourceware.org>
Subject: Re: multiple live inferiors
Date: Thu, 11 Aug 2016 15:22:00 -0000 [thread overview]
Message-ID: <dd5b140f-9257-1f19-83c5-0416a7138e0f@redhat.com> (raw)
In-Reply-To: <63F1AEE13FAE864586D589C671A6E18B06CA71@MX203CL03.corp.emc.com>
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.
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".
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.
> 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
next prev parent reply other threads:[~2016-08-11 15:22 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 [this message]
2016-08-11 17:13 ` taylor, david
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=dd5b140f-9257-1f19-83c5-0416a7138e0f@redhat.com \
--to=palves@redhat.com \
--cc=david.taylor@emc.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