From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16513 invoked by alias); 24 Jul 2014 01:34:07 -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 16503 invoked by uid 89); 24 Jul 2014 01:34:06 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Thu, 24 Jul 2014 01:34:05 +0000 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s6O1Y29R005239 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 23 Jul 2014 21:34:02 -0400 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s6O1Y00v004526; Wed, 23 Jul 2014 21:34:01 -0400 Message-ID: <53D06287.9050505@redhat.com> Date: Thu, 24 Jul 2014 01:35:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: Pierre Langlois , gdb-patches@sourceware.org Subject: Re: [PATCH] Add support for the __flash qualifier on AVR References: <1404816844-1639-1-git-send-email-pierre.langlois@embecosm.com> <53CD357E.50708@redhat.com> <53CFE83F.7030002@embecosm.com> In-Reply-To: <53CFE83F.7030002@embecosm.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-SW-Source: 2014-07/txt/msg00601.txt.bz2 On 07/23/2014 05:52 PM, Pierre Langlois wrote: > Hi Pedro, > > On 21/07/14 16:45, Pedro Alves wrote: >> Hi Pierre, >> >> On 07/08/2014 11:54 AM, Pierre Langlois wrote: >>> The __flash qualifier is part of the named address spaces for AVR [1]. It allows >>> putting read-only data in the flash memory, normally reserved for code. >>> >>> When used together with a pointer, the DW_AT_address_class attribute is set to 1 >>> and allows GDB to detect that when it will be dereferenced, the data will be >>> loaded from the flash memory (with the LPM instruction). >>> >> >> Thanks. This looks good to me, with a couple nits pointed out >> below addressed. >> > > Thanks for looking at this. I have committed a better version of this patch > last week after review. So I just submitted another patch improving the > comments as suggested. > Whoops, I completely missed that. Sorry about that. > Yes you're right, I mentioned the $pc register because of its type. I > understand it's confusing now. > >> >>> /* Is it a code address? */ >>> - if (TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_FUNC >>> - || TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_METHOD >>> - || TYPE_CODE_SPACE (TYPE_TARGET_TYPE (type))) >>> + else if (TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_FUNC >>> + || TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_METHOD >>> + || TYPE_CODE_SPACE (TYPE_TARGET_TYPE (type))) >> >> Particularly since this bit didn't get that comment? >> >> BTW, interesting/curious that TYPE_CODE_SPACE is handled >> here but not in avr_address_to_pointer. Offhand, looks like a >> bug, though off topic for this patch. >> > > I am bit puzzled here but I suspect this was done on purpose. I'll submit a > patch so we can discuss it. > Thanks! -- Thanks, Pedro Alves