Browse Source

Merged revisions 3614 via svnmerge from
http://svn.freepascal.org/svn/fpc/trunk

r3614 (florian)
* fixed stabs generation for static class variables

git-svn-id: branches/fixes_2_0@3615 -

florian 19 năm trước cách đây
mục cha
commit
00cd6f38e5
3 tập tin đã thay đổi với 32 bổ sung0 xóa
  1. 1 0
      .gitattributes
  2. 17 0
      compiler/symsym.pas
  3. 14 0
      tests/webtbs/tw6435.pp

+ 1 - 0
.gitattributes

@@ -6488,6 +6488,7 @@ tests/webtbs/tw4950.pp svneol=native#text/plain
 tests/webtbs/tw4999.pp svneol=native#text/plain
 tests/webtbs/tw5036.pp svneol=native#text/plain
 tests/webtbs/tw5082.pp -text svneol=unset#text/plain
+tests/webtbs/tw6435.pp svneol=native#text/plain
 tests/webtbs/tw6735.pp svneol=native#text/plain
 tests/webtbs/ub1873.pp svneol=native#text/plain
 tests/webtbs/ub1883.pp svneol=native#text/plain

+ 17 - 0
compiler/symsym.pas

@@ -184,6 +184,7 @@ interface
 {$ifdef GDB}
           function stabstring : pchar;override;
 {$endif GDB}
+          function mangledname:string;override;
       end;
 
       tabstractnormalvarsym = class(tabstractvarsym)
@@ -1531,6 +1532,22 @@ implementation
 {$endif GDB}
 
 
+    function tfieldvarsym.mangledname:string;
+      var
+        srsym : tsym;
+        srsymtable : tsymtable;
+      begin
+        if sp_static in symoptions then
+          begin
+            searchsym(lower(owner.name^)+'_'+name,srsym,srsymtable);
+            if assigned(srsym) then
+             result:=tglobalvarsym(srsym).mangledname;
+          end
+        else
+          result:=inherited mangledname;
+      end;
+
+
 {****************************************************************************
                         TABSTRACTNORMALVARSYM
 ****************************************************************************}

+ 14 - 0
tests/webtbs/tw6435.pp

@@ -0,0 +1,14 @@
+{ %OPT=-gl }
+program Project1;
+
+{$mode objfpc}{$H+}{$static on}
+
+type
+  MyClass = class(TObject)
+  private
+    FClassVar: integer; static;
+  end;
+
+begin
+end.
+