angr.Analysisclass. In this section, we'll create a mock analysis to show off the various features. Let's start with something simple:
self.projectproperty. Use this to interact with your project and analyze it!
Analysisbase class provides a resilience context manager under
self._resilience. Here's an example:
self.errors. These are also saved and loaded when the analysis is saved and loaded (although the traceback is discarded, as it is not picklable).
name, which affects where the error is logged. By default, errors are placed in
self.errors, but if
nameis provided, then instead the error is logged to
self.named_errors, which is a dict mapping
nameto a list of all the errors that were caught under that name. This allows you to easily tell where thrown without examining its traceback.
exception, which should be the type of the exception that
_resilienceshould catch. This defaults to
Exception, which handles (and logs) almost anything that could go wrong. You can also pass a tuple of exception types to this option, in which case all of them will be caught.
_resiliencehas a few advantages:
fail_fast=True, which transparently disable the resilience, which is really nice for manual testing.