From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 99438 invoked by alias); 27 Jun 2018 02:01:32 -0000 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 Received: (qmail 98934 invoked by uid 89); 27 Jun 2018 02:01:30 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 spammy=H*f:sk:1530045, H*i:sk:1530045, HContent-Transfer-Encoding:8bit 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; Wed, 27 Jun 2018 02:01:28 +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 w5R21MoG004467 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 26 Jun 2018 22:01:26 -0400 Received: by simark.ca (Postfix, from userid 112) id 085291EF29; Tue, 26 Jun 2018 22:01:22 -0400 (EDT) Received: from simark.ca (localhost [127.0.0.1]) by simark.ca (Postfix) with ESMTP id 26B371E003; Tue, 26 Jun 2018 22:01:20 -0400 (EDT) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Date: Wed, 27 Jun 2018 02:01:00 -0000 From: Simon Marchi To: Christo Cc: gdb@sourceware.org Subject: Re: AVR - invalid address used when evaluating a variable In-Reply-To: <1530045135.6272.16.camel@gmail.com> References: <1529868512.24104.26.camel@gmail.com> <9371449a502b565344361885fd86c980@polymtl.ca> <1530045135.6272.16.camel@gmail.com> Message-ID: <72704ba7eefa2c224afcbbb4e427cee5@polymtl.ca> X-Sender: simon.marchi@polymtl.ca User-Agent: Roundcube Webmail/1.3.6 X-IsSubscribed: yes X-SW-Source: 2018-06/txt/msg00013.txt.bz2 On 2018-06-26 16:32, Christo wrote: > I have also tested an equivalent C program compiled with avr-gcc, with > gdb reading the correct > SRAM address for the value of i.  This makes me wonder if the symbol > information generated by > Freepascal is correct? Looking quickly, that's what I see. The variable "i" in your program is described as: <1>: Abbrev Number: 3 (DW_TAG_variable) DW_AT_name : i DW_AT_location : 3 byte block: 3 60 0 (DW_OP_addr: 60) In my C test program (compiled with -gdwarf-4), a global variable appears as: <1><5e0>: Abbrev Number: 11 (DW_TAG_variable) <5e1> DW_AT_name : foo ... <5ec> DW_AT_location : 5 byte block: 3 60 0 80 0 (DW_OP_addr: 800060) So I guess Freepascal should do the same, map data addresses at 0x800000. Simon