* improved comments

* tried to make code more robust

git-svn-id: trunk@33231 -
This commit is contained in:
florian 2016-03-13 12:28:26 +00:00
parent acd956f7c3
commit 8a2917639b

View File

@ -847,13 +847,16 @@ procedure ReadAbbrevTable;
Abbrev_Offsets[nr]:=Pos; Abbrev_Offsets[nr]:=Pos;
{ skip tag } { read tag }
tag:=ReadULEB128; tag:=ReadULEB128;
Abbrev_Tags[nr]:=tag; Abbrev_Tags[nr]:=tag;
DEBUG_WRITELN('Abbrev ',nr,' at offset ',Pos,' has tag $',hexstr(tag,4)); DEBUG_WRITELN('Abbrev ',nr,' at offset ',Pos,' has tag $',hexstr(tag,4));
{ children } { read flag for children }
Abbrev_Children[nr]:=ReadNext; Abbrev_Children[nr]:=ReadNext;
i:=0; i:=0;
{ ensure that length(Abbrev_Attrs)=0 if an entry is overwritten (not sure if this will ever happen) and
the new entry has no attributes }
Abbrev_Attrs[nr]:=nil;
repeat repeat
attr:=ReadULEB128; attr:=ReadULEB128;
form:=ReadULEB128; form:=ReadULEB128;
@ -982,6 +985,7 @@ begin
DEBUG_WRITELN('Next abbrev: ',abbrev); DEBUG_WRITELN('Next abbrev: ',abbrev);
if Abbrev_Children[abbrev]<>0 then if Abbrev_Children[abbrev]<>0 then
inc(level); inc(level);
{ DW_TAG_subprogram? }
if Abbrev_Tags[abbrev]=$2e then if Abbrev_Tags[abbrev]=$2e then
begin begin
low_pc:=1; low_pc:=1;
@ -1026,6 +1030,7 @@ begin
SkipAttr(Abbrev_Attrs[abbrev][i].form); SkipAttr(Abbrev_Attrs[abbrev][i].form);
end; end;
abbrev:=ReadULEB128; abbrev:=ReadULEB128;
{ skip entries signaling that no more child entries are following }
while (level>0) and (abbrev=0) do while (level>0) and (abbrev=0) do
begin begin
dec(level); dec(level);