Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Joel Brobecker <brobecker@adacore.com>
To: Yao Qi <yao@codesourcery.com>
Cc: Pedro Alves <alves.ped@gmail.com>, gdb-patches@sourceware.org
Subject: Re: crash/regression with ia64 targets
Date: Fri, 14 Dec 2012 15:33:00 -0000	[thread overview]
Message-ID: <20121214153243.GB3654@adacore.com> (raw)
In-Reply-To: <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


  reply	other threads:[~2012-12-14 15:33 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-20  9:36 [PATCH] use gdbarch_addr_bits_remove for entry point address Yao Qi
2012-11-23 19:58 ` Pedro Alves
2012-11-24 11:14   ` Yao Qi
2012-11-26 11:57     ` Pedro Alves
2012-11-27  8:12       ` Yao Qi
2012-12-13 12:05     ` crash/regression with ia64 targets (was: "Re: [PATCH] use gdbarch_addr_bits_remove for entry point address") Joel Brobecker
2012-12-13 14:13       ` crash/regression with ia64 targets Yao Qi
2012-12-14 15:33         ` Joel Brobecker [this message]
2012-12-13 18:36       ` Pedro Alves
2012-12-14 15:14         ` Joel Brobecker
2012-12-15 13:12           ` checked in: " Joel Brobecker
2012-12-14 15:15       ` Tom Tromey
2012-12-14 15:33         ` Joel Brobecker
2012-12-15 13:14           ` Joel Brobecker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20121214153243.GB3654@adacore.com \
    --to=brobecker@adacore.com \
    --cc=alves.ped@gmail.com \
    --cc=gdb-patches@sourceware.org \
    --cc=yao@codesourcery.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox