Class: ElfUtils::Section::DebugInfo::DieRef
- Inherits:
-
Object
- Object
- ElfUtils::Section::DebugInfo::DieRef
- Defined in:
- lib/elf_utils/section/debug_info/die_ref.rb
Instance Method Summary collapse
- #deref ⇒ Object
-
#initialize(cu, offset) ⇒ DieRef
constructor
A new instance of DieRef.
- #inspect ⇒ Object
Constructor Details
#initialize(cu, offset) ⇒ DieRef
Returns a new instance of DieRef.
3 4 5 6 |
# File 'lib/elf_utils/section/debug_info/die_ref.rb', line 3 def initialize(cu, offset) @cu = cu @offset = offset end |
Instance Method Details
#deref ⇒ Object
8 9 10 |
# File 'lib/elf_utils/section/debug_info/die_ref.rb', line 8 def deref @die ||= @cu.die(@offset + @cu.offset) end |
#inspect ⇒ Object
12 13 14 15 16 17 18 19 20 |
# File 'lib/elf_utils/section/debug_info/die_ref.rb', line 12 def inspect if (die = deref) "<%p cu=0x%x, offset=0x%08x, die=(0x%08x %s)>" % [self.class, @cu.offset, @offset, die.offset, die.tag] else "<%p cu=0x%x, offset=0x%x, die=:invalid>" % [self.class, @cu.offset, @offset] end end |