Add some more debug information to temp-generation when compiled with -dEXTDEBUG

git-svn-id: trunk@39141 -
This commit is contained in:
pierre 2018-05-28 22:39:21 +00:00
parent 0673f181bb
commit b1537a7f40

View File

@ -216,6 +216,9 @@ implementation
firsttemp:=0; firsttemp:=0;
lasttemp:=0; lasttemp:=0;
alignmismatch:=0; alignmismatch:=0;
{$ifdef EXTDEBUG}
Comment(V_Note,'tgobj: (ResetTempGen) all temps freed');
{$endif}
end; end;
@ -231,6 +234,9 @@ implementation
internalerror(200204221); internalerror(200204221);
firsttemp:=l; firsttemp:=l;
lasttemp:=l; lasttemp:=l;
{$ifdef EXTDEBUG}
Comment(V_Note,'tgobj: (SetFirstTempGen) set to '+tostr(l));
{$endif}
end; end;
@ -280,7 +286,7 @@ implementation
begin begin
{$ifdef EXTDEBUG} {$ifdef EXTDEBUG}
if not(hp^.temptype in FreeTempTypes) then if not(hp^.temptype in FreeTempTypes) then
Comment(V_Warning,'tgobj: (AllocTemp) temp at pos '+tostr(hp^.pos)+ ' in freelist is not set to tt_free !'); Comment(V_Warning,'tgobj: (AllocTemp) temp at pos '+tostr(hp^.pos)+ ' in freelist is not set to a free temp type !');
{$endif} {$endif}
{ Check only slots that are { Check only slots that are
- free - free
@ -430,6 +436,9 @@ implementation
CGMessage(cg_e_localsize_too_big); CGMessage(cg_e_localsize_too_big);
lasttemp:=tl^.pos+size; lasttemp:=tl^.pos+size;
end; end;
{$ifdef EXTDEBUG}
Comment(V_Note,'tgobj: (AllocTemp) lasttemp set to '+tostr(lasttemp));
{$endif}
{$pop} {$pop}
tl^.fini:=fini; tl^.fini:=fini;
tl^.alignment:=alignment; tl^.alignment:=alignment;
@ -444,6 +453,7 @@ implementation
list.concat(tai_tempalloc.allocinfo(tl^.pos,tl^.size,'allocated with type '+TempTypeStr[tl^.temptype]+' for def '+tl^.def.typename)) list.concat(tai_tempalloc.allocinfo(tl^.pos,tl^.size,'allocated with type '+TempTypeStr[tl^.temptype]+' for def '+tl^.def.typename))
else else
list.concat(tai_tempalloc.allocinfo(tl^.pos,tl^.size,'allocated with type '+TempTypeStr[tl^.temptype])); list.concat(tai_tempalloc.allocinfo(tl^.pos,tl^.size,'allocated with type '+TempTypeStr[tl^.temptype]));
Comment(V_Note,'tgobj: (AllocTemp) temp of size '+tostr(size)+' type '+TempTypeStr[tl^.temptype]+' requested, allocated at offset '+tostr(tl^.pos));
{$else} {$else}
list.concat(tai_tempalloc.alloc(tl^.pos,tl^.size)); list.concat(tai_tempalloc.alloc(tl^.pos,tl^.size));
{$endif} {$endif}
@ -458,6 +468,9 @@ implementation
hp:=templist; hp:=templist;
hprev:=nil; hprev:=nil;
hprevfree:=nil; hprevfree:=nil;
{$ifdef EXTDEBUG}
Comment(V_Note,'tgobj: (FreeTemp) freeing of temp at pos '+tostr(pos.val)+' requested');
{$endif}
while assigned(hp) do while assigned(hp) do
begin begin
if (hp^.pos=pos.val) then if (hp^.pos=pos.val) then
@ -475,7 +488,7 @@ implementation
if not(hp^.temptype in temptypes) then if not(hp^.temptype in temptypes) then
begin begin
{$ifdef EXTDEBUG} {$ifdef EXTDEBUG}
Comment(V_Debug,'tgobj: (Freetemp) temp at pos '+tostr(pos.val)+ ' has different type ('+TempTypeStr[hp^.temptype]+'), not releasing'); Comment(V_Warning,'tgobj: (Freetemp) temp at pos '+tostr(pos.val)+ ' has different type ('+TempTypeStr[hp^.temptype]+'), not releasing');
list.concat(tai_tempalloc.allocinfo(hp^.pos,hp^.size,'temp has wrong type ('+TempTypeStr[hp^.temptype]+') not releasing')); list.concat(tai_tempalloc.allocinfo(hp^.pos,hp^.size,'temp has wrong type ('+TempTypeStr[hp^.temptype]+') not releasing'));
{$endif} {$endif}
exit; exit;