From: Andrew Burgess <andrew.burgess@embecosm.com>
To: Tom Tromey <tromey@adacore.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH v2 2/8] Handle copy relocations
Date: Thu, 22 Aug 2019 08:41:00 -0000 [thread overview]
Message-ID: <20190822084129.GK6076@embecosm.com> (raw)
In-Reply-To: <87ftlul4ed.fsf@tromey.com>
* Tom Tromey <tromey@adacore.com> [2019-08-21 13:11:54 -0600]:
> >>>>> "Andrew" == Andrew Burgess <andrew.burgess@embecosm.com> writes:
>
> >> +struct minimal_symbol *
> >> +lookup_minimal_symbol_linkage (const char *name, struct objfile *objf)
>
> Andrew> I found the name chosen for this function rather confusing. When
> Andrew> comparing to say 'lookup_minimal_symbol_text' which does
> Andrew> sort-of-almost the same thing but for text type symbols, I might have
> Andrew> been tempted to go with 'lookup_minimal_symbol_data'. Am I missing
> Andrew> something behind the choice of function name?
>
> You aren't missing anything.
>
> lookup_minimal_symbol_data seems maybe confusing too, because
> lookup_minimal_symbol_text loops over all objfiles, but this one
> does not.
Indeed, and the return type is different. I also notice that
lookup_minimal_symbol_text can be restricted to a single objfile,
however in that case we _still_ iterate over all object files.
So then I thought, surely we can do better, maybe add a single object
iterator and have lookup_minimal_symbol_text not walk through all
object files.... but then I spotted this condition:
if (objf == NULL || objf == objfile
|| objf == objfile->separate_debug_objfile_backlink)
{
/* Process object file. */
}
So, in this case we have to scan all objfiles in case we have split
debug information. Wouldn't this apply to your new function too?
I guess I'm thinking that we could merge the core of
lookup_minimal_symbol_text and lookup_minimal_symbol_linkage (or
_data), and just pass in a comparison function to check for either
text or data symbols.
>
> I guess I don't care all that much (as evidenced by the original choice
> of name ;) so if you still like that better, I'll make the change.
Meh! I guess my only request would be can the comment at least explain
that it's similar to *_text but for data as currently neither the
function name nor the comment mention data at all.
Thanks,
Andrew
next prev parent reply other threads:[~2019-08-22 8:41 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-01 17:04 [PATCH v2 0/8] Handle copy relocations and add $_ada_exception Tom Tromey
2019-08-01 17:04 ` [PATCH v2 6/8] Make current_source_* per-program-space Tom Tromey
2019-08-20 15:57 ` Andrew Burgess
2019-08-21 19:05 ` Tom Tromey
2019-08-01 17:04 ` [PATCH v2 3/8] Back out earlier Ada exception change Tom Tromey
2019-08-01 17:04 ` [PATCH v2 2/8] Handle copy relocations Tom Tromey
2019-08-21 15:35 ` Andrew Burgess
2019-08-21 19:11 ` Tom Tromey
2019-08-22 8:41 ` Andrew Burgess [this message]
2019-09-19 17:45 ` Tom Tromey
2019-09-19 18:28 ` Tom Tromey
2019-09-19 18:40 ` Andrew Burgess
2019-08-01 17:04 ` [PATCH v2 1/8] Change SYMBOL_VALUE_ADDRESS to be an rvalue Tom Tromey
2019-08-01 17:04 ` [PATCH v2 8/8] Make print-file-var.exp test attribute visibility hidden, dlopen, and main symbol Tom Tromey
2019-08-20 13:41 ` Andrew Burgess
2019-08-21 14:35 ` Andrew Burgess
2019-08-01 17:04 ` [PATCH v2 7/8] Add $_ada_exception convenience variable Tom Tromey
2019-08-01 17:56 ` Eli Zaretskii
2019-09-20 19:16 ` Tom Tromey
2019-08-27 9:47 ` Andrew Burgess
2019-09-20 19:15 ` Tom Tromey
2019-08-01 17:12 ` [PATCH v2 4/8] Search global block from basic_lookup_symbol_nonlocal Tom Tromey
2019-08-21 10:32 ` Andrew Burgess
2019-08-27 9:54 ` Andrew Burgess
2019-08-27 18:17 ` Christian Biesinger via gdb-patches
2019-08-28 12:34 ` Andrew Burgess
2019-08-01 17:12 ` [PATCH v2 5/8] Don't call decode_line_with_current_source from select_source_symtab 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=20190822084129.GK6076@embecosm.com \
--to=andrew.burgess@embecosm.com \
--cc=gdb-patches@sourceware.org \
--cc=tromey@adacore.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).