Ghidra Decompiler Analysis Engine
Public Member Functions | List of all members
DisassemblyCache Class Reference

A container for disassembly context used by the SLEIGH engine. More...

#include <sleigh.hh>

Public Member Functions

 DisassemblyCache (ContextCache *ccache, AddrSpace *cspace, int4 cachesize, int4 windowsize)
 Constructor. More...
 
ParserContextgetParserContext (const Address &addr)
 Get the parser for a particular Address. More...
 

Detailed Description

A container for disassembly context used by the SLEIGH engine.

This acts as a factor for the ParserContext objects which are used to disassemble a single instruction. These all share a ContextCache which is a front end for accessing the ContextDatabase and resolving context variables from the SLEIGH spec. ParserContext objects are stored in a hash-table keyed by the address of the instruction.

Constructor & Destructor Documentation

◆ DisassemblyCache()

DisassemblyCache::DisassemblyCache ( ContextCache ccache,
AddrSpace cspace,
int4  cachesize,
int4  windowsize 
)

Constructor.

Parameters
ccacheis the ContextCache front-end shared across all the parser contexts
cspaceis the constant address space used for minting constant Varnodes
cachesizeis the number of distinct ParserContext objects in this cache
windowsizeis the size of the ParserContext hash-table

Member Function Documentation

◆ getParserContext()

ParserContext * DisassemblyCache::getParserContext ( const Address addr)

Get the parser for a particular Address.

Return a (possibly cached) ParserContext that is associated with addr If n different calls to this interface are made with n different Addresses, if

  • n <= minimumreuse AND
  • all the addresses are within the windowsize (=mask+1)

then the cacher guarantees that you get all different ParserContext objects

Parameters
addris the Address to disassemble at
Returns
the ParserContext associated with the address

The documentation for this class was generated from the following files: