From: Andrew Cagney <ac131313@redhat.com>
To: Jim Blandy <jimb@redhat.com>
Cc: gdb@sources.redhat.com
Subject: Re: "struct target_ops" -> "struct gdbtarg" || "struct target"
Date: Thu, 09 Oct 2003 20:52:00 -0000 [thread overview]
Message-ID: <3F85CAA1.9080302@redhat.com> (raw)
In-Reply-To: <vt2r81mb3nh.fsf@zenia.home>
> Andrew Cagney <ac131313@redhat.com> writes:
>
>
>> > Hello,
>> > The current "target_ops" structure appeared with GDB 4. The
>> > original implementation containing only methods. Since then the
>> > target_ops have evolved to include data vis:
>> > struct section_table
>> > *to_sections;
>> > struct section_table
>> > *to_sections_end;
>> > I think, the vector should be re-named to "struct target" or "struct
>> > gdbtarg" (consistent with gdbarch, and more name space proof) so
>> > that it correctly reflects its current implementation.
>> > I'd like to do this now, before the target methods start being
>> > explicitly parameterized with their target vector.
>
>>
>> I should note that an alternative is to have "struct gdbarch" as the
>> object and "struct target_ops" as the methods vis:
>>
>> struct target
>> {
>> .. data elements ...;
>> const struct target_ops *ops;
>> };
>
>
> You mean 'struct target' not 'struct gdbarch', right?
Obviously.
> The second
> alternative seems better to me, since it separates the static stuff
> from the dynamic stuff. (Except, of course, that the 'static' stuff
> isn't actually static, because of update_current_target...)
While it seems better, it's significantly harder. It will involve a
period of rope jumping (which will likely trip up everyone) during which
code wanting to modify things like "target_ops.to_section_end" will
co-exist with code wanting to modify "target.to_section_end". There are
likely ways to ease the pain, but lets not ignore that there will be pain.
Given this, I think the most straight forward step is a straight:
"struct target_ops" -> "struct gdbtarg"
transformation. Moving the "ops" to a separate "static" vector being a
second pass.
Andrew
prev parent reply other threads:[~2003-10-09 20:52 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-10-09 13:39 Andrew Cagney
2003-10-09 13:51 ` Andrew Cagney
2003-10-09 19:42 ` Jim Blandy
2003-10-09 20:52 ` Andrew Cagney [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=3F85CAA1.9080302@redhat.com \
--to=ac131313@redhat.com \
--cc=gdb@sources.redhat.com \
--cc=jimb@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