From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31929 invoked by alias); 16 Feb 2010 23:24:11 -0000 Received: (qmail 31921 invoked by uid 22791); 16 Feb 2010 23:24:10 -0000 X-SWARE-Spam-Status: No, hits=-6.7 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,SPF_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, 16 Feb 2010 23:24:07 +0000 Received: from int-mx08.intmail.prod.int.phx2.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o1GNO5Rv026694 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 16 Feb 2010 18:24:05 -0500 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx08.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o1GNO5O5005027; Tue, 16 Feb 2010 18:24:05 -0500 Received: from opsy.redhat.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id o1GNO2Tr026076; Tue, 16 Feb 2010 18:24:03 -0500 Received: by opsy.redhat.com (Postfix, from userid 500) id E94ED379956; Tue, 16 Feb 2010 16:24:01 -0700 (MST) From: Tom Tromey To: Jan Kratochvil Cc: gdb-patches@sourceware.org Subject: Re: [patch] bfd/: bfd_elf_bfd_from_remote_memory 32bit &= 0xffffffff References: <20100211115730.GA7358@host0.dyn.jankratochvil.net> <20100211124302.GA8435__38068.0548646071$1265892205$gmane$org@host0.dyn.jankratochvil.net> Reply-To: tromey@redhat.com Date: Tue, 16 Feb 2010 23:24:00 -0000 In-Reply-To: <20100211124302.GA8435__38068.0548646071$1265892205$gmane$org@host0.dyn.jankratochvil.net> (Jan Kratochvil's message of "Thu, 11 Feb 2010 13:43:02 +0100") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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: 2010-02/txt/msg00409.txt.bz2 Jan> +typedef struct Jan> + { Jan> + CORE_ADDR a; Jan> + } Jan> +addr_offset_t; I like this idea. It is slightly less convenient, but also lets us control the operations more tightly. Math on an addr_offset_t would seem to depend on the current target (or address space). This is a little gross ... but still it seems like a decent step. It seems like you could just call the struct CORE_ADDR. I am curious to hear what others think of this. Jan> But as I see now fixing few GDB places to always sign-extend the Jan> displacement CORE_ADDR will permit using the current standard 64bit Jan> math operators even for 32bit inferiors. Maybe I am being fuzzy today, but I don't follow the logic of this statement. Is this just because we don't expect "too much" overflow? Is it impossible for overflow to accumulate in a CORE_ADDR? Tom