Inheritance: DebuggerMarshalByRefObject
Exemplo n.º 1
0
            public Attribute(DwarfReader dwarf, long offset,
					  DwarfAttribute attr, DwarfForm form)
            {
                this.dwarf = dwarf;
                this.offset = offset;
                this.attr = attr;
                this.form = form;
            }
Exemplo n.º 2
0
 public AttributeEntry(DwarfReader dwarf, DwarfAttribute attr, DwarfForm form)
 {
     this.dwarf = dwarf;
     this.attr = attr;
     this.form = form;
 }
Exemplo n.º 3
0
            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);
            }
Exemplo n.º 4
0
 public DwarfSymbolTable(DwarfReader dwarf, ArrayList ranges)
 {
     this.dwarf = dwarf;
     this.ranges = ranges;
     this.ranges.Sort ();
 }
Exemplo n.º 5
0
            public RangeEntry(DwarfReader dwarf, long offset,
					   TargetAddress address, long size)
                : base(address, address + size)
            {
                this.dwarf = dwarf;
                this.FileOffset = offset;
            }
Exemplo n.º 6
0
            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);
            }
Exemplo n.º 7
0
            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);
                }
            }
Exemplo n.º 8
0
            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;
            }
Exemplo n.º 9
0
        void unload_dwarf()
        {
            if (!dwarf_loaded || !has_debugging_info)
                return;

            dwarf_loaded = false;
            dwarf = null;
        }
Exemplo n.º 10
0
        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;
        }