Procházet zdrojové kódy

* use DW_OP_reg0..DW_OP_reg31 instead of DW_OP_regx in TDebugInfoDwarf.append_seg_reg
in case the dwarf register number is 31 or smaller

git-svn-id: trunk@39131 -

nickysn před 7 roky
rodič
revize
052da5c921
1 změnil soubory, kde provedl 11 přidání a 3 odebrání
  1. 11 3
      compiler/dbgdwarf.pas

+ 11 - 3
compiler/dbgdwarf.pas

@@ -1425,9 +1425,17 @@ implementation
       begin
       begin
         dreg:=dwarf_reg(segment_register);
         dreg:=dwarf_reg(segment_register);
         templist:=TAsmList.create;
         templist:=TAsmList.create;
-        templist.concat(tai_const.create_8bit(ord(DW_OP_regx)));
-        templist.concat(tai_const.create_uleb128bit(dreg));
-        blocksize:=1+Lengthuleb128(dreg);
+        if dreg<=31 then
+          begin
+            templist.concat(tai_const.create_8bit(ord(DW_OP_reg0)+dreg));
+            blocksize:=1;
+          end
+        else
+          begin
+            templist.concat(tai_const.create_8bit(ord(DW_OP_regx)));
+            templist.concat(tai_const.create_uleb128bit(dreg));
+            blocksize:=1+Lengthuleb128(dreg);
+          end;
         append_block1(DW_AT_segment,blocksize);
         append_block1(DW_AT_segment,blocksize);
         current_asmdata.asmlists[al_dwarf_info].concatlist(templist);
         current_asmdata.asmlists[al_dwarf_info].concatlist(templist);
         templist.free;
         templist.free;