From: David Taylor <dtaylor@emc.com>
To: Tom Tromey <tromey@redhat.com>
Cc: "gdb@sourceware.org" <gdb@sourceware.org>
Subject: Re: add-inferior / clone-inferior
Date: Wed, 22 May 2013 19:42:00 -0000 [thread overview]
Message-ID: <9342.1369251736@usendtaylorx2l> (raw)
In-Reply-To: <87k3mqhmsn.fsf@fleche.redhat.com>
Tom Tromey <tromey@redhat.com> wrote:
> Tom> One that comes to mind is what target is associated with an inferior
> Tom> created with add-inferior? How could you change this inferior's target
> Tom> to connect it to some existing target?
>
> David> Perhaps I misunderstand the question. Initially, there is just a dummy
> David> target.
>
> David> Do a command like 'file' and you have an exec target.
>
> David> Do a command like 'run' or 'attach' or 'target remote' or 'target
> David> extended-remote' and your process stratum target is pushed on top of the
> David> old file stratum target.
>
> David> Do a command like 'kill' or 'detach' and your process stratum target is
> David> popped and you are back at the exec stratum target -- the exec file --
> David> at the top of your target stack.
>
> I was thinking of a scenario like: I have an existing connection to an
> extended-remote target, then I want to add an inferior and then run it
> on that target.
>
> I guess something like this would work if "target extended-remote"
> always did connection sharing:
>
> add-inferior -exec whatever
> target extended-remote server:port
> run
>
> The issue I have is differentiating this from the scenario of: add
> inferior, connect for the first time, then try to run. Won't this do
> something different if the remote is already running?
>
> I feel like I'm confused somehow.
I wasn't thinking about that scenario. My current interest is talking
to the kernel of a machine that might be in a local lab or might be at a
customer site half way around the world. The existing kernel stub does
not multiplex between boards. Each board has its own kernel. If you
want to multiplex between kernels, you have to do it at a higher level.
I'd rather not have an intermediate server that inspects the packets,
acts on some and passes the others on.
But, if you give it a different server:port than previously, presumably
you want it to open a new connection. I think it needs to be clear to
the user whether it is reusing an existing connection or creating a new
one. Perhaps a different syntax than server:port when reusing a
connection?
Maybe,
target extended-remote @<existing-inferior-id>
with an empty <existing-inferior-id> [i.e., just '@' for an argument]
meaning use the current inferior.
Unless you think that a user would always do one or always do the other,
rarely switching, in which case perhaps a settable flag would be
appropriate?
> David> . you want to know the full set of inferiors and their targets.
>
> David> Seems somewhat esoteric. Perhaps a maint command would be appropriate?
>
> I suppose we could just print it in "info inferiors".
If we just printed the top stratum element putting it into info
inferiors is probably reasonable. If it was more verbose, I don't think
the average user would care to see it.
I'd also like a name field somewhere for the inferior. I can envision
debugging a client server problem by having both under one GDB rather
than two GDBs. Ideally, names that the 'inferior' command recognizes
in addition to a numeric inferior id. Then I could do
inferior client
... some commands ...
inferior server
... some commands ...
> Tom
David
next prev parent reply other threads:[~2013-05-22 19:42 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-20 14:43 David Taylor
2013-05-20 15:06 ` Luis Machado
2013-05-20 15:46 ` David Taylor
2013-05-20 15:52 ` Luis Machado
2013-05-21 1:01 ` Yao Qi
2013-05-21 13:15 ` David Taylor
2013-05-21 13:52 ` Tom Tromey
2013-05-21 14:35 ` David Taylor
2013-05-21 15:46 ` Tom Tromey
2013-05-22 14:47 ` Tom Tromey
2013-05-22 18:21 ` David Taylor
2013-05-22 18:50 ` Tom Tromey
2013-05-22 19:42 ` David Taylor [this message]
2013-05-22 20:21 ` Tom Tromey
2013-06-24 20:50 ` Tom Tromey
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=9342.1369251736@usendtaylorx2l \
--to=dtaylor@emc.com \
--cc=gdb@sourceware.org \
--cc=tromey@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