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: crash/regression with ia64 targets


> How about add an assert in init_entry_point_info?
> 
>   gdb_assert (objfile->section_offsets != NULL);

I forgot about this one when I sent my patch. We could
add one separately. But it feels a little strange to put it
there, because it's not obvious why. If anything, I feel
it should be right next to where the access is made, which
might be a little difficult, given that it's in a macro and
not a function.

> >+      int num_sections = bfd_count_sections (objfile->obfd);
> >+      size_t size = SIZEOF_N_SECTION_OFFSETS (num_offsets);
> >+
> >+      objfile->num_sections = num_sections;
> 
> Can we use 'num_offsets' here, because I see these two lines in some
> lines below here,
> 
>       /* Just copy in the offset table directly as given to us.  */
>       objfile->num_sections = num_offsets;

I do not think so. The lines you quote take into the fact that
the function was passed a valid num_offsets.  But this is not
always the case: You can pass a section_addr_info insted, or
even nothing.

-- 
Joel


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