public Attribute(DwarfReader dwarf, long offset, DwarfAttribute attr, DwarfForm form) { this.dwarf = dwarf; this.offset = offset; this.attr = attr; this.form = form; }
public AttributeEntry(DwarfReader dwarf, DwarfAttribute attr, DwarfForm form) { this.dwarf = dwarf; this.attr = attr; this.form = form; }
public AbbrevEntry(DwarfReader dwarf, DwarfBinaryReader reader) { abbrev_id = reader.ReadLeb128 (); tag = (DwarfTag) reader.ReadLeb128 (); has_children = reader.ReadByte () != 0; Attributes = new ArrayList (); do { int attr = reader.ReadLeb128 (); int form = reader.ReadLeb128 (); if ((attr == 0) && (form == 0)) break; Attributes.Add (new AttributeEntry ( dwarf, (DwarfAttribute) attr, (DwarfForm) form)); } while (true); }
public DwarfSymbolTable(DwarfReader dwarf, ArrayList ranges) { this.dwarf = dwarf; this.ranges = ranges; this.ranges.Sort (); }
public RangeEntry(DwarfReader dwarf, long offset, TargetAddress address, long size) : base(address, address + size) { this.dwarf = dwarf; this.FileOffset = offset; }
protected Die(DwarfBinaryReader reader, CompilationUnit comp_unit, AbbrevEntry abbrev) { this.comp_unit = comp_unit; this.dwarf = comp_unit.DwarfReader; this.abbrev = abbrev; Offset = reader.Position; ChildrenOffset = Offset + ReadAttributes (reader); reader.Position = ChildrenOffset; debug ("NEW DIE: {0} {1} {2} {3}", GetType (), abbrev, Offset, ChildrenOffset); }
public CompileUnitBlock(DwarfReader dwarf, long start) { this.dwarf = dwarf; this.offset = start; DwarfBinaryReader reader = dwarf.DebugInfoReader; reader.Position = offset; long length_field = reader.ReadInitialLength (); long stop = reader.Position + length_field; length = stop - offset; int version = reader.ReadInt16 (); if (version < 2) throw new DwarfException ( dwarf.bfd, "Wrong DWARF version: {0}", version); reader.ReadOffset (); int address_size = reader.ReadByte (); reader.Position = offset; if ((address_size != 4) && (address_size != 8)) throw new DwarfException ( dwarf.bfd, "Unknown address size: {0}", address_size); compile_units = new ArrayList (); while (reader.Position < stop) { CompilationUnit comp_unit = new CompilationUnit (dwarf, reader); compile_units.Add (comp_unit); } }
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; }
void unload_dwarf() { if (!dwarf_loaded || !has_debugging_info) return; dwarf_loaded = false; dwarf = null; }
void load_dwarf() { if (dwarf_loaded || !has_debugging_info) return; try { dwarf = new DwarfReader (this, module); } catch (Exception ex) { Console.WriteLine ("Cannot read DWARF debugging info from " + "symbol file `{0}': {1}", FileName, ex); has_debugging_info = false; return; } dwarf_loaded = true; if (dwarf != null) has_debugging_info = true; }