2
0
Эх сурвалжийг харах

* fix for the encoding of dwarf debug info of local variables, whose base is a
register that has a dwarf register number higher than 31

git-svn-id: trunk@39099 -

nickysn 7 жил өмнө
parent
commit
5417eb043d
1 өөрчлөгдсөн 13 нэмэгдсэн , 3 устгасан
  1. 13 3
      compiler/dbgdwarf.pas

+ 13 - 3
compiler/dbgdwarf.pas

@@ -2529,9 +2529,19 @@ implementation
                     if sym.localloc.loc<> LOC_INVALID then
                       begin
                         dreg:=dwarf_reg(sym.localloc.reference.base);
-                        templist.concat(tai_const.create_8bit(ord(DW_OP_breg0)+dreg));
-                        templist.concat(tai_const.create_sleb128bit(sym.localloc.reference.offset+offset));
-                        blocksize:=1+Lengthsleb128(sym.localloc.reference.offset);
+                        if dreg<=31 then
+                          begin
+                            templist.concat(tai_const.create_8bit(ord(DW_OP_breg0)+dreg));
+                            templist.concat(tai_const.create_sleb128bit(sym.localloc.reference.offset+offset));
+                            blocksize:=1+Lengthsleb128(sym.localloc.reference.offset);
+                          end
+                        else
+                          begin
+                            templist.concat(tai_const.create_8bit(ord(DW_OP_bregx)));
+                            templist.concat(tai_const.create_uleb128bit(dreg));
+                            templist.concat(tai_const.create_sleb128bit(sym.localloc.reference.offset));
+                            blocksize:=1+Lengthuleb128(dreg)+LengthSleb128(sym.localloc.reference.offset);
+                          end;
 {$ifndef gdb_supports_DW_AT_variable_parameter}
                         { Parameters which are passed by reference. (var and the like)
                           Hide the reference-pointer and dereference the pointer