[PATCH 3/3] move the entry point info into the per-bfd object

Pedro Alves palves@redhat.com
Wed Jan 8 13:30:00 GMT 2014


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



More information about the Gdb-patches mailing list