angr.knowledge_plugins.structured_code¶
- class angr.knowledge_plugins.structured_code.SpillingDecompilationDict¶
Bases:
MutableMappingA dict of decompilation caches, keyed by (function address, flavor), that keeps only the most recently used cache_limit entries in memory and spills the rest to an LMDB database managed by the RuntimeDb knowledge base plugin.
Evicted entries are always serialized and written out (caches are mutated in place, so there is no clean/dirty distinction). Entries that cannot be serialized (e.g. DummyStructuredCodeGenerator or rust-flavor caches) are parked in an unbounded in-memory dict. Spilled entries are deserialized on access with the owning knowledge base’s project/function attached.
- __init__(kb, cache_limit=128)¶
- Parameters:
kb (KnowledgeBase)
cache_limit (int)
- export_serialized()¶
Export all serializable entries as (key, serialized bytes) pairs. Spilled entries are copied directly out of the LMDB backing store without being deserialized and re-serialized. Entries that cannot be serialized are returned separately in a dict.
- bulk_import_serialized(items)¶
Move already-serialized decompilation caches directly into the LMDB backing store and register them as spilled, without deserializing them. The bytes must be serialized DecompilationCache messages, i.e., the exact format that eviction writes.