* fix writing procedure local type defs

* write type names once for types defined in the current compiled unit

git-svn-id: trunk@10541 -
This commit is contained in:
peter 2008-03-23 13:40:41 +00:00
parent 7ef191021f
commit 741b5a1df7
2 changed files with 19 additions and 23 deletions

View File

@ -257,6 +257,12 @@ implementation
appenddef_object(list,tobjectdef(def));
undefineddef :
appenddef_undefined(list,tundefineddef(def));
procdef :
begin
{ procdefs are already written in a separate step. procdef
support in appenddef is only needed for beforeappenddef to
write all local type defs }
end;
else
internalerror(200601281);
end;

View File

@ -466,31 +466,11 @@ implementation
appenddef(TAsmList(arg),tfieldvarsym(p).vardef);
end;
{
procedure TDebugInfoStabs.method_write_defs(p:TObject;arg:pointer);
var
i : longint;
pd : tprocdef;
begin
if tsym(p).typ<>procsym then
exit;
for i:=0 to tprocsym(p).ProcdefList.Count-1 do
begin
pd:=tprocdef(tprocsym(p).ProcdefList[i]);
insertdef(TAsmList(arg),pd.returndef);
if (po_virtualmethod in pd.procoptions) then
insertdef(TAsmList(arg),pd._class);
if assigned(pd.parast) then
write_symtable_defs(TAsmList(arg),pd.parast);
if assigned(pd.localst) then
write_symtable_defs(TAsmList(arg),pd.localst);
end;
end;
}
procedure TDebugInfoStabs.write_def_stabstr(list:TAsmList;def:tdef;const ss:ansistring);
var
stabchar : string[2];
symname : string[20];
st : ansistring;
p : pchar;
begin
@ -499,12 +479,19 @@ implementation
stabchar := 'Tt'
else
stabchar := 't';
{ Type names for types defined in the current unit are already written in
the typesym }
if (def.owner.symtabletype=globalsymtable) and
not(def.owner.iscurrentunit) then
symname:='${sym_name}'
else
symname:='';
{ Here we maybe generate a type, so we have to use numberstring }
if is_class(def) and
tobjectdef(def).writing_class_record_dbginfo then
st:=def_stabstr_evaluate(def,'"${sym_name}:$1$2=',[stabchar,def_stab_classnumber(tobjectdef(def))])
st:=def_stabstr_evaluate(def,'"'+symname+':$1$2=',[stabchar,def_stab_classnumber(tobjectdef(def))])
else
st:=def_stabstr_evaluate(def,'"${sym_name}:$1$2=',[stabchar,def_stab_number(def)]);
st:=def_stabstr_evaluate(def,'"'+symname+':$1$2=',[stabchar,def_stab_number(def)]);
st:=st+ss;
{ line info is set to 0 for all defs, because the def can be in an other
unit and then the linenumber is invalid in the current sourcefile }
@ -957,6 +944,9 @@ implementation
if not assigned(def.procstarttai) then
exit;
{ mark as used so the local type defs also be written }
def.dbg_state:=dbg_state_used;
templist:=TAsmList.create;
{ end of procedure }