Browse Source

* don't call the "self" parameter of class methods 'this' in the debug info,
because the 'this' parameter was not used by gdb in that case for anything
anyway, and as of gdb 7.0 you get an error in gdb because the 'this'
parameter is not an aggregate in that case (but rather a pointer to the
vmt) (mantis #15362)

git-svn-id: trunk@14446 -

Jonas Maebe 15 năm trước cách đây
mục cha
commit
c0bdcf62e0
1 tập tin đã thay đổi với 7 bổ sung1 xóa
  1. 7 1
      compiler/dbgdwarf.pas

+ 7 - 1
compiler/dbgdwarf.pas

@@ -2894,7 +2894,13 @@ implementation
       begin
         if (sym.typ=paravarsym) and
            (vo_is_self in tparavarsym(sym).varoptions) then
-          if not is_objc_class_or_protocol(tdef(sym.owner.defowner.owner.defowner)) then
+          { We use 'this' for regular methods because that's what gdb triggers
+            on to automatically search fields. Don't do this for class methods,
+            because search class fields is not supported, and gdb 7.0+ fails
+            in this case because "this" is not a record in that case (it's a
+            pointer to a vmt) }
+          if not is_objc_class_or_protocol(tdef(sym.owner.defowner.owner.defowner)) and
+             not(po_classmethod in tprocdef(sym.owner.defowner).procoptions) then
             result:='this'
           else
             result:='self'