Prechádzať zdrojové kódy

* 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 rokov pred
rodič
commit
c0bdcf62e0
1 zmenil súbory, kde vykonal 7 pridanie a 1 odobranie
  1. 7 1
      compiler/dbgdwarf.pas

+ 7 - 1
compiler/dbgdwarf.pas

@@ -2894,7 +2894,13 @@ implementation
       begin
       begin
         if (sym.typ=paravarsym) and
         if (sym.typ=paravarsym) and
            (vo_is_self in tparavarsym(sym).varoptions) then
            (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'
             result:='this'
           else
           else
             result:='self'
             result:='self'