From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4698 invoked by alias); 15 Mar 2006 19:50:30 -0000 Received: (qmail 4690 invoked by uid 22791); 15 Mar 2006 19:50:29 -0000 X-Spam-Check-By: sourceware.org Received: from nevyn.them.org (HELO nevyn.them.org) (66.93.172.17) by sourceware.org (qpsmtpd/0.31.1) with ESMTP; Wed, 15 Mar 2006 19:50:27 +0000 Received: from drow by nevyn.them.org with local (Exim 4.54) id 1FJc0n-0005XR-5n; Wed, 15 Mar 2006 14:50:25 -0500 Date: Wed, 15 Mar 2006 22:34:00 -0000 From: Daniel Jacobowitz To: gdb-patches@sourceware.org, Michael Snyder Subject: Re: RFC: Correct "paddr_t" in gdb_proc_service.h Message-ID: <20060315195025.GA21178@nevyn.them.org> Mail-Followup-To: gdb-patches@sourceware.org, Michael Snyder References: <20060315163650.GA16226@nevyn.them.org> <44186EF1.8070603@redhat.com> <20060315163650.GA16226@nevyn.them.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <44186EF1.8070603@redhat.com> <20060315163650.GA16226@nevyn.them.org> User-Agent: Mutt/1.5.8i X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2006-03/txt/msg00201.txt.bz2 On Wed, Mar 15, 2006 at 11:36:50AM -0500, Daniel Jacobowitz wrote: > - ret = target_write_memory (addr, buf, len); > + ret = target_write_memory ((unsigned long) addr, buf, len); > else > - ret = target_read_memory (addr, buf, len); > + ret = target_read_memory ((unsigned long) addr, buf, len); On Wed, Mar 15, 2006 at 11:45:53AM -0800, Michael Snyder wrote: > Seems ok -- except the cast for target_read_memory > should be (CORE_ADDR) addr, n'est ce pas? Oh, I'm glad you asked :-) No, it shouldn't be, and yes, it should raise a red flag. psaddr_t is defined to void * by glibc. That means that if we cast it directly to a CORE_ADDR, we may get a warning about it being the wrong size, from GCC. Ugh, that means on MIPS for correctness we ought to be sign extending it. I don't know the right way to do that. It didn't affect my testing, because 32-bit user addresses have the high bit clear. Um... I'll have to think about it some more :-( -- Daniel Jacobowitz CodeSourcery