瀏覽代碼

* 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 7 年之前
父節點
當前提交
052da5c921
共有 1 個文件被更改,包括 11 次插入3 次删除
  1. 11 3
      compiler/dbgdwarf.pas

+ 11 - 3
compiler/dbgdwarf.pas

@@ -1425,9 +1425,17 @@ implementation
       begin
         dreg:=dwarf_reg(segment_register);
         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);
         current_asmdata.asmlists[al_dwarf_info].concatlist(templist);
         templist.free;