Class: ElfUtils::Section::DebugInfo::DebugStrOffsetsRef

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

Instance Method Summary collapse

Constructor Details

#initialize(cu, offset) ⇒ DebugStrOffsetsRef

Returns a new instance of DebugStrOffsetsRef.



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

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

Instance Method Details

#derefObject



8
9
10
11
12
13
# File 'lib/elf_utils/section/debug_info/debug_str_offsets_ref.rb', line 8

def deref
  base = @cu.root_die.str_offsets_base
  str_offset = @cu.file.section(".debug_str_offsets")
    .get(base:, offset: @offset, format: @cu.format)
  @cu.file.section(".debug_str")[str_offset]
end