From: Pedro Alves <palves@redhat.com>
To: Tom Tromey <tom@tromey.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH 1/3] Move core_bfd to program space
Date: Fri, 04 May 2018 16:09:00 -0000 [thread overview]
Message-ID: <b70b0914-a495-017a-9185-53d17f806a36@redhat.com> (raw)
In-Reply-To: <87r2mr2zt4.fsf@tromey.com>
On 05/04/2018 04:41 PM, Tom Tromey wrote:
>>>>>> "Pedro" == Pedro Alves <palves@redhat.com> writes:
>
> Pedro> This moves the core_bfd global to be a field of the program space. It
> Pedro> then replaces core_bfd with a macro to avoid a massive patch -- the
> Pedro> same approach taken for various other program space fields.
>
> I am curious to know whether you would want to remove this macro in the
> future. I don't mean that you should do it -- just more a question of
> what direction to go. There are other macros like this too:
> symfile_objfile, object_files, exec_bfd, ...
Yeah, I have no plans to do that myself, but I wouldn't oppose
changing it.
> Also, I can't remember why I moved core_bfd to the progspace. Would it
> be better to have it just be a member of the target? Or maybe in your
> design these end up being basically equivalent, because core targets are
> inherently single-process?
Yeah, I guess program space just felt natural given exec_bfd is there
too. Not sure about putting it in the target. Making it a data field of
target_ops I think would be odd. It might work if we replaced it
with something like (in the multi-target branch):
bfd *
core_bfd ()
{
if (core_target *core
= dynamic_cast<core_target *>
(current_inferior ()->process_target ()))
return core->core_bfd;
return nullptr;
}
though that's a bit smelly, and when I see dynamic_cast
I can't avoid thinking about how inefficient it is. :-)
Alternatively, we could make core_bfd() a virtual method of
target_ops instead, that has most targets except the
core_target target return NULL.
Not sure. Putting it in program space just seemed like an
easy and OK thing to do.
Thanks,
Pedro Alves
next prev parent reply other threads:[~2018-05-04 16:09 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-03 16:22 [PATCH 0/3] Torward multiple simultaneous core instances Pedro Alves
2018-05-03 16:22 ` [PATCH 2/3] Eliminate the 'the_core_target' global Pedro Alves
2018-05-04 15:59 ` Tom Tromey
2018-05-03 16:22 ` [PATCH 3/3] Heap-allocate core_target instances Pedro Alves
2018-05-04 16:36 ` Tom Tromey
2018-05-06 15:38 ` Pedro Alves
2018-05-07 14:26 ` Tom Tromey
2018-05-11 19:40 ` Pedro Alves
2018-05-03 16:22 ` [PATCH 1/3] Move core_bfd to program space Pedro Alves
2018-05-04 15:41 ` Tom Tromey
2018-05-04 16:09 ` Pedro Alves [this message]
2018-05-04 16:46 ` 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=b70b0914-a495-017a-9185-53d17f806a36@redhat.com \
--to=palves@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=tom@tromey.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).