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 included from Glibc
Methods inherited from Segment
Constructor Details
#initialize(*args) ⇒ Libc
Instantiate a HeapInfo::Libc object.
18 19 20 |
# File 'lib/heapinfo/libc.rb', line 18 def initialize(*args) super end |
Class Method Details
.find(maps, name, **options) ⇒ HeapInfo::Libc
Returns libc segment found in maps.
63 64 65 66 67 68 69 70 |
# File 'lib/heapinfo/libc.rb', line 63 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.
30 31 32 33 34 35 |
# File 'lib/heapinfo/libc.rb', line 30 def main_arena return @main_arena.reload! if @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.
24 25 26 |
# File 'lib/heapinfo/libc.rb', line 24 def main_arena_offset info['main_arena_offset'] end |
#tcache ⇒ HeapInfo::Tcache?
The tcache object.
49 50 51 52 |
# File 'lib/heapinfo/libc.rb', line 49 def tcache return unless tcache? @tcache ||= Tcache.new(tcache_base, size_t, dumper) end |
#tcache? ⇒ Boolean
Does this glibc support tcache?
41 42 43 |
# File 'lib/heapinfo/libc.rb', line 41 def tcache? info['tcache_enable'] end |