From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1499 invoked by alias); 6 Oct 2002 02:56:52 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 1491 invoked from network); 6 Oct 2002 02:56:51 -0000 Received: from unknown (HELO crack.them.org) (65.125.64.184) by sources.redhat.com with SMTP; 6 Oct 2002 02:56:51 -0000 Received: from nevyn.them.org ([66.93.61.169] ident=mail) by crack.them.org with asmtp (Exim 3.12 #1 (Debian)) id 17y2Wq-0002aB-00; Sat, 05 Oct 2002 22:56:28 -0500 Received: from drow by nevyn.them.org with local (Exim 3.35 #1 (Debian)) id 17y1bY-0007GI-00; Sat, 05 Oct 2002 22:57:16 -0400 Date: Sat, 05 Oct 2002 19:56:00 -0000 From: Daniel Jacobowitz To: Klee Dienes Cc: gdb-patches@sources.redhat.com Subject: Re: [PATCH] Use read_memory_unsigned_integer when reading to CORE_ADDR Message-ID: <20021006025716.GA27734@nevyn.them.org> Mail-Followup-To: Klee Dienes , gdb-patches@sources.redhat.com References: <1BE45412-D8D6-11D6-9DA9-00039396EEB8@apple.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1BE45412-D8D6-11D6-9DA9-00039396EEB8@apple.com> User-Agent: Mutt/1.5.1i X-SW-Source: 2002-10/txt/msg00153.txt.bz2 On Sat, Oct 05, 2002 at 10:48:35PM -0400, Klee Dienes wrote: > The following patch converts several instances of read_memory_integer > to read_memory_unsigned_integer. > In all cases except one, the value is being read into a CORE_ADDR, > which will cause sign-extension lossage if read_memory_integer is used > with a 64-bit bfd (the final case is reading into an unsigned int, but > I believe the change is still correct). > > 2002-10-05 Klee Dienes > > * blockframe.c (sigtramp_saved_pc): Use > read_memory_unsigned_integer to read a value destined for a > CORE_ADDR, not read_memory_integer. > * f-valprint.c (f77_get_dynamic_upperbound): Ditto. > (f77_get_dynamic_lowerbound): Ditto. > * symfile.c (simple_read_overlay_region_table): Ditto (this > function is reading to an unsigned int, not a CORE_ADDR, and is > commented out, but I believe reading as unsigned is still > correct). Well, I'm a little concerned about this. MIPS generally wants the result to be sign extended; the MIPS 32-bit ABIs map onto the lowest and highest 2G segments of the 64-bit address space, not the low 4G segment. Isn't there an appropriate function somewhere to read a CORE_ADDR? Answer: Yes, there is, but it has the same problem. You're just extending current practice, so I don't see a problem with your patch. Andrew, is my understanding right? Is there some reason this isn't a problem? -- Daniel Jacobowitz MontaVista Software Debian GNU/Linux Developer