Class: Dwarves::Parser::DIE
Overview
The basic DWARF descriptive unit, the Debugging Information Entry (DIE).
This is a node in the parse tree that DWARF generates.
These represent types, variables, and functions.
Instance Method Summary collapse
-
#initialize(opts = {}) ⇒ DIE
constructor
A new instance of DIE.
- #to_s ⇒ Object
Constructor Details
#initialize(opts = {}) ⇒ DIE
23 24 25 26 27 28 29 30 31 |
# File 'lib/dwarves/parser/4/ast.rb', line 23 def initialize opts = {} @tag = opts[:tag] @children = opts[:children] || [] @siblings = opts[:siblings] || [] @attributes = opts[:attributes] || [] @address = opts[:address] @depth = opts[:depth] @abbrev_number = opts[:abbrev_number] end |
Instance Method Details
#to_s ⇒ Object
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/dwarves/parser/4/ast.rb', line 33 def to_s attrs = if @attributes.empty? "" else %(\n#{@attributes.map(&:to_s).join("\n")}) end depth_addr = "<#{@depth}><#{@address}>: Abbrev Number: #{@abbrev_number}" if @tag " #{depth_addr} (#{@tag})#{attrs}" else " #{depth_addr}#{attrs}" end end |