Class: WORF::DIE
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
-
#children ⇒ Object
readonly
Returns the value of attribute children.
-
#offset ⇒ Object
readonly
Returns the value of attribute offset.
-
#tag ⇒ Object
readonly
Returns the value of attribute tag.
Instance Method Summary collapse
- #byte_size ⇒ Object
- #const_value ⇒ Object
- #data_member_location ⇒ Object
- #decl_file ⇒ Object
- #each {|_self| ... } ⇒ Object
- #find_type(child) ⇒ Object
- #high_pc ⇒ Object
-
#initialize(tag, offset, attributes, children) ⇒ DIE
constructor
A new instance of DIE.
- #location ⇒ Object
- #low_pc ⇒ Object
- #name(strings) ⇒ Object
- #name_offset ⇒ Object
- #type ⇒ Object
Constructor Details
#initialize(tag, offset, attributes, children) ⇒ DIE
Returns a new instance of DIE.
173 174 175 176 177 178 |
# File 'lib/worf.rb', line 173 def initialize tag, offset, attributes, children @tag = tag @offset = offset @attributes = attributes @children = children end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
171 172 173 |
# File 'lib/worf.rb', line 171 def attributes @attributes end |
#children ⇒ Object (readonly)
Returns the value of attribute children.
171 172 173 |
# File 'lib/worf.rb', line 171 def children @children end |
#offset ⇒ Object (readonly)
Returns the value of attribute offset.
171 172 173 |
# File 'lib/worf.rb', line 171 def offset @offset end |
#tag ⇒ Object (readonly)
Returns the value of attribute tag.
171 172 173 |
# File 'lib/worf.rb', line 171 def tag @tag end |
Instance Method Details
#byte_size ⇒ Object
201 202 203 |
# File 'lib/worf.rb', line 201 def byte_size at Constants::DW_AT_byte_size end |
#const_value ⇒ Object
213 214 215 |
# File 'lib/worf.rb', line 213 def const_value at Constants::DW_AT_const_value end |
#data_member_location ⇒ Object
197 198 199 |
# File 'lib/worf.rb', line 197 def data_member_location at Constants::DW_AT_data_member_location end |
#decl_file ⇒ Object
209 210 211 |
# File 'lib/worf.rb', line 209 def decl_file at Constants::DW_AT_decl_file end |
#each {|_self| ... } ⇒ Object
231 232 233 234 |
# File 'lib/worf.rb', line 231 def each &block yield self children.each { |child| child.each(&block) } end |
#find_type(child) ⇒ Object
180 181 182 183 |
# File 'lib/worf.rb', line 180 def find_type child raise ArgumentError, "DIE doesn't have a type" unless child.type children.bsearch { |c_die| child.type <=> c_die.offset } end |
#high_pc ⇒ Object
193 194 195 |
# File 'lib/worf.rb', line 193 def high_pc at Constants::DW_AT_high_pc end |
#location ⇒ Object
185 186 187 |
# File 'lib/worf.rb', line 185 def location at Constants::DW_AT_location end |
#low_pc ⇒ Object
189 190 191 |
# File 'lib/worf.rb', line 189 def low_pc at Constants::DW_AT_low_pc end |
#name(strings) ⇒ Object
217 218 219 220 221 222 223 224 225 |
# File 'lib/worf.rb', line 217 def name strings tag.attribute_info(Constants::DW_AT_name) do |form, i| if form == Constants::DW_FORM_string attributes[i] else strings.string_at(attributes[i]) end end end |
#name_offset ⇒ Object
227 228 229 |
# File 'lib/worf.rb', line 227 def name_offset at Constants::DW_AT_name end |
#type ⇒ Object
205 206 207 |
# File 'lib/worf.rb', line 205 def type at Constants::DW_AT_type end |