Class: HeapInfo::Libc
- Includes:
- Glibc
- Defined in:
- lib/heapinfo/libc.rb
Overview
Record libc's base, name, and offsets.
Instance Attribute Summary
Attributes included from Glibc
Attributes inherited from Segment
Class Method Summary collapse
-
.find(maps, name, **options) ⇒ HeapInfo::Libc
Libc segment found in maps.
Instance Method Summary collapse
-
#initialize(*args) ⇒ Libc
constructor
Instantiate a Libc object.
-
#main_arena ⇒ HeapInfo::Arena
Get the
main_arenaof libc. -
#main_arena_offset ⇒ Integer
Get the offset of
main_arenain libc. -
#tcache ⇒ HeapInfo::Tcache?
The tcache object.
-
#tcache? ⇒ Boolean
Does this glibc support tcache?.
Methods inherited from Segment
Constructor Details
#initialize(*args) ⇒ Libc
Instantiate a HeapInfo::Libc object.
20 21 22 |
# File 'lib/heapinfo/libc.rb', line 20 def initialize(*args) super end |
Class Method Details
.find(maps, name, **options) ⇒ HeapInfo::Libc
Returns libc segment found in maps.
68 69 70 71 72 73 74 75 |
# File 'lib/heapinfo/libc.rb', line 68 def self.find(maps, name, **) super(maps, name).tap do |obj| obj.size_t = [:bits] / 8 %i[ld_name dumper method_heap].each do |sym| obj.__send__("#{sym}=", [sym]) end end end |
Instance Method Details
#main_arena ⇒ HeapInfo::Arena
Get the main_arena of libc.
32 33 34 35 36 37 38 39 |
# File 'lib/heapinfo/libc.rb', line 32 def main_arena return @main_arena.reload! if defined? @main_arena off = main_arena_offset return if off.nil? @main_arena = Arena.new(off + base, size_t, dumper) end |
#main_arena_offset ⇒ Integer
Get the offset of main_arena in libc.
26 27 28 |
# File 'lib/heapinfo/libc.rb', line 26 def main_arena_offset info['main_arena_offset'] end |
#tcache ⇒ HeapInfo::Tcache?
The tcache object.
53 54 55 56 57 |
# File 'lib/heapinfo/libc.rb', line 53 def tcache return unless tcache? @tcache ||= Tcache.new(tcache_base, size_t, dumper) end |
#tcache? ⇒ Boolean
Does this glibc support tcache?
45 46 47 |
# File 'lib/heapinfo/libc.rb', line 45 def tcache? info['tcache_enable'] end |