From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 120986 invoked by alias); 27 Sep 2018 17:53:47 -0000 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 Received: (qmail 120971 invoked by uid 89); 27 Sep 2018 17:53:46 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,KAM_SHORT,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:1494 X-HELO: smtp.polymtl.ca Received: from smtp.polymtl.ca (HELO smtp.polymtl.ca) (132.207.4.11) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 27 Sep 2018 17:53:44 +0000 Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id w8RHrbdh005457 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 27 Sep 2018 13:53:42 -0400 Received: by simark.ca (Postfix, from userid 112) id E21051E76F; Thu, 27 Sep 2018 13:53:37 -0400 (EDT) Received: from simark.ca (localhost [127.0.0.1]) by simark.ca (Postfix) with ESMTP id 1972A1E021; Thu, 27 Sep 2018 13:53:35 -0400 (EDT) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Thu, 27 Sep 2018 17:53:00 -0000 From: Simon Marchi To: John Darrington Cc: Tom Tromey , gdb-patches@sourceware.org Subject: Re: [PATCH 2/4] Add a dwarf unit type to represent 24 bit values. In-Reply-To: <20180927054924.e5hgaw4dwdkjezv3@jocasta.intra> References: <20180829141845.26378-1-john@darrington.wattle.id.au> <20180829141845.26378-3-john@darrington.wattle.id.au> <878t4dvuyf.fsf@tromey.com> <20180926174157.mw5eocxlfmgliua7@jocasta.intra> <20180927054924.e5hgaw4dwdkjezv3@jocasta.intra> Message-ID: X-Sender: simon.marchi@polymtl.ca User-Agent: Roundcube Webmail/1.3.6 X-IsSubscribed: yes X-SW-Source: 2018-09/txt/msg00874.txt.bz2 On 2018-09-27 01:49, John Darrington wrote: > On Wed, Sep 26, 2018 at 10:53:34PM -0400, Simon Marchi wrote: > On 2018-09-26 13:41, John Darrington wrote: > > After discussion with the gcc folks, it seems that there is an > easier > > and much simpler solution, which I'm attaching. > > > > J' > > Err can you explain how this works, or link to the gcc discussion > if it's > explained there? I must be missing something, because as far as I > understand, this will read 4 bytes when reading an address, when I > suppose it's encoded with 3 bytes in the DWARF info, isn't it? > > Simon > > The relevant discussion is here: > https://gcc.gnu.org/ml/gcc-patches/2018-09/msg00712.html > > The bottom line is that the dwarf address size does not need to > correspond to the machine address size (and in general it does not) - > it just needs to be at least as long. After a short discussion with John on IRC, what I understand is that the debug info he is dealing with encodes the 24-bit addresses on 32-bits, with the most significant byte equal to zero. Therefore that revised patch looks ok to me. I would just ask you to add a comment explaining that this "case" exists for producer XYZ on S12Z, which encodes 24 bit addresses on 32 bits. Maybe that in the future somebody will stumble on a producer that encodes 24 bit addresses on 24 bits. Having an explanation for why things are the way they are will help. Thanks, Simon