From: Tom Tromey <tromey@redhat.com>
To: David Taylor <dtaylor@emc.com>
Cc: gdb@sourceware.org
Subject: Re: add-inferior / clone-inferior
Date: Tue, 21 May 2013 15:46:00 -0000 [thread overview]
Message-ID: <87bo84l5ad.fsf@fleche.redhat.com> (raw)
In-Reply-To: <7249.1369061005@usendtaylorx2l> (David Taylor's message of "Mon, 20 May 2013 10:43:25 -0400")
>>>>> "David" == David Taylor <dtaylor@emc.com> writes:
David> Looking at remote.c, it stores a global pointer to a structure
David> containing a file descriptor and other state in remote_desc.
David> This variable, and presumably others, are inferior specific.
It looks to me that someone made an attempt to isolate all the
per-remote data into struct remote_state, but then other developers went
ahead and added globals.
David> Looking at inferior.h I see:
David> /* Private data used by the target vector implementation. */
David> struct private_inferior *private;
David> Based on the comment, the structure should probably be called
David> private_target rather than private_inferior.
I think rather this field should be removed and replaced with uses of
the inferior's registry (see registry.h) for those targets that need to
hang data on the inferior.
David> I'm thinking that remote.c should define a struct private_inferior
David> containing, at least, a pointer to 'struct serial *remote_desc' and then
David> *EITHER* changing inferiors needs to save / restore remote_desc (which
David> would mean target_ops entries for { saving / restoring } state when you
David> { switch away from / switch back to } an inferior *OR* all references to
David> remote_desc need to be modified to get to it via
I think using struct remote_state and not private_inferior, but yeah.
David> I'm also thinking that target_ops needs to have a couple of
David> additional fields:
David> . a boolean -- does the target support multiple concurrent active
David> instances?
David> . a counter -- how many active instances do we currently have?
David> I'm also guessing that the above is just the tip of the iceberg or
David> someone would have already done this.
David> What else needs to happen for this to work? I'm trying to get a feel
David> for how big a project this would be and whether it would be better for
David> us to pursue other options.
It seems like it would only work for target-async as well.
I suppose that is a given already.
The whole target stack needs to be switched out depending on which
target is "active". I guess one idea would be to make it depend on the
current inferior. But then I would worry whether the correct inferior
is always selected when gdb is doing various operations.
I think I'd also examine all the calls to push_target, unpush_target,
and target_is_pushed to make sure they are ok. I think there are hidden
gotchas here. E.g., "record" will eventually call push_target via
record_full_open -- which examines the current target stack and stores
stuff into a global.
I wonder if there are other UI issues to consider.
Also see the thread containing this message:
http://sourceware.org/ml/gdb-patches/2010-06/msg00161.html
especially
http://sourceware.org/ml/gdb-patches/2010-06/msg00200.html
I thought I remembered other discussions of this in the past, but the
above is all I could find. Maybe we discussed it on irc.
It would be very nice to have a wiki page for this project, with the
plans and links.
Tom
next prev parent reply other threads:[~2013-05-21 15:46 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 [this message]
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
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=87bo84l5ad.fsf@fleche.redhat.com \
--to=tromey@redhat.com \
--cc=dtaylor@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