mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-19 03:09:15 +02:00
* generate advance_loc records only if there was code/data since the last advance_loc entry
git-svn-id: trunk@48686 -
This commit is contained in:
parent
09d6398942
commit
436a0d3f9e
@ -542,9 +542,26 @@ implementation
|
|||||||
procedure TDwarfAsmCFILowLevel.cfa_advance_loc(list:TAsmList);
|
procedure TDwarfAsmCFILowLevel.cfa_advance_loc(list:TAsmList);
|
||||||
var
|
var
|
||||||
currloclabel : tasmlabel;
|
currloclabel : tasmlabel;
|
||||||
|
hp : tai;
|
||||||
begin
|
begin
|
||||||
if FLastloclabel=nil then
|
if FLastloclabel=nil then
|
||||||
internalerror(200404082);
|
internalerror(200404082);
|
||||||
|
{ search the list backwards and check if we really need an advance loc,
|
||||||
|
i.e. if real code/data has been generated since the last cfa_advance_loc
|
||||||
|
call
|
||||||
|
}
|
||||||
|
hp:=tai(list.Last);
|
||||||
|
while assigned(hp) do
|
||||||
|
begin
|
||||||
|
{ if we encounter FLastloclabel without encountering code/data, see check below,
|
||||||
|
we do not need insert an advance_loc entry }
|
||||||
|
if (hp.typ=ait_label) and (tai_label(hp).labsym=FLastloclabel) then
|
||||||
|
exit;
|
||||||
|
{ stop if we find any tai which results in code or data }
|
||||||
|
if not(hp.typ in ([ait_label]+SkipInstr)) then
|
||||||
|
break;
|
||||||
|
hp:=tai(hp.Previous);
|
||||||
|
end;
|
||||||
current_asmdata.getlabel(currloclabel,alt_dbgframe);
|
current_asmdata.getlabel(currloclabel,alt_dbgframe);
|
||||||
list.concat(tai_label.create(currloclabel));
|
list.concat(tai_label.create(currloclabel));
|
||||||
DwarfList.concat(tdwarfitem.create_reloffset(DW_CFA_advance_loc4,doe_32bit,FLastloclabel,currloclabel));
|
DwarfList.concat(tdwarfitem.create_reloffset(DW_CFA_advance_loc4,doe_32bit,FLastloclabel,currloclabel));
|
||||||
|
Loading…
Reference in New Issue
Block a user