Class: ElfUtils::Section::DebugInfo::DebugStrRef

Inherits:
Object
  • Object
show all
Defined in:
lib/elf_utils/section/debug_info/debug_str_ref.rb

Instance Method Summary collapse

Constructor Details

#initialize(cu, offset) ⇒ DebugStrRef

Returns a new instance of DebugStrRef.



3
4
5
6
# File 'lib/elf_utils/section/debug_info/debug_str_ref.rb', line 3

def initialize(cu, offset)
  @cu = cu
  @offset = offset
end

Instance Method Details

#derefObject



8
9
10
# File 'lib/elf_utils/section/debug_info/debug_str_ref.rb', line 8

def deref
  @str ||= @cu.file.section(".debug_str")[@offset]
end

#inspectObject



12
13
14
15
# File 'lib/elf_utils/section/debug_info/debug_str_ref.rb', line 12

def inspect
  "<%p cu=0x%x, offset=0x%08x, str=%p>" %
    [self.class, @cu.offset, @offset, deref]
end