Browse Source

* Do not write access-info for properties referencing class-fields. Because
class-fields do not have debug-info yet.

Joost van der Sluis 3 years ago
parent
commit
2812915d4f
2 changed files with 24 additions and 1 deletions
  1. 5 1
      compiler/dbgdwarf.pas
  2. 19 0
      tests/test/tdwarfproperties2.pp

+ 5 - 1
compiler/dbgdwarf.pas

@@ -2971,7 +2971,11 @@ implementation
               end;
           end
         // Note that the returned 'dwarfoffset' is not used and not a dwarf-offset
-        else if get_symlist_sym_offset(accesslist.firstsym, membersym, dwarfoffset) then
+        else if get_symlist_sym_offset(accesslist.firstsym, membersym, dwarfoffset) and
+        // Debuginfo for static members is not written
+        // It is not possible to reference something that is not there, so
+        // omit te reference.
+                not (sp_static in membersym.symoptions) then
           begin
             memberowner := membersym.owner;
             if (membersym.typ <> fieldvarsym) then

+ 19 - 0
tests/test/tdwarfproperties2.pp

@@ -0,0 +1,19 @@
+{ %OPT=-gw -godwarfproperties }
+program tdwarfproperties2;
+
+{$mode objfpc}{$H+}
+
+type
+  TClassProp=class(TObject)
+  private
+    class var FProcessorCount: LongWord;
+  public
+    class property ProcessorCount: LongWord read FProcessorCount;
+  end;
+
+var
+  P: TClassProp;
+
+begin
+end.
+