From ff3372567f16be75ed1762f3fd5b302faa5e12d6 Mon Sep 17 00:00:00 2001 From: Jeppe Johansen Date: Thu, 25 Jul 2019 13:24:10 +0000 Subject: [PATCH] - Applied patch by Christo Crause from #33914 git-svn-id: trunk@42493 - --- compiler/aasmtai.pas | 17 +++++++++++++++++ compiler/dbgdwarf.pas | 16 ++++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/compiler/aasmtai.pas b/compiler/aasmtai.pas index d1b6ac112e..1fc18b0037 100644 --- a/compiler/aasmtai.pas +++ b/compiler/aasmtai.pas @@ -702,6 +702,9 @@ interface constructor Create_int_codeptr_unaligned(_value: int64); constructor Create_int_dataptr(_value: int64); constructor Create_int_dataptr_unaligned(_value: int64); +{$ifdef avr} + constructor Create_int_dataptr_unaligned(_value: int64; size: taiconst_type); +{$endif} {$ifdef i8086} constructor Create_seg_name(const name:string); constructor Create_dgroup; @@ -1962,6 +1965,20 @@ implementation end; +{$ifdef avr} + constructor tai_const.Create_int_dataptr_unaligned(_value: int64; + size: taiconst_type); + begin + inherited Create; + typ:=ait_const; + consttype:=size; + sym:=nil; + endsym:=nil; + symofs:=0; + value:=_value; + end; +{$endif avr} + {$ifdef i8086} constructor tai_const.Create_seg_name(const name:string); begin diff --git a/compiler/dbgdwarf.pas b/compiler/dbgdwarf.pas index 3f8a701659..beeeec9c0f 100644 --- a/compiler/dbgdwarf.pas +++ b/compiler/dbgdwarf.pas @@ -48,6 +48,12 @@ interface DbgBase; type + {$ifdef avr} + // re-map to larger types because of offsets required to distinguish different memory spaces + puint = cardinal; + pint = longint; + {$endif avr} + { Tag names and codes. } tdwarf_tag = (DW_TAG_padding := $00,DW_TAG_array_type := $01, DW_TAG_class_type := $02,DW_TAG_entry_point := $03, @@ -538,6 +544,11 @@ implementation { Implementation-defined range start. } DW_LANG_hi_user = $ffff; + {$ifdef avr} + // More space required to include memory type offset + aitconst_ptr_unaligned = aitconst_32bit_unaligned; + {$endif avr} + type { Names and codes for macro information. } tdwarf_macinfo_record_type = (DW_MACINFO_define := 1,DW_MACINFO_undef := 2, @@ -3142,7 +3153,12 @@ implementation end; *) templist.concat(tai_const.create_8bit(3)); + {$ifdef avr} + // Add $800000 to indicate that the address is in memory space + templist.concat(tai_const.create_int_dataptr_unaligned(sym.addroffset + $800000, aitconst_ptr_unaligned)); + {$else} templist.concat(tai_const.create_int_dataptr_unaligned(sym.addroffset)); + {$endif} blocksize:=1+sizeof(puint); end; toasm :