83 vector<FuncCallSpecs *> &qlst;
85 vector<Address> unprocessed;
86 vector<Address> addrlist;
87 vector<PcodeOp *> tablelist;
88 vector<PcodeOp *> injectlist;
89 map<Address,VisitStat> visited;
90 list<PcodeOp *> block_edge1;
91 list<PcodeOp *> block_edge2;
98 bool flowoverride_present;
101 set<Address> *inline_recursion;
102 set<Address> inline_base;
105 void clearProperties(
void);
106 bool seenInstruction(
const Address &addr)
const {
107 return (visited.find(addr) != visited.end()); }
110 void deleteRemainingOps(list<PcodeOp *>::const_iterator oiter);
111 PcodeOp *xrefControlFlow(list<PcodeOp *>::const_iterator oiter,
bool &startbasic,
bool &isfallthru,
FuncCallSpecs *fc);
112 bool processInstruction(
const Address &curaddr,
bool &startbasic);
115 void findUnprocessed(
void);
116 void dedupUnprocessed(
void);
117 void fillinBranchStubs(
void);
118 void collectEdges(
void);
119 void splitBasic(
void);
120 void connectBasic(
void);
121 bool setFallthruBound(
Address &bound);
122 void handleOutOfBounds(
const Address &fromaddr,
const Address &toaddr);
124 void reinterpreted(
const Address &addr);
129 void xrefInlinedBranch(
PcodeOp *op);
131 void injectUserOp(
PcodeOp *op);
134 void checkContainedCall(
void);
135 void checkMultistageJumptables(
void);
137 void truncateIndirectJump(
PcodeOp *op,int4 failuremode);
138 static bool isInArray(vector<PcodeOp *> &array,
PcodeOp *op);
157 bool hasInject(
void)
const {
return !injectlist.empty(); }
bool hasInject(void) const
Does this flow have injections.
Definition: flow.hh:157
void inlineEZClone(const FlowInfo &inlineflow, const Address &calladdr)
Clone the given in-line flow into this flow using the EZ model.
Definition: flow.cc:1081
A class for analyzing parameters to a sub-function call.
Definition: fspec.hh:1436
Indicate the maximum instruction threshold was reached.
Definition: flow.hh:68
int4 getSize(void) const
Get the number of bytes covered by the flow.
Definition: flow.hh:156
bool isFlowForInline(void) const
Is this flow to be in-lined.
Definition: flow.hh:163
Context needed to emit a p-code injection as a full set of p-code operations.
Definition: pcodeinject.hh:56
bool hasTooManyInstructions(void) const
Does this flow have too many instructions.
Definition: flow.hh:162
Container for data structures associated with a single function.
Definition: funcdata.hh:45
void injectPcode(void)
Perform substitution on any op that requires injection.
Definition: flow.cc:1290
A class for generating the control-flow structure for a single function.
Definition: flow.hh:56
void setFlags(uint4 val)
Enable a specific option.
Definition: flow.hh:144
void inlineClone(const FlowInfo &inlineflow, const Address &retaddr)
Clone the given in-line flow into this flow using the hard model.
Definition: flow.cc:1047
Indicate we have encountered flow out of the specified range.
Definition: flow.hh:66
Throw an exception for flow into addresses out of the specified range.
Definition: flow.hh:60
Indicate that any jump table recovery should record the table structure.
Definition: flow.hh:71
Indicate a CALL was converted to a BRANCH and some code may be unreachable.
Definition: flow.hh:69
bool hasBadData(void) const
Does this flow reach inaccessible data.
Definition: flow.hh:159
Throw an exception for flow into unimplemented instructions.
Definition: flow.hh:61
bool testHardInlineRestrictions(Funcdata *inlinefd, PcodeOp *op, Address &retaddr)
For in-lining using the hard model, make sure some restrictions are met.
Definition: flow.cc:1106
An active container for a set of p-code operations that can be injected into data-flow.
Definition: pcodeinject.hh:78
void setMaximumInstructions(uint4 max)
Set the maximum number of instructions.
Definition: flow.hh:143
Utilities for processing data structures associated with a single function.
bool checkEZModel(void) const
Check if this flow matches the EX in-lining model.
Definition: flow.cc:1138
void forwardRecursion(const FlowInfo &op2)
Pull in-lining recursion information from another flow.
Definition: flow.cc:1016
Indicate we have encountered reinterpreted data.
Definition: flow.hh:67
void clearFlags(uint4 val)
Disable a specific option.
Definition: flow.hh:145
Lowest level operation of the p-code language.
Definition: op.hh:58
A low-level machine address for labelling bytes and data.
Definition: address.hh:46
Container class for PcodeOps associated with a single function.
Definition: op.hh:245
bool hasUnimplemented(void) const
Does this flow have unimiplemented instructions.
Definition: flow.hh:158
void setRange(const Address &b, const Address &e)
Establish the flow bounds.
Definition: flow.hh:142
Manager for all the major decompiler subsystems.
Definition: architecture.hh:117
bool hasOutOfBounds(void) const
Does this flow out of bound.
Definition: flow.hh:160
A control-flow block built out of sub-components.
Definition: block.hh:270
void generateBlocks(void)
Generate basic blocks from the raw control-flow.
Definition: flow.cc:797
uintb getOffset(void) const
Get the address offset.
Definition: address.hh:300
Ignore/truncate flow into addresses out of the specified range.
Definition: flow.hh:58
bool hasReinterpreted(void) const
Does this flow reinterpret bytes.
Definition: flow.hh:161
FlowInfo(Funcdata &d, PcodeOpBank &o, BlockGraph &b, vector< FuncCallSpecs *> &q)
Constructor.
Definition: flow.cc:24
A p-code emitter for building PcodeOp objects.
Definition: funcdata.hh:553
Indicate we have encountered unimplemented instructions.
Definition: flow.hh:64
Indicate we have encountered flow into unaccessible data.
Definition: flow.hh:65
Throw an exception for flow into previously encountered data at a difference cut. ...
Definition: flow.hh:62
bool doesJumpRecord(void) const
Should jump table structure be recorded.
Definition: flow.hh:164
Treat unimplemented instructions as a NOP (no operation)
Definition: flow.hh:59
PcodeOp * target(const Address &addr) const
Return first p-code op for instruction at given address.
Definition: flow.cc:113
void generateOps(void)
Generate raw control-flow from the function's base address.
Definition: flow.cc:749
PcodeOp * branchTarget(PcodeOp *op) const
Find the target referred to by a given BRANCH or CBRANCH.
Definition: flow.cc:185
Indicate flow is being generated to in-line (a function)
Definition: flow.hh:70
Throw an exception if too many instructions are encountered.
Definition: flow.hh:63
A class for uniquely labelling and comparing PcodeOps.
Definition: address.hh:111