angr.analyses.decompiler.edits.cache¶
Decompilation-cache access for the edit layer.
Both kb.decompilations and kb.dec_variables spill to LMDB under memory pressure and hand
back a freshly deserialized – that is, different – Python object on reload. Never hold a
DecompilationCache or a VariableManagerInternal across anything that can decompile; always
re-fetch by key at the point of mutation.
- angr.analyses.decompiler.edits.cache.get_cache(kb, func_addr, flavor='pseudocode')¶
Return the cached decompilation for a function, or None if there is none.
- Return type:
- Parameters:
kb (KnowledgeBase)
func_addr (int)
flavor (str)
- angr.analyses.decompiler.edits.cache.require_cache(kb, func_addr, flavor='pseudocode')¶
Return the cached decompilation, raising NotDecompiledError if it is missing or empty.
- Return type:
- Parameters:
kb (KnowledgeBase)
func_addr (int)
flavor (str)
- angr.analyses.decompiler.edits.cache.invalidate(kb, func_addr, *, flavors=None, drop_variables=False)¶
Drop cached decompilations for a function.
- Parameters:
flavors (
Iterable[str] |None) – Flavors to drop; None drops every flavor currently cached. A prototype change must drop all of them, or a non-pseudocode flavor silently retains the old signature.drop_variables (
bool) – Also dropkb.dec_variables[func_addr]. Required for new argument names to take effect, but it discards every rename and manual type for the function – seesnapshot_user_edits().kb (KnowledgeBase)
func_addr (int)
- Return type:
- angr.analyses.decompiler.edits.cache.snapshot_user_edits(kb, func_addr)¶
Capture user renames and manual types for a function, keyed by
SimVariable.ident.Used to survive the
dec_variablesdrop that a prototype change requires.
- angr.analyses.decompiler.edits.cache.restore_user_edits(kb, func_addr, snapshot)¶
Re-apply a
snapshot_user_edits()result after re-decompilation.Best-effort: idents can change across a re-decompile, so the unmatched ones are returned rather than silently dropped.