This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]