From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7083 invoked by alias); 19 Feb 2013 18:25:44 -0000 Received: (qmail 6967 invoked by uid 22791); 19 Feb 2013 18:25:40 -0000 X-SWARE-Spam-Status: No, hits=-8.0 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_SPAMHAUS_DROP,KHOP_THREADED,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,RP_MATCHES_RCVD,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 19 Feb 2013 18:25:34 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r1JIPXg6004163 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 19 Feb 2013 13:25:33 -0500 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r1JIPVn6024885; Tue, 19 Feb 2013 13:25:32 -0500 Message-ID: <5123C39B.3030009@redhat.com> Date: Tue, 19 Feb 2013 18:25:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130110 Thunderbird/17.0.2 MIME-Version: 1.0 To: Kai Tietz CC: gdb-patches@sourceware.org Subject: Re: [patch gdb]: Fix PR gdb/15161 part 1 of 3 References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2013-02/txt/msg00512.txt.bz2 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 > > 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