Class: ElfUtils::Section::DebugAbbrev::AbbreviationTable
- Inherits:
-
Object
- Object
- ElfUtils::Section::DebugAbbrev::AbbreviationTable
- Defined in:
- lib/elf_utils/section/debug_abbrev/abbreviation_table.rb
Instance Attribute Summary collapse
-
#declarations ⇒ Object
readonly
Returns the value of attribute declarations.
Instance Method Summary collapse
- #[](code) ⇒ Object
- #entries ⇒ Object
-
#initialize(buf) ⇒ AbbreviationTable
constructor
A new instance of AbbreviationTable.
Constructor Details
#initialize(buf) ⇒ AbbreviationTable
Returns a new instance of AbbreviationTable.
3 4 5 6 7 8 9 10 11 12 13 14 |
# File 'lib/elf_utils/section/debug_abbrev/abbreviation_table.rb', line 3 def initialize(buf) @declarations = {} @abbrevs = {} # XXX CTypes needs a terminated array where we check the remaining bytes # before decoding. until buf[0].ord == 0 decl, buf = ElfUtils::Types::Dwarf::AbbreviationDeclaration.unpack_one(buf) @declarations[decl.code] = decl @abbrevs[decl.code] = Abbreviation.new(self, decl) end end |
Instance Attribute Details
#declarations ⇒ Object (readonly)
Returns the value of attribute declarations.
15 16 17 |
# File 'lib/elf_utils/section/debug_abbrev/abbreviation_table.rb', line 15 def declarations @declarations end |
Instance Method Details
#[](code) ⇒ Object
17 18 19 |
# File 'lib/elf_utils/section/debug_abbrev/abbreviation_table.rb', line 17 def [](code) @abbrevs[code] end |
#entries ⇒ Object
21 22 23 |
# File 'lib/elf_utils/section/debug_abbrev/abbreviation_table.rb', line 21 def entries @abbrevs.values end |