Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: Kai Tietz <ktietz70@googlemail.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [patch gdb]: Fix PR gdb/15161 part 1 of 3
Date: Tue, 19 Feb 2013 18:25:00 -0000	[thread overview]
Message-ID: <5123C39B.3030009@redhat.com> (raw)
In-Reply-To: <CAEwic4YmG-kxmOvAPLL5hZcjuNYGrs=PbU8Pr-QgAbQPj6c9VQ@mail.gmail.com>

On 02/19/2013 05:18 PM, Kai Tietz wrote:
> Hi,
> 
> this patch fixes part one of the PR gdb/15161 issue in symfile.c.
> 
> ChangeLog
> 
> 2013-02-19  Kai Tietz  <ktietz@redhat.com>
> 
> 	PR gdb/15161
> 	* symfile.c (load_section_data): Change type of load_offset
> 	to CORE_ADDR.
> 	(generic_load): User strtoulst instead of strtoul for evalute of
> 	load_offset.

Typo "evalute".  You mean "evaluation"?  FWIW, I think "conversion" is
more to the point, as strtol is documented to "convert a string to ...".

>  /* Opaque data for load_section_callback.  */
>  struct load_section_data {
> -  unsigned long load_offset;
> +  CORE_ADDR load_offset;
>    struct load_progress_data *progress_data;
>    VEC(memory_write_request_s) *requests;
>  };
...
> -      cbdata.load_offset = strtoul (argv[1], &endptr, 0);
> +      cbdata.load_offset = (CORE_ADDR) strtoulst (argv[1], &endptr, 0);

Was the cast really necessary?  If ever CORE_ADDR and ULONGEST have
different widths in a way this would cause a warning/error, then
it'd be better to not have that bug masked with a cast.

So OK without the cast.

Thanks.

-- 
Pedro Alves


      reply	other threads:[~2013-02-19 18:25 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-19 17:18 Kai Tietz
2013-02-19 18:25 ` Pedro Alves [this message]

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=5123C39B.3030009@redhat.com \
    --to=palves@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=ktietz70@googlemail.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