public CompilationUnit(DwarfReader dwarf, DwarfBinaryReader reader)
{
this.dwarf = dwarf;
real_start_offset = reader.Position;
unit_length = reader.ReadInitialLength ();
start_offset = reader.Position;
version = reader.ReadInt16 ();
abbrev_offset = reader.ReadOffset ();
address_size = reader.ReadByte ();
if (version < 2)
throw new DwarfException (
dwarf.bfd, "Wrong DWARF version: {0}",
version);
abbrevs = new Hashtable ();
types = new Hashtable ();
subprogs = new Hashtable ();
namespaces = new Dictionary<long,DieNamespace> ();
DwarfBinaryReader abbrev_reader = dwarf.DebugAbbrevReader;
abbrev_reader.Position = abbrev_offset;
while (abbrev_reader.PeekByte () != 0) {
AbbrevEntry entry = new AbbrevEntry (dwarf, abbrev_reader);
abbrevs.Add (entry.ID, entry);
}
comp_unit_die = Die.CreateDieCompileUnit (reader, this);
reader.Position = start_offset + unit_length;
}