Browse Source

* insert vmt as hidden field in objectdefs
* don't output hidden fields in the debug info

git-svn-id: trunk@11334 -

Jonas Maebe 17 năm trước cách đây
mục cha
commit
c00108009d
3 tập tin đã thay đổi với 9 bổ sung3 xóa
  1. 1 1
      compiler/dbgdwarf.pas
  2. 2 0
      compiler/dbgstabs.pas
  3. 6 2
      compiler/symdef.pas

+ 1 - 1
compiler/dbgdwarf.pas

@@ -1870,7 +1870,7 @@ implementation
         fieldoffset,
         fieldnatsize: aint;
       begin
-        if sp_static in sym.symoptions then
+        if ([sp_static,sp_hidden] * sym.symoptions <> []) then
           exit;
 
         if (tabstractrecordsymtable(sym.owner).usefieldalignment<>bit_alignment) or

+ 2 - 0
compiler/dbgstabs.pas

@@ -351,6 +351,8 @@ implementation
         newss   : ansistring;
         ss      : pansistring absolute arg;
       begin
+        if (sp_hidden in tsym(p).symoptions) then
+          exit;
         { static variables from objects are like global objects }
         if (Tsym(p).typ=fieldvarsym) and
            not(sp_static in Tsym(p).symoptions) then

+ 6 - 2
compiler/symdef.pas

@@ -3968,6 +3968,8 @@ implementation
 
 
    procedure tobjectdef.insertvmt;
+     var
+       vs: tfieldvarsym;
      begin
         if objecttype in [odt_interfacecom,odt_interfacecorba,odt_dispinterface] then
           exit;
@@ -3986,8 +3988,10 @@ implementation
                end;
 
              vmt_offset:=tObjectSymtable(symtable).datasize;
-             tObjectSymtable(symtable).datasize:=
-               tObjectSymtable(symtable).datasize+sizeof(pint);
+             vs:=tfieldvarsym.create('_vptr$'+objname^,vs_value,voidpointertype,[]);
+             hidesym(vs);
+             tObjectSymtable(symtable).insert(vs);
+             tObjectSymtable(symtable).addfield(vs);
              include(objectoptions,oo_has_vmt);
           end;
      end;