decompiler  1.0.0
Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
ghidra::BlockMap Class Reference

Helper class for resolving cross-references while deserializing BlockGraph objects. More...

#include <block.hh>

Public Member Functions

void sortList (void)
 Sort the list of FlowBlock objects.
 
FlowBlockfindLevelBlock (int4 index) const
 Find the FlowBlock matching the given index. More...
 
FlowBlockcreateBlock (const string &name)
 Create a FlowBlock of the named type. More...
 

Private Member Functions

FlowBlockresolveBlock (FlowBlock::block_type bt)
 Construct a FlowBlock of the given type. More...
 

Static Private Member Functions

static FlowBlockfindBlock (const vector< FlowBlock *> &list, int4 ind)
 Locate a FlowBlock with a given index. More...
 

Private Attributes

vector< FlowBlock * > sortlist
 The list of deserialized FlowBlock objects.
 

Detailed Description

Helper class for resolving cross-references while deserializing BlockGraph objects.

FlowBlock objects are serialized with their associated index value and edges are serialized with the indices of the FlowBlock end-points. During deserialization, this class maintains a list of FlowBlock objects sorted by index and then looks up the FlowBlock matching a given index as edges specify them.

Member Function Documentation

◆ createBlock()

FlowBlock * ghidra::BlockMap::createBlock ( const string &  name)

Create a FlowBlock of the named type.

Given the name of a block (deserialized from a <bhead> tag), build the corresponding type of block.

Parameters
nameis the name of the block type
Returns
a new instance of the named FlowBlock type

References ghidra::FlowBlock::nameToType().

Referenced by ghidra::BlockGraph::decodeBody().

◆ findBlock()

FlowBlock * ghidra::BlockMap::findBlock ( const vector< FlowBlock *> &  list,
int4  ind 
)
staticprivate

Locate a FlowBlock with a given index.

Given a list of FlowBlock objects sorted by index, use binary search to find the FlowBlock with matching index

Parameters
listis the sorted list of FlowBlock objects
indis the FlowBlock index to match
Returns
the matching FlowBlock or NULL

References ghidra::FlowBlock::getIndex().

◆ findLevelBlock()

FlowBlock* ghidra::BlockMap::findLevelBlock ( int4  index) const
inline

Find the FlowBlock matching the given index.

Parameters
indexis the given index
Returns
the FlowBlock matching the index

Referenced by ghidra::BlockEdge::decode().

◆ resolveBlock()

FlowBlock * ghidra::BlockMap::resolveBlock ( FlowBlock::block_type  bt)
private

Construct a FlowBlock of the given type.

Parameters
btis the block_type
Returns
a new instance of the specialized FlowBlock

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