Package winappdbg :: Module crash :: Class CrashContainer
[hide private]
[frames] | no frames]

Class CrashContainer

source code


Manages a database of persistent Crash objects, trying to avoid duplicates.

Uses a DBM database file for persistency.


See Also: Crash.key

Nested Classes [hide private]
  __CrashContainerIterator
Iterator of Crash objects.
Instance Methods [hide private]
 
__init__(self, filename=None, allowRepeatedKeys=False)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
__del__(self) source code
bool
__contains__(self, crash)
Returns: True if the Crash object is in the container.
source code
iterator
__iter__(self)
Returns: Iterator of the contained Crash objects.
source code
int
__len__(self)
Returns: Count of Crash elements in the container.
source code
bool
__bool__(self)
Returns: False if the container is empty.
source code
bool
has_key(self, key)
Returns: True if a matching Crash object is in the container.
source code
iterator
iterkeys(self)
Returns: Iterator of the contained Crash object keys.
source code
iterator
itervalues(self)
Returns: Iterator of the contained Crash objects.
source code
 
add(self, crash)
Adds a new crash to the container.
source code
 
remove(self, crash)
Removes a crash from the container.
source code
Crash object.
get(self, key)
Retrieves a crash from the container.
source code
str
__marshall_key(self, key)
Marshalls a Crash key to be used in the database.
source code
(opaque object)
__unmarshall_key(self, key)
Unmarshalls a Crash key read from the database.
source code
str
__marshall_value(self, value)
Marshalls a Crash object to be used in the database.
source code
Crash
__unmarshall_value(self, value)
Unmarshalls a Crash object read from the database.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, filename=None, allowRepeatedKeys=False)
(Constructor)

source code 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Parameters:
  • filename (str) - (Optional) File name for crash database. If no filename is specified, the container is volatile.

    Volatile containers are stored only in memory and destroyed when they go out of scope.

Overrides: object.__init__

__contains__(self, crash)
(In operator)

source code 
Parameters:
  • crash (Crash) - Crash object.
Returns: bool
True if the Crash object is in the container.

__iter__(self)

source code 
Returns: iterator
Iterator of the contained Crash objects.

See Also: itervalues

__len__(self)
(Length operator)

source code 
Returns: int
Count of Crash elements in the container.

__bool__(self)

source code 
Returns: bool
False if the container is empty.

has_key(self, key)

source code 
Parameters:
  • key (Crash unique key.) - Key of the crash to get.
Returns: bool
True if a matching Crash object is in the container.

iterkeys(self)

source code 
Returns: iterator
Iterator of the contained Crash object keys.

See Also: get

Warning: A copy of each object is returned, so any changes made to them will be lost.

To preserve changes do the following:

  1. Keep a reference to the object.
  2. Delete the object from the set.
  3. Modify the object and add it again.

itervalues(self)

source code 
Returns: iterator
Iterator of the contained Crash objects.

Warning: A copy of each object is returned, so any changes made to them will be lost.

To preserve changes do the following:

  1. Keep a reference to the object.
  2. Delete the object from the set.
  3. Modify the object and add it again.

add(self, crash)

source code 

Adds a new crash to the container. If the crash appears to be already known, it's ignored.

Parameters:
  • crash (Crash) - Crash object to add.

See Also: Crash.key

remove(self, crash)

source code 

Removes a crash from the container.

Parameters:
  • crash (Crash) - Crash object to remove.

get(self, key)

source code 

Retrieves a crash from the container.

Parameters:
  • key (Crash unique key.) - Key of the crash to get.
Returns: Crash object.
Crash matching the given key.

See Also: iterkeys

Warning: A copy of each object is returned, so any changes made to them will be lost.

To preserve changes do the following:

  1. Keep a reference to the object.
  2. Delete the object from the set.
  3. Modify the object and add it again.

__marshall_key(self, key)

source code 

Marshalls a Crash key to be used in the database.

Parameters:
  • key ((opaque object)) - Key to convert.
Returns: str
Converted key.

__unmarshall_key(self, key)

source code 

Unmarshalls a Crash key read from the database.

Parameters:
  • key (str) - Key to convert.
Returns: (opaque object)
Converted key.

__marshall_value(self, value)

source code 

Marshalls a Crash object to be used in the database.

Parameters:
  • value (Crash) - Object to convert.
Returns: str
Converted object.

__unmarshall_value(self, value)

source code 

Unmarshalls a Crash object read from the database.

Parameters:
  • value (str) - Object to convert.
Returns: Crash
Converted object.