This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 3/3] move the entry point info into the per-bfd object
- From: Pedro Alves <palves at redhat dot com>
- To: Tom Tromey <tromey at redhat dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Wed, 08 Jan 2014 13:30:53 +0000
- Subject: Re: [PATCH 3/3] move the entry point info into the per-bfd object
- Authentication-results: sourceware.org; auth=none
- References: <1389040247-2620-1-git-send-email-tromey at redhat dot com> <1389040247-2620-4-git-send-email-tromey at redhat dot com>
Looks good to me.
> @@ -875,8 +879,8 @@ init_entry_point_info (struct objfile *objfile)
> {
> /* Executable file -- record its entry point so we'll recognize
> the startup file because it contains the entry point. */
> - objfile->ei.entry_point = bfd_get_start_address (objfile->obfd);
> - objfile->ei.entry_point_p = 1;
> + objfile->per_bfd->ei.entry_point = bfd_get_start_address (objfile->obfd);
> + objfile->per_bfd->ei.entry_point_p = 1;
I think this has reached sufficient levels of indirection
that if I were writing this, I'd do:
static void
init_entry_point_info (struct objfile *objfile)
{
+ struct entry_info *ei = &objfile->per_bfd->ei;
and then use ei-> throughout the function instead, like:
if (ei->initialized)
return;
ei->initialized = 1;
...
ei->entry_point = bfd_get_start_address (objfile->obfd);
ei->entry_point_p = 1;
...
etc.
Just a suggestion.
--
Pedro Alves