angr.knowledge_plugins.cfg.spilling_digraph

SpillingDiGraph - a networkx.DiGraph subclass with LMDB-backed edge spilling.

This module provides SpillingAdjDict and SpillingDiGraph classes that implement disk-backed storage for graph adjacency data, following the SpillingCFGNodeDict pattern.

Edge attributes are serialized using the Edge protobuf message from primitives.proto.

class angr.knowledge_plugins.cfg.spilling_digraph.DirtyDict

Bases: UserDict, Generic

A simple dict subclass that tracks whether it has been modified since creation or last reset.

This is used for edge attribute dicts to know when they need to be re-serialized and saved to LMDB.

__init__(*args, dirty=False, **kwargs)
Parameters:

dirty (bool)

class angr.knowledge_plugins.cfg.spilling_digraph.SpillingAdjDict

Bases: MutableMapping

A dict-like container for adjacency data with LRU caching and LMDB spilling.

Keys are node keys (block_key tuples), values are inner adjacency dicts (mapping neighbor_key -> edge_attr_dict).

When the number of cached entries exceeds cache_limit + db_batch_size, the db_batch_size least recently used entries are evicted to LMDB.

Edge attributes within each inner dict are serialized/deserialized using the Edge protobuf message from primitives.proto.

__init__(addr_type, rtdb=None, cache_limit=1000, db_batch_size=800)
Parameters:
  • addr_type (Literal['int', 'block_id', 'soot'])

  • rtdb (RuntimeDb | None)

  • cache_limit (int)

  • db_batch_size (int)

load_all_spilled()

Load all spilled entries back into memory.

Return type:

None

evict_all_cached()

Evict all cached entries to LMDB.

Return type:

None

copy()
Return type:

SpillingAdjDict

class angr.knowledge_plugins.cfg.spilling_digraph.SpillingDiGraph

Bases: DiGraph

A networkx DiGraph subclass whose adjlist_outer_dict_factory produces SpillingAdjDict instances, enabling LRU-based LMDB spilling of adjacency data (edges and their attributes).

Parameters:
  • rtdb (RuntimeDb | None) – RuntimeDb used for LMDB access.

  • edge_cache_limit (int) – Maximum adjacency entries to keep in memory per outer dict (_adj and _pred each).

  • db_batch_size (int) – Number of entries evicted in a single batch.

property addr_type: Literal['int', 'block_id', 'soot']
load_all_spilled_edges()

Load all spilled adjacency entries back into memory.

Return type:

None

evict_all_cached_edges()

Evict all cached adjacency entries to LMDB.

Return type:

None