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

All paths from a (putative) switch variable to the CPUI_BRANCHIND. More...

#include <jumptable.hh>

Public Member Functions

void set (const PathMeld &op2)
 Copy paths from another container. More...
 
void set (const vector< PcodeOpNode > &path)
 Initialize this to be a single path. More...
 
void set (PcodeOp *op, Varnode *vn)
 Initialize this container to a single node "path". More...
 
void append (const PathMeld &op2)
 Append a new set of paths to this set of paths. More...
 
void clear (void)
 Clear this to be an empty container.
 
void meld (vector< PcodeOpNode > &path)
 Meld a new path into this container. More...
 
void markPaths (bool val, int4 startVarnode)
 Mark PcodeOps paths from the given start. More...
 
PcodeOpgetEarliestOp (int4 pos) const
 Find earliest PcodeOp that has a specific common Varnode as input. More...
 

Detailed Description

All paths from a (putative) switch variable to the CPUI_BRANCHIND.

This is a container for intersecting paths during the construction of a JumpModel. It contains every PcodeOp from some starting Varnode through all paths to a specific BRANCHIND. The paths can split and rejoin. This also keeps track of Varnodes that are present on all paths, as these are the potential switch variables for the model.

Member Function Documentation

◆ append()

void PathMeld::append ( const PathMeld op2)

Append a new set of paths to this set of paths.

The new paths must all start at the common end-point of the paths in this container. The new set of melded paths start at the original common start point for this container, flow through this old common end-point, and end at the new common end-point.

Parameters
op2is the set of paths to be appended

◆ getEarliestOp()

PcodeOp * PathMeld::getEarliestOp ( int4  pos) const

Find earliest PcodeOp that has a specific common Varnode as input.

The Varnode is specified by an index into sequence of Varnodes common to all paths in this PathMeld. We find the earliest (as in executed first) PcodeOp, within this PathMeld that uses the Varnode as input.

Parameters
posis the index of the Varnode
Returns
the earliest PcodeOp using the Varnode

◆ markPaths()

void PathMeld::markPaths ( bool  val,
int4  startVarnode 
)

Mark PcodeOps paths from the given start.

The starting Varnode, common to all paths, is provided as an index. All PcodeOps up to the final BRANCHIND are (un)marked.

Parameters
valis true for marking, false for unmarking
startVarnodeis the index of the starting PcodeOp

◆ meld()

void PathMeld::meld ( vector< PcodeOpNode > &  path)

Meld a new path into this container.

Add the new path, recalculating the set of Varnodes common to all paths. Paths are trimmed to ensure that any path that splits from the common intersection must eventually rejoin.

Parameters
pathis the new path of PcodeOpNode edges to meld, in reverse execution order

◆ set() [1/3]

void PathMeld::set ( const PathMeld op2)

Copy paths from another container.

Parameters
op2is the path container to copy from

◆ set() [2/3]

void PathMeld::set ( const vector< PcodeOpNode > &  path)

Initialize this to be a single path.

This container is initialized to hold a single data-flow path.

Parameters
pathis the list of PcodeOpNode edges in the path (in reverse execution order)

◆ set() [3/3]

void PathMeld::set ( PcodeOp op,
Varnode vn 
)

Initialize this container to a single node "path".

Parameters
opis the one PcodeOp in the path
vnis the one Varnode (input to the PcodeOp) in the path

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