Flutter Engine
The Flutter Engine
Public Member Functions | Public Attributes | List of all members
minidump.MinidumpFile Class Reference
Inheritance diagram for minidump.MinidumpFile:

Public Member Functions

def __init__ (self, minidump_name)
 
def GetProcessId (self)
 
def Read (self, what, offset)
 
def __enter__ (self)
 
def __exit__ (self, type, value, traceback)
 

Public Attributes

 minidump_name
 
 minidump_file
 
 minidump
 
 minidump_address
 
 header
 
 directories
 

Detailed Description

Class for reading minidump files.

Definition at line 140 of file minidump.py.

Constructor & Destructor Documentation

◆ __init__()

def minidump.MinidumpFile.__init__ (   self,
  minidump_name 
)

Definition at line 144 of file minidump.py.

144 def __init__(self, minidump_name):
145 self.minidump_name = minidump_name
146 self.minidump_file = open(minidump_name, 'r')
147 self.minidump = mmap.mmap(
148 self.minidump_file.fileno(), 0, access=mmap.ACCESS_READ)
149 self.minidump_address = BufferToAddress(self.minidump)
150 self.header = self.Read(MINIDUMP_HEADER, 0)
151 if self.header.signature != MinidumpFile._HEADER_MAGIC:
152 raise Exception('Unsupported minidump header magic')
153 self.directories = []
154 offset = self.header.stream_directories_rva
155 for _ in range(self.header.stream_count):
156 self.directories.append(self.Read(MINIDUMP_DIRECTORY, offset))
157 offset += MINIDUMP_DIRECTORY.size
158
static void append(char **dst, size_t *count, const char *src, size_t n)
Definition: editor.cpp:211
def BufferToAddress(buf)
Definition: minidump.py:131

Member Function Documentation

◆ __enter__()

def minidump.MinidumpFile.__enter__ (   self)

Definition at line 170 of file minidump.py.

170 def __enter__(self):
171 return self
172

◆ __exit__()

def minidump.MinidumpFile.__exit__ (   self,
  type,
  value,
  traceback 
)

Definition at line 173 of file minidump.py.

173 def __exit__(self, type, value, traceback):
174 self.minidump.close()
175 self.minidump_file.close()
176
177
178# Returns process id of the crashed process recorded in the given minidump.

◆ GetProcessId()

def minidump.MinidumpFile.GetProcessId (   self)

Definition at line 159 of file minidump.py.

159 def GetProcessId(self):
160 for dir in self.directories:
161 if dir.stream_type == 'MD_MISC_INFO_STREAM':
162 info = self.Read(MINIDUMP_MISC_INFO_2, dir.location.rva)
163 if info.Flags1 & MINIDUMP_MISC1_PROCESS_ID != 0:
164 return info.ProcessId
165 return -1
166

◆ Read()

def minidump.MinidumpFile.Read (   self,
  what,
  offset 
)

Definition at line 167 of file minidump.py.

167 def Read(self, what, offset):
168 return what.Read(self.minidump_address + offset)
169
SK_API bool Read(SkStreamSeekable *src, SkDocumentPage *dstArray, int dstArrayCount, const SkDeserialProcs *=nullptr)

Member Data Documentation

◆ directories

minidump.MinidumpFile.directories

Definition at line 153 of file minidump.py.

◆ header

minidump.MinidumpFile.header

Definition at line 150 of file minidump.py.

◆ minidump

minidump.MinidumpFile.minidump

Definition at line 147 of file minidump.py.

◆ minidump_address

minidump.MinidumpFile.minidump_address

Definition at line 149 of file minidump.py.

◆ minidump_file

minidump.MinidumpFile.minidump_file

Definition at line 146 of file minidump.py.

◆ minidump_name

minidump.MinidumpFile.minidump_name

Definition at line 145 of file minidump.py.


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