From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18509 invoked by alias); 18 Feb 2010 05:42:03 -0000 Received: (qmail 18501 invoked by uid 22791); 18 Feb 2010 05:42:02 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 18 Feb 2010 05:41:58 +0000 Received: (qmail 23710 invoked from network); 18 Feb 2010 05:41:56 -0000 Received: from unknown (HELO macbook-2.local) (stan@127.0.0.2) by mail.codesourcery.com with ESMTPA; 18 Feb 2010 05:41:56 -0000 Message-ID: <4B7CD31F.2070006@codesourcery.com> Date: Thu, 18 Feb 2010 05:42:00 -0000 From: Stan Shebs User-Agent: Thunderbird 2.0.0.23 (Macintosh/20090812) MIME-Version: 1.0 To: gdb@sourceware.org Subject: Re: CORE_ADDR representation References: <20100218044416.GA19485@caradoc.them.org> In-Reply-To: <20100218044416.GA19485@caradoc.them.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2010-02/txt/msg00119.txt.bz2 Daniel Jacobowitz wrote: > This comes up again and again, and has at least three times in the > past month with Jan's PIE patches. Is it time for us to have opaque > arithmetic on target addresses? > Urgh. On the plus side, the months of busywork lets us avoid dealing with the brain-strainingly hard problems. :-) > This truncates the high bits. MIPS sign-extends pointers, even > internally in CORE_ADDR, and this results in separate debug info files > for MIPS executables being relocated off to la-la land. Heh, I remember getting hosed that way by a MIPS in 1994... > For instance, should we always internally sign-extend CORE_ADDR? > Always internally zero-extend? Having it vary by target has been a > recurring problem. > I would say to declare that CORE_ADDR is fundamentally 0..memtop, so it should be unsigned and zero-extend. Can unsigned->signed->diddle->unsigned be encapsulated for MIPS only? Stan