class Dwarves::Parser::CU

Compilation Unit

@todo clean this up

Public Class Methods

new(opts = {}) click to toggle source
# 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

Public Instance Methods

to_s() click to toggle source
# 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