Class: Ragweed::Wraposx::Vm::RegionTopInfo

Inherits:
RegionInfo show all
Defined in:
lib/ragweed/wraposx/region_info.rb

Overview

struct vm_region_top_info

unsigned int            obj_id;
unsigned int            ref_count;
unsigned int            private_pages_resident;
unsigned int            shared_pages_resident;
unsigned char           share_mode;

;

Constant Summary collapse

FLAVOR =
Ragweed::Wraposx::Vm::REGION_TOP_INFO

Instance Attribute Summary

Attributes inherited from RegionInfo

#base_address, #region_size

Instance Method Summary collapse

Methods included from FFIStructInclude

#method_missing, #methods, #respond_to?

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Ragweed::FFIStructInclude

Instance Method Details

#dump(&block) ⇒ Object



176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
# File 'lib/ragweed/wraposx/region_info.rb', line 176

def dump(&block)
  maybe_hex = lambda {|a| begin; "\n" + (" " * 9) + block.call(a, 16).hexdump(true)[10..-2]; rescue; ""; end }
  maybe_dis = lambda {|a| begin; "\n" + block.call(a, 16).distorm.map {|i| "         " + i.mnem}.join("\n"); rescue; ""; end }

  string ="  -----------------------------------------------------------------------\n  TOP INFO:\n  base address:           \#{self.base_address.to_s(16).rjust(8, \"0\")}\n\n  obj_id:                 \#{self.obj_id.to_s(16).rjust(8, \"0\")} \#{maybe_hex.call(self.obj_id)}\n  ref_count:              \#{self.ref_count.to_s(16).rjust(8, \"0\")} \#{maybe_hex.call(self.ref_count)}\n  private_pages_resident: \#{self.private_pages_resident.to_s(16).rjust(8, \"0\")} \#{maybe_hex.call(self.private_pages_resident)}\n  shared_pages_resident:  \#{self.shared_pages_resident.to_s(16).rjust(8, \"0\")} \#{maybe_hex.call(self.shared_pages_resident)}\n  share_mode:             \#{self.share_mode.to_s(16).rjust(8, \"0\")} \#{maybe_hex.call(self.share_mode)}\n  size:                   \#{self.size.to_s(16).rjust(8, \"0\")} \#{maybe_hex.call(self.size)}\n"
end