angr.Analysis
class. In this section, we'll create a mock analysis to show off the various features. Let's start with something simple:self.project
property. Use this to interact with your project and analyze it!Analysis
base 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).self._resilience()
.name
, which affects where the error is logged. By default, errors are placed in self.errors
, but if name
is provided, then instead the error is logged to self.named_errors
, which is a dict mapping name
to 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 _resilience
should 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._resilience
has a few advantages:fail_fast=True
, which transparently disable the resilience, which is really nice for manual testing.try
/except
everywhere.