Explorar o código

* AVR: fixed TDwarfAsmCFILowLevel.generate_initial_instructions

git-svn-id: trunk@43982 -
(cherry picked from commit 6f434b6751b2fb4f459e5f004086c6ede5436309)
florian %!s(int64=5) %!d(string=hai) anos
pai
achega
fbb3fe56a9
Modificáronse 1 ficheiros con 12 adicións e 2 borrados
  1. 12 2
      compiler/cfidwarf.pas

+ 12 - 2
compiler/cfidwarf.pas

@@ -270,7 +270,7 @@ implementation
       end;
 
 
-{$ifdef i386}
+{$if defined(i386)}
     { if more cpu dependend stuff is implemented, this needs more refactoring }
     procedure TDwarfAsmCFILowLevel.generate_initial_instructions(list:TAsmList);
       begin
@@ -281,7 +281,17 @@ implementation
         list.concat(tai_const.create_uleb128bit(dwarf_reg(NR_RETURN_ADDRESS_REG)));
         list.concat(tai_const.create_uleb128bit((-sizeof(aint)) div data_alignment_factor));
       end;
-{$else i386}
+{$elseif defined(avr)}
+    procedure TDwarfAsmCFILowLevel.generate_initial_instructions(list:TAsmList);
+      begin
+        list.concat(tai_const.create_8bit(DW_CFA_def_cfa));
+        list.concat(tai_const.create_uleb128bit(32));
+        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_uleb128bit((-1) div data_alignment_factor));
+      end;
+{$else}
     { if more cpu dependend stuff is implemented, this needs more refactoring }
     procedure TDwarfAsmCFILowLevel.generate_initial_instructions(list:TAsmList);
       begin