Class: Dtrace::Dof::Section
- Inherits:
-
Object
- Object
- Dtrace::Dof::Section
- Includes:
- Constants
- Defined in:
- ext/dof/dof_api.c,
lib/dtrace/dof/section.rb
Direct Known Subclasses
Defined Under Namespace
Classes: Strtab
Instance Attribute Summary collapse
-
#align ⇒ Object
Returns the value of attribute align.
-
#data ⇒ Object
Returns the value of attribute data.
-
#dof ⇒ Object
readonly
Returns the value of attribute dof.
-
#entsize ⇒ Object
writeonly
Sets the attribute entsize.
-
#flags ⇒ Object
Returns the value of attribute flags.
-
#offset ⇒ Object
Returns the value of attribute offset.
-
#pad ⇒ Object
Returns the value of attribute pad.
-
#section_type ⇒ Object
readonly
Returns the value of attribute section_type.
-
#size ⇒ Object
Returns the value of attribute size.
Instance Method Summary collapse
- #dof_generate_comments ⇒ Object
- #dof_generate_prargs ⇒ Object
- #dof_generate_prenoffs ⇒ Object
- #dof_generate_probes ⇒ Object
- #dof_generate_proffs ⇒ Object
- #dof_generate_provider ⇒ Object
- #dof_generate_relhdr ⇒ Object
- #dof_generate_reltab ⇒ Object
- #dof_generate_strtab ⇒ Object
- #dof_generate_utsname ⇒ Object
- #generate ⇒ Object
- #generate_header ⇒ Object
-
#initialize(type, index) ⇒ Section
constructor
A new instance of Section.
Constructor Details
#initialize(type, index) ⇒ Section
14 15 16 17 18 19 |
# File 'lib/dtrace/dof/section.rb', line 14 def initialize(type, index) @section_type = type @index = index @flags = 1 # DOF_SECF_LOAD @data = {} end |
Instance Attribute Details
#align ⇒ Object
Returns the value of attribute align.
11 12 13 |
# File 'lib/dtrace/dof/section.rb', line 11 def align @align end |
#data ⇒ Object
Returns the value of attribute data.
11 12 13 |
# File 'lib/dtrace/dof/section.rb', line 11 def data @data end |
#dof ⇒ Object (readonly)
Returns the value of attribute dof.
12 13 14 |
# File 'lib/dtrace/dof/section.rb', line 12 def dof @dof end |
#entsize=(value) ⇒ Object (writeonly)
Sets the attribute entsize
10 11 12 |
# File 'lib/dtrace/dof/section.rb', line 10 def entsize=(value) @entsize = value end |
#flags ⇒ Object
Returns the value of attribute flags.
11 12 13 |
# File 'lib/dtrace/dof/section.rb', line 11 def flags @flags end |
#offset ⇒ Object
Returns the value of attribute offset.
11 12 13 |
# File 'lib/dtrace/dof/section.rb', line 11 def offset @offset end |
#pad ⇒ Object
Returns the value of attribute pad.
11 12 13 |
# File 'lib/dtrace/dof/section.rb', line 11 def pad @pad end |
#section_type ⇒ Object (readonly)
Returns the value of attribute section_type.
12 13 14 |
# File 'lib/dtrace/dof/section.rb', line 12 def section_type @section_type end |
#size ⇒ Object
Returns the value of attribute size.
11 12 13 |
# File 'lib/dtrace/dof/section.rb', line 11 def size @size end |
Instance Method Details
#dof_generate_comments ⇒ Object
#dof_generate_prargs ⇒ Object
#dof_generate_prenoffs ⇒ Object
#dof_generate_probes ⇒ Object
#dof_generate_proffs ⇒ Object
#dof_generate_provider ⇒ Object
#dof_generate_relhdr ⇒ Object
#dof_generate_reltab ⇒ Object
#dof_generate_strtab ⇒ Object
#dof_generate_utsname ⇒ Object
#generate ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 |
# File 'lib/dtrace/dof/section.rb', line 21 def generate case @section_type when DOF_SECT_COMMENTS @align = 1 @dof = dof_generate_comments when DOF_SECT_STRTAB @align = 1 @dof = dof_generate_strtab when DOF_SECT_PROBES @align = 8 @dof = dof_generate_probes when DOF_SECT_PRARGS @align = 1 @dof = dof_generate_prargs when DOF_SECT_PROFFS @align = 4 @dof = dof_generate_proffs when DOF_SECT_PRENOFFS @align = 4 @dof = dof_generate_prenoffs when DOF_SECT_PROVIDER @align = 4 @dof = dof_generate_provider when DOF_SECT_RELTAB @align = 8 @dof = dof_generate_reltab when DOF_SECT_URELHDR @align = 4 @dof = dof_generate_relhdr when DOF_SECT_UTSNAME @align = 1 @dof = dof_generate_utsname else @dof = '' end begin if @data.class == Array @entsize = @dof.length / @data.length else @entsize = 0 end rescue ZeroDivisionError @entsize = 0 end return @dof.length end |