Class: Dwarves::Parser::CU

Inherits:
AST
  • Object
show all
Defined in:
lib/dwarves/parser/4/ast.rb

Overview

TODO:

clean this up

Compilation Unit

Instance Method Summary collapse

Constructor Details

#initialize(opts = {}) ⇒ CU

Returns a new instance of CU.



64
65
66
67
68
69
70
71
72
# File 'lib/dwarves/parser/4/ast.rb', line 64

def initialize opts = {}
  @compilation_unit_offset = opts[:compilation_unit_offset]
  @length = opts[:length]
  @architecture = opts[:architecture]
  @version = opts[:version]
  @abbrev_offset = opts[:abbrev_offset]
  @pointer_size = opts[:pointer_size]
  @dies = opts[:dies] || []
end

Instance Method Details

#to_sObject



74
75
76
77
78
79
80
81
82
83
# File 'lib/dwarves/parser/4/ast.rb', line 74

def to_s
  "Contents of the .debug_info section:\n" \
  "\n" \
  "  Compilation Unit @ offset #{@compilation_unit_offset}:\n" \
  "   Length:        #{@length} (#{@architecture})\n" \
  "   Version:       #{@version}\n" \
  "   Abbrev Offset: #{@abbrev_offset}\n" \
  "   Pointer Size:  #{@pointer_size}\n" \
  "#{@dies.map(&:to_s).join("\n")}\n\n"
end