Example #1
0
        public DwarfAbbrev CreateAbbrev(DwarfTag tag, ICollection <DwarfAbbrevAttribute> attributes, ICollection <DwarfAbbrev> children = null)
        {
            var abbr = new DwarfAbbrev
            {
                Number     = GetNewTagNumber(),
                Tag        = tag,
                Attributes = attributes,
                Children   = children
            };

            AbbrevList.Add(abbr);
            return(abbr);
        }
Example #2
0
        private void EmitDebugAbbrev(EndianAwareBinaryWriter wr, DwarfAbbrev abbr)
        {
            wr.WriteULEB128(abbr.Number);
            wr.WriteULEB128((uint)abbr.Tag);
            wr.WriteByte(abbr.HasChildren ? DwarfConstants.DW_CHILDREN_yes : DwarfConstants.DW_CHILDREN_no);
            foreach (var attr in abbr.Attributes)
            {
                wr.WriteULEB128((uint)attr.Attribute);
                wr.WriteULEB128((uint)attr.Form);
            }
            wr.WriteULEB128(DwarfConstants.NullAttributeName);
            wr.WriteULEB128(DwarfConstants.NullAttributeValue);

            if (abbr.HasChildren)
            {
                foreach (var child in abbr.Children)
                {
                    EmitDebugAbbrev(wr, child);
                }
            }
        }