This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: crash/regression with ia64 targets
- From: Joel Brobecker <brobecker at adacore dot com>
- To: Yao Qi <yao at codesourcery dot com>
- Cc: Pedro Alves <alves dot ped at gmail dot com>, gdb-patches at sourceware dot org
- Date: Fri, 14 Dec 2012 19:32:43 +0400
- Subject: Re: crash/regression with ia64 targets
- References: <1353404184-22073-1-git-send-email-yao@codesourcery.com> <50AFD573.1090601@gmail.com> <50B0ABF9.1080606@codesourcery.com> <20121213120528.GA19986@adacore.com> <50C9E23B.7010504@codesourcery.com>
> 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