MCPcopy Create free account
hub / github.com/fabioz/PyDev.Debugger / add

Method add

pydevd_attach_to_process/winappdbg/sql.py:738–774  ·  view source on GitHub ↗

Add a new crash dump to the database, optionally filtering them by signature to avoid duplicates. @type crash: L{Crash} @param crash: Crash object. @type allow_duplicates: bool @param allow_duplicates: (Optional) C{True} to always add

(self, crash, allow_duplicates=True)

Source from the content-addressed store, hash-verified

736
737 @Transactional
738 def add(self, crash, allow_duplicates=True):
739 """
740 Add a new crash dump to the database, optionally filtering them by
741 signature to avoid duplicates.
742
743 @type crash: L{Crash}
744 @param crash: Crash object.
745
746 @type allow_duplicates: bool
747 @param allow_duplicates: (Optional)
748 C{True} to always add the new crash dump.
749 C{False} to only add the crash dump if no other crash with the
750 same signature is found in the database.
751
752 Sometimes, your fuzzer turns out to be I{too} good. Then you find
753 youself browsing through gigabytes of crash dumps, only to find
754 a handful of actual bugs in them. This simple heuristic filter
755 saves you the trouble by discarding crashes that seem to be similar
756 to another one you've already found.
757 """
758
759 # Filter out duplicated crashes, if requested.
760 if not allow_duplicates:
761 signature = pickle.dumps(crash.signature, protocol=0)
762 if self._session.query(CrashDTO.id).filter_by(signature=signature).count() > 0:
763 return
764
765 # Fill out a new row for the crashes table.
766 crash_id = self.__add_crash(crash)
767
768 # Fill out new rows for the memory dump.
769 self.__add_memory(crash_id, crash.memoryMap)
770
771 # On success set the row ID for the Crash object.
772 # WARNING: In nested calls, make sure to delete
773 # this property before a session rollback!
774 crash._rowid = crash_id
775
776 # Store the Crash object into the crashes table.
777 def __add_crash(self, crash):

Callers 15

set_trace_to_threadsFunction · 0.45
gui-gtk3.pyFile · 0.45
gui-gtk.pyFile · 0.45
forbidMethod · 0.45
mainFunction · 0.45
test_linecache_xmlFunction · 0.45
test_show_bytecode_xmlFunction · 0.45
get_set_large_frameFunction · 0.45
_clear_groupsFunction · 0.45
check_name_and_lineFunction · 0.45

Calls 4

__add_crashMethod · 0.95
__add_memoryMethod · 0.95
dumpsMethod · 0.80
countMethod · 0.45

Tested by 7

test_linecache_xmlFunction · 0.36
test_show_bytecode_xmlFunction · 0.36
get_set_large_frameFunction · 0.36
_clear_groupsFunction · 0.36
check_name_and_lineFunction · 0.36
tracer_printerMethod · 0.36