From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 412 invoked by alias); 27 Jun 2018 05:33:37 -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 395 invoked by uid 89); 27 Jun 2018 05:33:36 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: =?ISO-8859-1?Q?No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=at, at=c2, HContent-Transfer-Encoding:8bit?= X-HELO: mail-wr0-f174.google.com Received: from mail-wr0-f174.google.com (HELO mail-wr0-f174.google.com) (209.85.128.174) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 27 Jun 2018 05:33:35 +0000 Received: by mail-wr0-f174.google.com with SMTP id b8-v6so619195wro.6 for ; Tue, 26 Jun 2018 22:33:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:subject:from:to:cc:date:in-reply-to:references :mime-version:content-transfer-encoding; bh=VK8VH/KplZk7CIrzOutzq38JwZ9RgiJ+nfrjPAYtAW8=; b=K1YflwW5kTge0uQ9pJ+dsfQkmS54WHjOfw0UkpK72G0Tp21Uw34Cr25NQewhGtw87G kleUNYo66L/q9xSaMi0MRiWzw0Pl6YHdfIJaPHPAQHH8yaRSmUK7YURE1rcFctlWZt4W yWxdhKGjiky+LWW9IpVaJ/dMWBvT5DNvU3W+lo9aDVw3ZjFbj8bzRYYnx3q/QTJZNCWY enIbcItqeQyWLzrAX95HlvEMu4hJiPk9bp63FHhZx2p+WNSoEH8T5BKTdFBPrmbfHmJ1 1PRPC2JvTfWqzSF+HdfdI/+iy8oveJ1mEPlJSkjz6PjqBKWty9HmYgmMphOaiLCG9ZDw gbpw== Return-Path: Received: from [192.168.1.11] ([105.184.225.243]) by smtp.gmail.com with ESMTPSA id a124-v6sm4093256wmf.7.2018.06.26.22.33.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 26 Jun 2018 22:33:33 -0700 (PDT) Message-ID: <1530077609.7468.4.camel@gmail.com> Subject: Re: AVR - invalid address used when evaluating a variable From: Christo To: Simon Marchi Cc: gdb@sourceware.org, christo.crause@gmail.com Date: Wed, 27 Jun 2018 05:33:00 -0000 In-Reply-To: <72704ba7eefa2c224afcbbb4e427cee5@polymtl.ca> References: <1529868512.24104.26.camel@gmail.com> <9371449a502b565344361885fd86c980@polymtl.ca> <1530045135.6272.16.camel@gmail.com> <72704ba7eefa2c224afcbbb4e427cee5@polymtl.ca> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2018-06/txt/msg00014.txt.bz2 On Tue, 2018-06-26 at 22:01 -0400, Simon Marchi wrote: > 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 Simon, Thank you very much for your feedback.  I will take this issue to the Freepascal forum. Best regards, Christo