Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Static Protected Member Functions | List of all members
minidump.Descriptor Class Reference
Inheritance diagram for minidump.Descriptor:

Public Member Functions

 __init__ (self, fields)
 
 Read (self, address)
 

Public Attributes

 fields
 
 ctype
 
 size
 

Static Protected Member Functions

 _GetCtype (fields)
 

Detailed Description

A handy wrapper over ctypes.Structure

Definition at line 29 of file minidump.py.

Constructor & Destructor Documentation

◆ __init__()

minidump.Descriptor.__init__ (   self,
  fields 
)

Definition at line 32 of file minidump.py.

32 def __init__(self, fields):
33 self.fields = fields
34 self.ctype = Descriptor._GetCtype(fields)
35 self.size = ctypes.sizeof(self.ctype)
36

Member Function Documentation

◆ _GetCtype()

minidump.Descriptor._GetCtype (   fields)
staticprotected

Definition at line 41 of file minidump.py.

41 def _GetCtype(fields):
42 raw_fields = []
43 wrappers = {}
44 for field in fields:
45 (name, type) = field
46 if isinstance(type, Enum):
47 raw_fields.append(('_raw_' + name, type.type))
48 wrappers[name] = type
49 else:
50 raw_fields.append(field)
51
52 class Raw(ctypes.Structure):
53 _fields_ = raw_fields
54 _pack_ = 1
55
56 def __getattribute__(self, name):
57 if name in wrappers:
58 return wrappers[name].from_raw(
59 getattr(self, '_raw_' + name))
60 else:
61 return ctypes.Structure.__getattribute__(self, name)
62
63 def __repr__(self):
64 return '{' + ', '.join(
65 '%s: %s' % (field, self.__getattribute__(field))
66 for field, _ in fields) + '}'
67
68 return Raw
69
70
71# Structures below are based on the information in the MSDN pages and
72# Breakpad/Crashpad sources.
73

◆ Read()

minidump.Descriptor.Read (   self,
  address 
)

Definition at line 37 of file minidump.py.

37 def Read(self, address):
38 return self.ctype.from_address(address)
39

Member Data Documentation

◆ ctype

minidump.Descriptor.ctype

Definition at line 34 of file minidump.py.

◆ fields

minidump.Descriptor.fields

Definition at line 33 of file minidump.py.

◆ size

minidump.Descriptor.size

Definition at line 35 of file minidump.py.


The documentation for this class was generated from the following file: