Browse Source

* improve dwarf cfi on avr

florian 2 years ago
parent
commit
1fc54dd8bb
2 changed files with 7 additions and 2 deletions
  1. 5 2
      compiler/cfidwarf.pas
  2. 2 0
      compiler/dwarfbase.pas

+ 5 - 2
compiler/cfidwarf.pas

@@ -257,7 +257,11 @@ implementation
         FFrameEndLabel:=nil;
         FFrameEndLabel:=nil;
         FLastLocLabel:=nil;
         FLastLocLabel:=nil;
         code_alignment_factor:=1;
         code_alignment_factor:=1;
+{$if defined(avr)}
+        data_alignment_factor:=-1;
+{$else defined(avr)}
         data_alignment_factor:=-4;
         data_alignment_factor:=-4;
+{$endif defined(avr)}
         FDwarfList:=TAsmList.Create;
         FDwarfList:=TAsmList.Create;
       end;
       end;
 
 
@@ -285,8 +289,7 @@ implementation
         list.concat(tai_const.create_8bit(DW_CFA_def_cfa));
         list.concat(tai_const.create_8bit(DW_CFA_def_cfa));
         list.concat(tai_const.create_uleb128bit(32));
         list.concat(tai_const.create_uleb128bit(32));
         list.concat(tai_const.create_uleb128bit(2));
         list.concat(tai_const.create_uleb128bit(2));
-        list.concat(tai_const.create_8bit(DW_CFA_offset_extended));
-        list.concat(tai_const.create_uleb128bit(36));
+        list.concat(tai_const.create_8bit(DW_CFA_offset+36));
         list.concat(tai_const.create_uleb128bit((-1) div data_alignment_factor));
         list.concat(tai_const.create_uleb128bit((-1) div data_alignment_factor));
       end;
       end;
 {$elseif defined(arm)}
 {$elseif defined(arm)}

+ 2 - 0
compiler/dwarfbase.pas

@@ -37,6 +37,8 @@ unit dwarfbase;
       DW_CFA_def_cfa          = $0c;
       DW_CFA_def_cfa          = $0c;
       DW_CFA_def_cfa_register = $0d;
       DW_CFA_def_cfa_register = $0d;
       DW_CFA_def_cfa_offset   = $0e;
       DW_CFA_def_cfa_offset   = $0e;
+      DW_CFA_advance_loc      = $40;
+      DW_CFA_offset           = $80;
       { Own additions }
       { Own additions }
       DW_CFA_start_frame = $f0;
       DW_CFA_start_frame = $f0;
       DW_CFA_end_frame   = $f1;
       DW_CFA_end_frame   = $f1;