* abbrev section must be re-read for each chunk of debug info, should resolve #29825

git-svn-id: trunk@33233 -
This commit is contained in:
florian 2016-03-13 14:41:56 +00:00
parent 928027a7a4
commit feb15f08b3

View File

@ -969,7 +969,9 @@ procedure SkipAttr(form : QWord);
end;
var
i : PtrUInt;
i : PtrInt;
prev_base,prev_limit : SizeInt;
prev_pos : Int64;
begin
found := false;
@ -1002,6 +1004,19 @@ begin
isdwarf64:=true;
end;
DEBUG_WRITELN('debug_abbrev_offset: ',header64.debug_abbrev_offset);
{ not nice, but we have to read the abbrev section after the start of the debug_info section has been read }
prev_limit:=limit;
prev_base:=base;
prev_pos:=Pos;
Init(Dwarf_Debug_Abbrev_Section_Offset+header64.debug_abbrev_offset,Dwarf_Debug_Abbrev_Section_Size);
ReadAbbrevTable;
{ restore previous reading state and position }
Init(prev_base,prev_limit);
Seek(prev_pos);
abbrev:=ReadULEB128;
level:=0;
while (abbrev <> 0) and (not found) do
@ -1091,9 +1106,6 @@ begin
source, line, found);
end;
Init(Dwarf_Debug_Abbrev_Section_Offset, Dwarf_Debug_Abbrev_Section_Size);
ReadAbbrevTable;
current_offset := Dwarf_Debug_Info_Section_Offset;
end_offset := Dwarf_Debug_Info_Section_Offset + Dwarf_Debug_Info_Section_Size;