AVR - invalid address used when evaluating a variable

Simon Marchi simon.marchi@polymtl.ca
Wed Jun 27 02:01:00 GMT 2018


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><ca>: Abbrev Number: 3 (DW_TAG_variable)
     <cb>   DW_AT_name        : i
     <cd>   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



More information about the Gdb mailing list