Explorar o código

* problem with virtual methods and interfaces fixed, fixes #8158

git-svn-id: trunk@6099 -
florian %!s(int64=18) %!d(string=hai) anos
pai
achega
eda8184e21
Modificáronse 2 ficheiros con 11 adicións e 0 borrados
  1. 2 0
      compiler/dbgbase.pas
  2. 9 0
      compiler/dbgstabs.pas

+ 2 - 0
compiler/dbgbase.pas

@@ -123,6 +123,8 @@ implementation
           begin
           begin
             pd:=tprocdef(tprocsym(p).ProcdefList[i]);
             pd:=tprocdef(tprocsym(p).ProcdefList[i]);
             insertdef(TAsmList(arg),pd.returndef);
             insertdef(TAsmList(arg),pd.returndef);
+            if (po_virtualmethod in pd.procoptions) then
+              insertdef(TAsmList(arg),pd._class);
           end;
           end;
       end;
       end;
 
 

+ 9 - 0
compiler/dbgstabs.pas

@@ -249,10 +249,12 @@ implementation
           so they won't be written implicitly }
           so they won't be written implicitly }
         if (def.typ=procdef) then
         if (def.typ=procdef) then
           def.dbg_state:=dbg_state_written;
           def.dbg_state:=dbg_state_written;
+
         { Stab must already be written, or we must be busy writing it }
         { Stab must already be written, or we must be busy writing it }
         if writing_def_stabs and
         if writing_def_stabs and
            not(def.dbg_state in [dbg_state_writing,dbg_state_written]) then
            not(def.dbg_state in [dbg_state_writing,dbg_state_written]) then
           internalerror(200403091);
           internalerror(200403091);
+
         { Keep track of used stabs, this info is only usefull for stabs
         { Keep track of used stabs, this info is only usefull for stabs
           referenced by the symbols. Definitions will always include all
           referenced by the symbols. Definitions will always include all
           required stabs }
           required stabs }
@@ -798,6 +800,7 @@ implementation
       var
       var
         anc : tobjectdef;
         anc : tobjectdef;
         oldtypesym : tsym;
         oldtypesym : tsym;
+        i : longint;
       begin
       begin
         if (def.dbg_state in [dbg_state_writing,dbg_state_written]) then
         if (def.dbg_state in [dbg_state_writing,dbg_state_written]) then
           exit;
           exit;
@@ -854,12 +857,18 @@ implementation
           objectdef :
           objectdef :
             begin
             begin
               insertdef(list,vmtarraytype);
               insertdef(list,vmtarraytype);
+              if assigned(tobjectdef(def).ImplementedInterfaces) then
+                for i:=0 to tobjectdef(def).ImplementedInterfaces.Count-1 do
+                  insertdef(list,TImplementedInterface(tobjectdef(def).ImplementedInterfaces[i]).IntfDef);
               { first the parents }
               { first the parents }
               anc:=tobjectdef(def);
               anc:=tobjectdef(def);
               while assigned(anc.childof) do
               while assigned(anc.childof) do
                 begin
                 begin
                   anc:=anc.childof;
                   anc:=anc.childof;
                   insertdef(list,anc);
                   insertdef(list,anc);
+                  if assigned(anc.ImplementedInterfaces) then
+                    for i:=0 to anc.ImplementedInterfaces.Count-1 do
+                      insertdef(list,TImplementedInterface(anc.ImplementedInterfaces[i]).IntfDef);
                 end;
                 end;
               tobjectdef(def).symtable.symList.ForEachCall(@field_write_defs,list);
               tobjectdef(def).symtable.symList.ForEachCall(@field_write_defs,list);
               tobjectdef(def).symtable.symList.ForEachCall(@method_write_defs,list);
               tobjectdef(def).symtable.symList.ForEachCall(@method_write_defs,list);