mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-15 18:19:45 +02:00
* 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:
parent
7ef191021f
commit
741b5a1df7
@ -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;
|
||||
|
@ -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 }
|
||||
|
Loading…
Reference in New Issue
Block a user