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

Map object for keeping track of which address ranges have been heritaged. More...

#include <heritage.hh>

Public Types

typedef map< Address, SizePass >::iterator iterator
 Iterator into the main map.
 

Public Member Functions

iterator add (Address addr, int4 size, int4 pass, int4 &intersect)
 Mark new address as heritaged. More...
 
iterator find (const Address &addr)
 Look up if/how given address was heritaged. More...
 
int4 findPass (const Address &addr) const
 Look up if/how given address was heritaged. More...
 

Detailed Description

Map object for keeping track of which address ranges have been heritaged.

We keep track of a fairly fine grained description of when each address range was entered in SSA form, referred to as heritaged or, for Varnode objects, no longer free. An address range is added using the add() method, which includes the particular pass when it was entered. The map can be queried using findPass() that informs the caller whether the address has been heritaged and if so in which pass.

Member Function Documentation

◆ add()

LocationMap::iterator LocationMap::add ( Address  addr,
int4  size,
int4  pass,
int4 &  intersect 
)

Mark new address as heritaged.

Update disjoint cover making sure (addr,size) is contained in a single element and return iterator to this element. Pass back intersect value:

  • 0 if the only intersection is with range from the same pass
  • 1 if there is a partial intersection with something old
  • 2 if the range is contained in an old range
    Parameters
    addris the starting address of the range to add
    sizeis the number of bytes in the range
    passis the pass number when the range was heritaged
    intersectis a reference for passing back the intersect code
    Returns
    the iterator to the map element containing the added range

◆ find()

LocationMap::iterator LocationMap::find ( const Address addr)

Look up if/how given address was heritaged.

If the given address was heritaged, return (the iterator to) the SizeMap entry describing the associated range and when it was heritaged.

Parameters
addris the given address
Returns
the iterator to the SizeMap entry or the end iterator is the address is unheritaged

◆ findPass()

int4 LocationMap::findPass ( const Address addr) const

Look up if/how given address was heritaged.

Return the pass number when the given address was heritaged, or -1 if it was not heritaged

Parameters
addris the given address
Returns
the pass number of -1

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