#include <include/proc.h>
Inheritance diagram for UserProc:
Definition at line 313 of file proc.h.
Public Types | |
typedef std::map< Statement *, int > | RefCounter |
typedef std::multimap< Exp *, Exp *, lessExpStar > | SymbolMap |
A map between machine dependent locations and their corresponding symbolic, machine independent representations. | |
Public Member Functions | |
void | addCallee (Proc *callee) |
Add to the set of callees. | |
void | addCallees (std::list< UserProc * > &callees) |
Add to a set of callee Procs. | |
void | addImplicitAssigns () |
void | addLocal (Type *ty, const char *nam, Exp *e) |
Add a new local supplying all needed information. | |
void | addParameter (Exp *e, Type *ty) |
Add parameter to signature. | |
void | addParameterSymbols () |
void | assignProcsToCalls () |
find the procs the calls point to | |
void | branchAnalysis () |
bool | canProveNow () |
returns true if the prover is working right now | |
bool | canRename (Exp *e) |
void | castConst (int num, Type *ty) |
Cast the constant whose conscript is num to be type ty. | |
bool | checkForGainfulUse (Exp *e, ProcSet &visited) |
Reurn true if location e is used gainfully in this procedure. | |
void | checkLocalFor (RefExp *r) |
void | clearRanges () |
void | clearUses () |
Clear the useCollectors (in this Proc, and all calls). | |
void | complete () |
All the decompile stuff except propagation, DFA repair, and null/unused statement removal. | |
bool | containsAddr (ADDRESS uAddr) |
return true if this procedure contains the given address. | |
void | conTypeAnalysis () |
void | countRefs (RefCounter &refCounts) |
ProcSet * | decompile (ProcList *path, int &indent) |
Begin the decompile process at this procedure. | |
void | deleteCFG () |
Deletes the whole CFG and all the RTLs and Exps associated with it. | |
void | dfaTypeAnalysis () |
bool | doesParamChainToCall (Exp *param, UserProc *p, ProcSet *visited) |
bool | doesRecurseTo (UserProc *p) |
bool | doRenameBlockVars (int pass, bool clearStacks=false) |
void | dump () |
void | dumpLocals () |
void | dumpLocals (std::ostream &os, bool html=false) |
void | dumpSymbolMap () |
For debugging. | |
void | dumpSymbolMapx () |
For debugging. | |
void | earlyDecompile () |
Early decompile: Place phi functions, number statements, first rename, propagation: ready for preserveds. | |
void | eliminateDuplicateArgs () |
bool | ellipsisProcessing () |
Trim parameters to procedure calls with ellipsis (. | |
bool | existsLocal (char *name) |
True if a local exists with name name. | |
Exp * | expFromSymbol (const char *nam) |
return a symbol's exp (note: the original exp, like r24, not local1) | |
bool | filterParams (Exp *e) |
As above but for parameters and arguments. | |
bool | filterReturns (Exp *e) |
Decide whether to filter out e (return true) or keep it. | |
void | finalSimplify () |
perform final simplifications | |
void | findFinalParameters () |
char * | findFirstSymbol (Exp *e) |
void | findLiveAtDomPhi (LocationSet &usedByDomPhi) |
char * | findLocal (Exp *e, Type *ty) |
Determine whether e is a local, either as a true opLocal (e.g. | |
char * | findLocalFromRef (RefExp *r) |
void | findPhiUnites (ConnectionGraph &pu) |
void | findPreserveds () |
Was trimReturns(). | |
void | findSpPreservation () |
Preservations only for the stack pointer. | |
void | fixCallAndPhiRefs () |
Perform call and phi statement bypassing at all depths. | |
void | fixCallAndPhiRefs (int d) |
Perform call and phi statement bypassing at depth d. | |
void | fixRefs (int n, int depth, std::map< Exp *, Exp *, lessExpStar > &pres, StatementList &removes) |
Helper function for fixCallAndPhiRefs. | |
void | fixUglyBranches () |
void | fromSSAform () |
void | generateCode (HLLCode *hll) |
code generation | |
SyntaxNode * | getAST () |
Returns an abstract syntax tree for the procedure in the internal representation. | |
std::list< Proc * > & | getCallees () |
Get the callees. | |
Cfg * | getCFG () |
Returns a pointer to the CFG object. | |
DataFlow * | getDataFlow () |
Returns a pointer to the DataFlow object. | |
void | getDefinitions (LocationSet &defs) |
PBB | getEntryBB () |
Get the BB that is the entry point (not always the first BB). | |
const char * | getLocalName (int n) |
Type * | getLocalType (const char *nam) |
return a local's type | |
StatementList & | getModifieds () |
int | getNumLocals () |
StatementList & | getParameters () |
Type * | getParamType (const char *nam) |
virtual Exp * | getPremised (Exp *left) |
virtual Exp * | getProven (Exp *left) |
char * | getRegName (Exp *r) |
void | getStatements (StatementList &stmts) |
get all the statements | |
ProcStatus | getStatus () |
Statement * | getStmtAtLex (unsigned int begin, unsigned int end) |
Exp * | getSymbolExp (Exp *le, Type *ty=NULL, bool lastPass=false) |
Return an expression that is equivilent to e in terms of local variables. | |
Exp * | getSymbolFor (Exp *e, Type *ty) |
Lookup the expression in the symbol map. | |
char * | getSymbolName (Exp *e) |
As getLocalName, but look for expression e. | |
ADDRESS | getTheReturnAddr () |
ReturnStatement * | getTheReturnStatement () |
Type * | getTypeForLocation (Exp *e) |
bool | inductivePreservation (UserProc *topOfCycle) |
void | initialiseDecompile () |
Initialise decompile: sort CFG, number statements, dominator tree, etc. | |
void | initialParameters () |
Get initial parameters based on proc's use collector. | |
void | initStatements () |
Initialise the statements, e.g. proc, bb pointers. | |
void | insertAssignAfter (Statement *s, Exp *left, Exp *right) |
void | insertCasts () |
Inserting casts as needed (for this procedure). | |
void | insertParameter (Exp *e, Type *ty) |
Insert into parameters list correctly sorted. | |
void | insertStatementAfter (Statement *s, Statement *a) |
bool | isAddressEscapedVar (Exp *e) |
bool | isDecoded () |
Returns whether or not this procedure can be decoded (i.e. | |
bool | isDecompiled () |
bool | isEarlyRecursive () |
bool | isLocal (Exp *e) |
True if e represents a stack local variable. | |
bool | isLocalOrParam (Exp *e) |
True if e represents a stack local or stack param. | |
bool | isLocalOrParamPattern (Exp *e) |
True if e could represent a stack local or stack param. | |
virtual bool | isNoReturn () |
Return true if this procedure doesn't return. | |
virtual bool | isPreserved (Exp *e) |
Return whether e is preserved by this proc. | |
bool | isPropagatable (Exp *e) |
True if e can be propagated. | |
bool | isRetNonFakeUsed (CallStatement *c, Exp *loc, UserProc *p, ProcSet *visited) |
bool | isSorted () |
void | killPremise (Exp *e) |
void | logSuspectMemoryDefs () |
char * | lookupParam (Exp *e) |
char * | lookupSym (Exp *e, Type *ty) |
Lookup the symbol map considering type. | |
char * | lookupSymFromRef (RefExp *r) |
char * | lookupSymFromRefAny (RefExp *r) |
void | makeParamsImplicit () |
void | makeSymbolsImplicit () |
void | mapExpressionsToLocals (bool lastPass=false) |
void | mapLocalsAndParams () |
Map expressions to locals and initial parameters. | |
void | mapParameters () |
void | mapSymbolTo (Exp *from, Exp *to) |
void | mapSymbolToRepl (Exp *from, Exp *oldTo, Exp *newTo) |
As above but with replacement. | |
void | mapTempsToLocals () |
void | markAsNonChildless (ProcSet *cs) |
ProcSet * | middleDecompile (ProcList *path, int indent) |
Middle decompile: All the decompilation from preservation up to but not including removing unused statements. | |
void | nameParameterPhis () |
bool | nameStackLocations () |
Exp * | newLocal (Type *ty, Exp *e, char *nam=NULL) |
Return the next available local variable; make it the given type. | |
char * | newLocalName (Exp *e) |
int | nextParamNum () |
void | numberStatements () |
void | placePhiFunctions () |
void | prePresDecompile () |
Prepare for preservation analysis only. | |
void | print (std::ostream &out, bool html=false) |
print this proc, mainly for debugging | |
void | printAnalysedXML () |
void | printAST (SyntaxNode *a=NULL) |
virtual void | printCallGraphXML (std::ostream &os, int depth, bool recurse=true) |
void | printDecodedXML () |
void | printDFG () |
void | printLocalsAsC (std::ostream &os) |
Print the locals declaration in C style. | |
void | printParams (std::ostream &out, bool html=false) |
char * | prints () |
void | printSSAXML () |
void | printSymbolMap (std::ostream &out, bool html=false) |
Print just the symbol map. | |
void | printToLog () |
void | printUseGraph () |
void | printXML () |
void | processDecodedICTs () |
Copy the decoded indirect control transfer instructions' RTLs to the front end's map, and decode any new targets for this CFG. | |
void | processFloatConstants () |
void | promoteSignature () |
promote the signature if possible | |
bool | propagateAndRemoveStatements () |
bool | propagateStatements (bool &convert, int pass) |
Propagate statemtents; return true if change; set convert if an indirect call is converted to direct (else clear). | |
void | propagateToCollector () |
bool | prove (Exp *query, bool conditional=false) |
prove any arbitary property of this procedure. | |
bool | prover (Exp *query, std::set< PhiAssign * > &lastPhis, std::map< PhiAssign *, Exp * > &cache, Exp *original, PhiAssign *lastPhi=NULL) |
helper function, should be private | |
void | rangeAnalysis () |
void | recursionGroupAnalysis (ProcList *path, int indent) |
Analyse the whole group of procedures for conditional preserveds, and update till no change. | |
void | removeCallLiveness () |
bool | removeDeadStatements () |
void | removeMatchingAssignsIfPossible (Exp *e) |
bool | removeNullStatements () |
bool | removeRedundantParameters () |
void | removeRedundantPhis () |
bool | removeRedundantReturns (std::set< UserProc * > &removeRetSet) |
Remove any returns that are not used by any callers return true if any returns are removed. | |
virtual void | removeReturn (Exp *e) |
void | removeSpAssignsIfPossible () |
void | removeStatement (Statement *stmt) |
remove a statement | |
void | removeSubscriptsFromParameters () |
void | removeSubscriptsFromSymbols () |
void | removeSymbolMapping (Exp *from, Exp *to) |
void | removeUnusedLocals () |
void | remUnusedStmtEtc (RefCounter &refCounts) |
void | remUnusedStmtEtc () |
Remove unused statements. | |
void | renameLocal (const char *oldName, const char *newName) |
virtual void | renameParam (const char *oldName, const char *newName) |
void | reverseStrengthReduction () |
bool | searchAll (Exp *search, std::list< Exp * > &result) |
bool | searchAndReplace (Exp *search, Exp *replace) |
void | setDecoded () |
Records that this procedure has been decoded. | |
void | setDominanceNumbers () |
void | setEntryBB () |
Set the entry BB for this procedure (constructor has the entry address). | |
void | setExpSymbol (const char *nam, Exp *e, Type *ty) |
void | setImplicitRef (Statement *s, Exp *a, Type *ty) |
Find and if necessary insert an implicit reference before s whose address expression is a and type is t. | |
void | setLocalType (const char *nam, Type *ty) |
void | setParamType (int idx, Type *ty) |
void | setParamType (const char *nam, Type *ty) |
Get a name like eax or o2 from r24 or r8. | |
void | setPremise (Exp *e) |
void | setSorted () |
void | setStatus (ProcStatus s) |
void | setTheReturnAddr (ReturnStatement *s, ADDRESS r) |
void | simplify () |
simplify the statements in this proc | |
void | testSymbolMap () |
For debugging. | |
void | toSymbolic (TypedExp *loc, TypedExp *result, bool local=true) |
Given a machine dependent location, return a generated symbolic representation for it. | |
void | trimParameters (int depth=-1) |
Trim parameters. If depth not given or == -1, perform at all depths. | |
void | typeAnalysis () |
Global type analysis (for this procedure). | |
void | unDecode () |
Removes the decoded bit and throws away all the current information about this procedure. | |
void | undoComputedBB (Statement *stmt) |
Change BB containing this statement from a COMPCALL to a CALL. | |
void | updateArguments () |
Update the arguments in calls. | |
void | updateCallDefines () |
Update the defines in calls. | |
void | updateCalls () |
void | updateForUseChange (std::set< UserProc * > &removeRetSet) |
Update parameters and call livenesses to take into account the changes causes by removing a return from this procedure, or a callee's parameter (which affects this procedure's arguments, which are also uses). | |
void | updateReturnTypes () |
void | useBeforeDefine (Exp *loc) |
Add a location to the UseCollector; this means this location is used before defined, and hence is an initial* parameter. | |
UserProc (Prog *prog, std::string &name, ADDRESS address) | |
void | windowsModeDecompile () |
virtual | ~UserProc () |
Protected Member Functions | |
void | setCFG (Cfg *c) |
UserProc () | |
Private Member Functions | |
void | addToStackMap (int c, Type *ty) |
function to do safe adding. | |
void | checkMemSize (Exp *e) |
Implement the above for one given Exp*. | |
void | checkMemSizes () |
A special pass to check the sizes of memory that is about to be converted into a var, ensuring that the largest size used in the proc is used for all references (and it's declared that size). | |
Exp ** | findVarEntry (int idx) |
Find a pointer to the Exp* representing the given var Used by the above 2. | |
void | searchRegularLocals (OPER minusOrPlus, bool lastPass, int sp, StatementList &stmts) |
Private Attributes | |
LocationSet | addressEscapedVars |
The set of address-escaped locals and parameters. | |
std::list< Proc * > | calleeList |
Set of callees (Procedures that this procedure calls). | |
Cfg * | cfg |
The control flow graph. | |
UseCollector | col |
A collector for initial parameters (locations used before being defined). | |
ProcSet * | cycleGrp |
Pointer to a set of procedures involved in a recursion group. | |
DataFlow | df |
DataFlow object. | |
int | DFGcount |
std::map< std::string, Type * > | locals |
DataIntervalMap | localTable |
The local "symbol table", which is aware of overlaps. | |
int | nextLocal |
int | nextParam |
StatementList | parameters |
The list of parameters, ordered and filtered. | |
std::map< int, Type * > | stackMap |
A map of stack locations (negative values) to types. | |
ProcStatus | status |
The status of this user procedure. | |
int | stmtNumber |
Current statement number. | |
SymbolMap | symbolMap |
ReturnStatement * | theReturnStatement |
We ensure that there is only one return statement now. | |
Friends | |
class | XMLProgParser |
|
|
|
A map between machine dependent locations and their corresponding symbolic, machine independent representations. Example: m[r28{0} - 8] -> local5; this means that *after* transforming out of SSA form, any locations not specifically mapped otherwise (e.g. m[r28{0} - 8]{55} -> local6) will get this name. It is a *multi*map because one location can have several default names differentiated by type. E.g. r24 -> eax for int, r24 -> eax_1 for float |
|
Definition at line 426 of file proc.cpp. References cfg, localTable, DataIntervalMap::setProc(), and Cfg::setProc(). |
|
Definition at line 438 of file proc.cpp. References cfg. |
|
Definition at line 420 of file proc.cpp. References localTable, and DataIntervalMap::setProc(). |
|
Add to the set of callees.
Definition at line 599 of file proc.cpp. References calleeList. Referenced by addCallees(), and CallStatement::rangeAnalysis(). |
|
Add to a set of callee Procs.
Definition at line 3728 of file proc.cpp. References addCallee(), and calleeList. |
|
Definition at line 3913 of file proc.cpp. References Boomerang::alert_decompile_debug_point(), StatementList::begin(), cfg, StatementList::end(), Boomerang::get(), and getStatements(). Referenced by typeAnalysis(). |
|
Add a new local supplying all needed information.
Definition at line 2777 of file proc.cpp. References Location::local(), locals, and mapSymbolTo(). Referenced by checkLocalFor(). |
|
Add parameter to signature.
Definition at line 2351 of file proc.cpp. References Signature::addParameter(), Proc::removeParameter(), and Proc::signature. |
|
Definition at line 2393 of file proc.cpp. References StatementList::begin(), cfg, StatementList::end(), Signature::getParamName(), mapSymbolTo(), Location::param(), parameters, Proc::signature, and to. Referenced by remUnusedStmtEtc(). |
|
function to do safe adding.
|
|
find the procs the calls point to
Definition at line 2055 of file proc.cpp. References cfg, Prog::findProc(), CallStatement::getDestProc(), Cfg::getFirstBB(), GotoStatement::getFixedDest(), Cfg::getNextBB(), BasicBlock::getRTLs(), GotoStatement::isComputed(), NULL, Proc::prog, and CallStatement::setDestProc(). Referenced by Prog::finishDecode(). |
|
Definition at line 1751 of file proc.cpp. References Boomerang::alert_decompile_debug_point(), StatementList::begin(), cfg, StatementList::end(), Boomerang::get(), getStatements(), opAnd, opNot, Cfg::removeBB(), and Exp::simplify(). Referenced by remUnusedStmtEtc(). |
|
returns true if the prover is working right now
|
|
Definition at line 535 of file proc.h. References DataFlow::canRename(), and df. Referenced by CallStatement::updateArguments(). |
|
Cast the constant whose conscript is num to be type ty.
Definition at line 3881 of file proc.cpp. References StatementList::begin(), StatementList::end(), and getStatements(). |
|
Reurn true if location e is used gainfully in this procedure. visited is a set of UserProcs already visited. Definition at line 4686 of file proc.cpp. References Exp::addUsedLocs(), StatementList::begin(), checkForGainfulUse(), doesRecurseTo(), StatementList::end(), LocationSet::existsImplicit(), getStatements(), Statement::isCall(), and Proc::isLib(). Referenced by checkForGainfulUse(), and removeRedundantParameters(). |
|
Definition at line 5452 of file proc.cpp. References addLocal(), existsLocal(), RefExp::getDef(), getRegName(), Unary::getSubExp1(), Statement::getTypeFor(), Exp::isRegOf(), lookupSymFromRefAny(), and newLocalName(). Referenced by ExpRegMapper::visit(). |
|
Implement the above for one given Exp*.
|
|
A special pass to check the sizes of memory that is about to be converted into a var, ensuring that the largest size used in the proc is used for all references (and it's declared that size).
|
|
Definition at line 5056 of file proc.cpp. References StatementList::begin(), StatementList::end(), and getStatements(). Referenced by rangeAnalysis(). |
|
Clear the useCollectors (in this Proc, and all calls).
Definition at line 5000 of file proc.cpp. References Cfg::begin(), cfg, UseCollector::clear(), col, Cfg::end(), Proc::getName(), LOG, and NULL. |
|
All the decompile stuff except propagation, DFA repair, and null/unused statement removal.
|
|
return true if this procedure contains the given address.
Definition at line 164 of file proc.cpp. References cfg, Cfg::getFirstBB(), and Cfg::getNextBB(). Referenced by Prog::findContainingProc(). |
|
Definition at line 3739 of file proc.cpp. References Constraints::addConstraints(), StatementList::begin(), LocationSet::clear(), StatementList::end(), Proc::getName(), getStatements(), and LOG. |
|
Definition at line 2892 of file proc.cpp. References LocationSet::begin(), StatementList::begin(), DEBUG_UNUSED, LocationSet::end(), StatementList::end(), RefExp::getDef(), getStatements(), Statement::isImplicit(), and LOG. Referenced by remUnusedStmtEtc(). |
|
Begin the decompile process at this procedure. path is a list of pointers to procedures, representing the path from the current entry point to the current procedure in the call graph. Pass an empty set at the top level. indent is the indentation level; pass 0 at the top level Definition at line 953 of file proc.cpp. References Boomerang::alert_considering(), CALL, cfg, child(), Boomerang::get(), Cfg::getFirstBB(), BasicBlock::getLowAddr(), Proc::getName(), Cfg::getNextBB(), BasicBlock::getRTLs(), BasicBlock::getType(), LOG, NULL, PROC_DECODED, PROC_EARLYDONE, PROC_FINAL, PROC_VISITED, Proc::prog, Prog::reDecode(), setStatus(), status, and VERBOSE. Referenced by StatementTest::testEmpty(), StatementTest::testEndlessLoop(), StatementTest::testFlow(), StatementTest::testKill(), StatementTest::testUse(), StatementTest::testUseKill(), StatementTest::testUseOverBB(), and StatementTest::testUseOverKill(). |
|
Deletes the whole CFG and all the RTLs and Exps associated with it. Also nulls the internal cfg pointer (to prevent strange errors) Definition at line 450 of file proc.cpp. Referenced by Prog::remProc(). |
|
Definition at line 73 of file dfa.cpp. References Boomerang::alert_decompile_debug_point(), StatementList::begin(), cfg, DEBUG_TA, DFA_ITER_LIMIT, Signature::dfaTypeAnalysis(), StatementList::end(), Boomerang::get(), getStatements(), LOG, and Proc::signature. Referenced by typeAnalysis(). |
|
Definition at line 4593 of file proc.cpp. References StatementList::begin(), Cfg::begin(), cfg, StatementList::end(), Cfg::end(), Exp::getSubExp1(), Proc::isLib(), and NULL. |
|
Definition at line 460 of file proc.h. References cycleGrp. Referenced by checkForGainfulUse(). |
|
Definition at line 1856 of file proc.cpp. References df, Proc::getName(), LOG, DataFlow::renameBlockVars(), and VERBOSE. Referenced by earlyDecompile(), middleDecompile(), remUnusedStmtEtc(), and typeAnalysis(). |
|
Definition at line 713 of file proc.cpp. References print(). |
|
Definition at line 4060 of file proc.cpp. Referenced by print(). |
|
Definition at line 4003 of file proc.cpp. References expFromSymbol(), and locals. |
|
For debugging.
Definition at line 4021 of file proc.cpp. References getTypeForLocation(), and symbolMap. |
|
For debugging.
Definition at line 4030 of file proc.cpp. References getTypeForLocation(), and symbolMap. |
|
Early decompile: Place phi functions, number statements, first rename, propagation: ready for preserveds.
Definition at line 1160 of file proc.cpp. References Boomerang::alert_decompile_debug_point(), df, doRenameBlockVars(), Boomerang::get(), Proc::getName(), LOG, numberStatements(), DataFlow::placePhiFunctions(), printToLog(), PROC_EARLYDONE, propagateStatements(), status, updateCallDefines(), and VERBOSE. |
|
Definition at line 5248 of file proc.cpp. References Cfg::begin(), cfg, Cfg::end(), Proc::getName(), LOG, and NULL. |
|
Trim parameters to procedure calls with ellipsis (. ..). Also add types for ellipsis parameters, if any Returns true if any signature types so added. Definition at line 3892 of file proc.cpp. References Cfg::begin(), cfg, Cfg::end(), NULL, and Proc::prog. Referenced by typeAnalysis(). |
|
True if a local exists with name name.
Definition at line 5447 of file proc.cpp. References locals. Referenced by checkLocalFor(). |
|
return a symbol's exp (note: the original exp, like r24, not local1)
Definition at line 2863 of file proc.cpp. References symbolMap. Referenced by CHLLCode::AddLocal(), dumpLocals(), StatementList::findOnLeft(), and renameLocal(). |
|
As above but for parameters and arguments.
Definition at line 4217 of file proc.cpp. References addr(), Exp::getOper(), Signature::getStackRegister(), opMemOf, opPC, opRegOf, Proc::prog, and Proc::signature. Referenced by insertParameter(), and CallStatement::updateArguments(). |
|
Decide whether to filter out e (return true) or keep it.
Definition at line 4191 of file proc.cpp. References Exp::getOper(), isPreserved(), opCF, opFlags, opGlobal, opMemOf, opPC, and opZF. Referenced by ReturnStatement::updateReturns(). |
|
perform final simplifications
Definition at line 2089 of file proc.cpp. References cfg, Cfg::getFirstBB(), Cfg::getNextBB(), BasicBlock::getRTLs(), NULL, and BasicBlock::simplify(). Referenced by Prog::finishDecode(). |
|
Definition at line 2127 of file proc.cpp. References Boomerang::alert_decompile_debug_point(), LocationSet::begin(), cfg, StatementList::clear(), Exp::clone(), LocationSet::end(), Boomerang::get(), Signature::getNumParams(), Signature::getParamExp(), Signature::isForced(), NULL, parameters, and Proc::signature. Referenced by remUnusedStmtEtc(). |
|
Definition at line 4276 of file proc.cpp. References NULL, and symbolMap. Referenced by nameParameterPhis(), DfaLocalMapper::preVisit(), ComplexityFinder::visit(), and UsedLocalFinder::visit(). |
|
Definition at line 5344 of file proc.cpp. References df, DataFlow::findLiveAtDomPhi(), NULL, and LocationSet::remove(). Referenced by propagateStatements(). |
|
Determine whether e is a local, either as a true opLocal (e.g. generated by fromSSA), or if it is in the symbol map and the name is in the locals map. If it is a local, return its name, else NULL Definition at line 4248 of file proc.cpp. References Exp::isLocal(), locals, lookupSym(), and NULL. Referenced by CallStatement::calcResults(), and UsedLocalFinder::visit(). |
|
Definition at line 4262 of file proc.cpp. References RefExp::getDef(), Unary::getSubExp1(), Statement::getTypeFor(), locals, lookupSym(), and NULL. |
|
Definition at line 5371 of file proc.cpp. References PhiAssign::begin(), StatementList::begin(), ConnectionGraph::connect(), PhiAssign::end(), StatementList::end(), Assignment::getLeft(), getStatements(), Statement::isPhi(), and NULL. |
|
Was trimReturns().
Definition at line 1897 of file proc.cpp. References Boomerang::alert_decompile_debug_point(), StatementList::begin(), DEBUG_PROOF, StatementList::end(), Boomerang::get(), ReturnStatement::getModifieds(), Proc::getName(), LOG, NULL, opEquals, prove(), theReturnStatement, and VERBOSE. Referenced by middleDecompile(). |
|
Preservations only for the stack pointer.
Definition at line 1865 of file proc.cpp. References DEBUG_PROOF, Proc::getName(), Signature::getStackRegister(), LOG, opEquals, opPlus, Proc::prog, prove(), Location::regOf(), Proc::signature, sp, and VERBOSE. Referenced by middleDecompile(). |
|
Find a pointer to the Exp* representing the given var Used by the above 2.
|
|
Perform call and phi statement bypassing at all depths.
Definition at line 4311 of file proc.cpp. References Boomerang::alert_decompile_debug_point(), StatementList::begin(), Exp::clone(), StatementList::end(), Boomerang::get(), CallStatement::getArguments(), Proc::getName(), Exp::getOper(), Signature::getStackRegister(), getStatements(), Exp::getSubExp1(), Exp::getSubExp2(), Exp::isIntConst(), Exp::isRegN(), Exp::isSubscript(), LOG, Location::memOf(), NULL, and Proc::signature. Referenced by middleDecompile(). |
|
Perform call and phi statement bypassing at depth d.
|
|
Helper function for fixCallAndPhiRefs.
|
|
Definition at line 1815 of file proc.cpp. References StatementList::begin(), StatementList::end(), Proc::getName(), getStatements(), LOG, opGtrEq, opMinus, and VERBOSE. Referenced by remUnusedStmtEtc(). |
|
Definition at line 3031 of file proc.cpp. References Boomerang::alert_decompile_debug_point(), Boomerang::alert_decompiling(), StatementList::begin(), cfg, StatementList::end(), Boomerang::get(), Proc::getName(), Cfg::getNumBBs(), getStatements(), and LOG. |
|
code generation
Definition at line 609 of file proc.cpp. References HLLCode::AddLocal(), HLLCode::AddProcStart(), cfg, Boomerang::get(), getEntryBB(), locals, NULL, printToLog(), removeUnusedLocals(), Cfg::structure(), and VERBOSE. |
|
Returns an abstract syntax tree for the procedure in the internal representation. This function actually _calculates_ * this value and is expected to do so expensively. Definition at line 463 of file proc.cpp. References BlockSyntaxNode::addStatement(), cfg, Cfg::getFirstBB(), and Cfg::getNextBB(). Referenced by printAST(). |
|
Get the callees.
Definition at line 793 of file proc.h. References calleeList. Referenced by Prog::printCallGraph(). |
|
|
Returns a pointer to the DataFlow object.
Definition at line 436 of file proc.h. References df. Referenced by StatementTest::testBypass(), CfgTest::testDominators(), CfgTest::testPlacePhi(), CfgTest::testPlacePhi2(), CfgTest::testRenameVars(), and CfgTest::testSemiDominators(). |
|
Definition at line 3713 of file proc.cpp. References Signature::getNumReturns(), Signature::getReturnExp(), LocationSet::insert(), and Proc::signature. |
|
Get the BB that is the entry point (not always the first BB).
Definition at line 573 of file proc.cpp. References cfg, and Cfg::getEntryBB(). Referenced by generateCode(), and PentiumFrontEnd::processProc(). |
|
|
|
return a local's type
Definition at line 2786 of file proc.cpp. Referenced by getSymbolFor(), lookupSym(), and StmtSsaXformer::visit(). |
|
Definition at line 685 of file proc.h. References ReturnStatement::getModifieds(), and theReturnStatement. |
|
Definition at line 760 of file proc.h. References locals. |
|
Definition at line 684 of file proc.h. References parameters. |
|
Definition at line 2801 of file proc.cpp. References Signature::getNumParams(), Signature::getParamName(), Signature::getParamType(), NULL, and Proc::signature. Referenced by getSymbolFor(), and lookupSym(). |
|
Implements Proc. Definition at line 3870 of file proc.cpp. References NULL, and Proc::recurPremises. |
|
Implements Proc. Definition at line 3859 of file proc.cpp. References NULL, and Proc::provenTrue. Referenced by mapExpressionsToLocals(), and CallingConvention::Win32Signature::qualified(). |
|
Definition at line 5389 of file proc.cpp. References Prog::getRegName(), Exp::isRegOf(), and Proc::prog. Referenced by checkLocalFor(), and newLocalName(). |
|
|
Definition at line 465 of file proc.h. References status. Referenced by Decompiler::procStatus(). |
|
Definition at line 2724 of file proc.cpp. References StatementList::begin(), StatementList::end(), Statement::getLexBegin(), getStatements(), and NULL. Referenced by Prog::getStmtAtLex(). |
|
Return an expression that is equivilent to e in terms of local variables. Creates new locals as needed. Definition at line 2407 of file proc.cpp. References Exp::getOper(), Signature::getStackRegister(), Exp::getSubExp1(), Exp::getSubExp2(), Exp::isIntConst(), Exp::isMemOf(), Exp::isRegN(), Exp::isSubscript(), locals, LOG, m, Location::memOf(), NULL, opAddrOf, opMinus, opPlus, Proc::signature, and symbolMap. Referenced by DfaLocalMapper::processExp(), searchRegularLocals(), and TempToLocalMapper::visit(). |
|
Lookup the expression in the symbol map. Return NULL or a C string with the symbol. Use the Type* ty to select from several names in the multimap; the name corresponding to the first compatible type is returned Definition at line 2834 of file proc.cpp. References getLocalType(), getParamType(), Type::isCompatibleWith(), NULL, and symbolMap. Referenced by renameLocal(). |
|
As getLocalName, but look for expression e.
Definition at line 2881 of file proc.cpp. References Exp::getSubExp1(), Exp::isLocal(), Exp::isParam(), NULL, and symbolMap. |
|
Definition at line 857 of file proc.h. References ReturnStatement::getRetAddr(), NO_ADDRESS, NULL, and theReturnStatement. Referenced by FrontEnd::createReturnBlock(). |
|
Definition at line 863 of file proc.h. References theReturnStatement. Referenced by CHLLCode::AddProcDec(). |
|
Definition at line 5397 of file proc.cpp. References Exp::isLocal(), and locals. Referenced by dumpSymbolMap(), dumpSymbolMapx(), and printSymbolMap(). |
|
|
|
Initialise decompile: sort CFG, number statements, dominator tree, etc.
Definition at line 1116 of file proc.cpp. References Boomerang::alert_decompile_debug_point(), Boomerang::alert_start_decompile(), cfg, df, DataFlow::dominators(), Boomerang::get(), Proc::getName(), initStatements(), LOG, numberStatements(), printToLog(), printXML(), PROC_FINAL, setStatus(), Cfg::sortByAddress(), stmtNumber, and VERBOSE. |
|
Get initial parameters based on proc's use collector.
Definition at line 4527 of file proc.cpp. References StatementList::append(), UseCollector::begin(), StatementList::clear(), col, UseCollector::end(), Proc::getName(), LOG, parameters, and printParams(). |
|
Initialise the statements, e.g. proc, bb pointers.
Definition at line 766 of file proc.cpp. References cfg, CallStatement::getDestProc(), Cfg::getExitBB(), Cfg::getFirstBB(), Cfg::getNextBB(), BasicBlock::getNumInEdges(), Proc::isNoReturn(), and CallStatement::setSigArguments(). Referenced by initialiseDecompile(), and StatementTest::testBypass(). |
|
Definition at line 854 of file proc.cpp. References cfg, Statement::getBB(), Cfg::getEntryBB(), BasicBlock::getRTLs(), NULL, and Statement::setProc(). |
|
Inserting casts as needed (for this procedure).
|
|
Insert into parameters list correctly sorted.
Definition at line 4155 of file proc.cpp. References Signature::argumentCompare(), StatementList::begin(), Exp::clone(), Type::clone(), StatementList::end(), filterParams(), StatementList::insert(), parameters, and Proc::signature. |
|
Definition at line 881 of file proc.cpp. References Cfg::begin(), cfg, Cfg::end(), BasicBlock::getRTLs(), and NULL. |
|
Definition at line 579 of file proc.h. References addressEscapedVars, and LocationSet::exists(). Referenced by DataFlow::canRename(). |
|
Returns whether or not this procedure can be decoded (i.e. has it already been decoded). Definition at line 457 of file proc.h. References PROC_DECODED, and status. Referenced by Prog::decodeEverythingUndecoded(), Prog::finishDecode(), Prog::generateDotFile(), Prog::generateRTL(), Prog::getStmtAtLex(), and Prog::print(). |
|
Definition at line 458 of file proc.h. References PROC_FINAL, and status. |
|
Definition at line 459 of file proc.h. References cycleGrp, NULL, PROC_INCYCLE, and status. |
|
True if e represents a stack local variable.
Definition at line 4547 of file proc.cpp. References Exp::isLocal(), Exp::isMemOf(), and symbolMap. Referenced by isLocalOrParam(). |
|
True if e represents a stack local or stack param.
Definition at line 4560 of file proc.cpp. References StatementList::existsOnLeft(), isLocal(), and parameters. Referenced by isPropagatable(). |
|
True if e could represent a stack local or stack param.
Definition at line 4566 of file proc.cpp. References addr(), Signature::getStackRegister(), Exp::getSubExp2(), Exp::isIntConst(), Exp::isMemOf(), Signature::isPromoted(), NULL, Location::regOf(), and Proc::signature. Referenced by DataFlow::canRename(), DfaLocalMapper::processExp(), and ExpRegMapper::visit(). |
|
Return true if this procedure doesn't return.
Implements Proc. Definition at line 140 of file proc.cpp. References cfg, CallStatement::getDestProc(), Cfg::getExitBB(), BasicBlock::getInEdges(), BasicBlock::getNumInEdges(), Proc::isNoReturn(), and NULL. |
|
Return whether e is preserved by this proc.
Implements Proc. Definition at line 3877 of file proc.cpp. References Proc::provenTrue. Referenced by filterReturns(). |
|
True if e can be propagated.
Definition at line 4555 of file proc.cpp. References addressEscapedVars, LocationSet::exists(), and isLocalOrParam(). |
|
Definition at line 4633 of file proc.cpp. References LocationSet::begin(), StatementList::begin(), LocationSet::end(), StatementList::end(), getStatements(), and Exp::getSubExp1(). |
|
Definition at line 462 of file proc.h. References PROC_SORTED, and status. |
|
Definition at line 826 of file proc.h. References Proc::recurPremises. |
|
Definition at line 5137 of file proc.cpp. References StatementList::begin(), StatementList::end(), getStatements(), LOG, and opInitValueOf. |
|
Definition at line 3933 of file proc.cpp. References cfg, Cfg::findTheImplicitAssign(), Statement::getTypeFor(), LOG, lookupSym(), and NULL. Referenced by mapParameters(). |
|
Lookup the symbol map considering type.
Definition at line 3962 of file proc.cpp. References getLocalType(), getParamType(), Exp::getSubExp1(), Type::isCompatibleWith(), Exp::isTypedExp(), NULL, and symbolMap. Referenced by CHLLCode::appendExp(), findLocal(), findLocalFromRef(), isBareMemof(), lookupParam(), lookupSymFromRef(), lookupSymFromRefAny(), nameParameterPhis(), BadMemofFinder::visit(), and UsedLocalFinder::visit(). |
|
Definition at line 3945 of file proc.cpp. References RefExp::getDef(), Unary::getSubExp1(), Statement::getTypeFor(), and lookupSym(). |
|
Definition at line 3952 of file proc.cpp. References RefExp::getDef(), Unary::getSubExp1(), Statement::getTypeFor(), and lookupSym(). Referenced by checkLocalFor(), StmtSsaXformer::commonLhs(), ExpSsaXformer::postVisit(), and StmtSsaXformer::visit(). |
|
Definition at line 5334 of file proc.cpp. References Exp::accept(), StatementList::begin(), cfg, StatementList::end(), and parameters. |
|
Definition at line 5323 of file proc.cpp. References cfg, mapSymbolTo(), and symbolMap. |
|
|
Map expressions to locals and initial parameters.
Definition at line 5308 of file proc.cpp. References Boomerang::alert_decompile_debug_point(), StatementList::begin(), Statement::dfaMapLocals(), StatementList::end(), Boomerang::get(), Proc::getName(), getStatements(), and LOG. |
|
Definition at line 3325 of file proc.cpp. References StatementList::begin(), Exp::clone(), StatementList::end(), LOG, lookupParam(), NULL, Location::param(), parameters, and Exp::removeSubscripts(). |
|
Definition at line 2820 of file proc.cpp. Referenced by addLocal(), addParameterSymbols(), makeSymbolsImplicit(), mapSymbolToRepl(), and setExpSymbol(). |
|
As above but with replacement.
Definition at line 2815 of file proc.cpp. References mapSymbolTo(), and removeSymbolMapping(). Referenced by renameLocal(). |
|
Definition at line 5274 of file proc.cpp. References PhiAssign::accept(), StatementList::begin(), StatementList::end(), and getStatements(). |
|
Definition at line 4474 of file proc.cpp. References cfg, Cfg::getFirstBB(), BasicBlock::getLastStmt(), and Cfg::getNextBB(). |
|
Middle decompile: All the decompilation from preservation up to but not including removing unused statements. Returns the cycle set from the recursive call to decompile() Definition at line 1208 of file proc.cpp. References Boomerang::alert_decompile_debug_point(), Boomerang::alert_decompile_SSADepth(), df, doRenameBlockVars(), findPreserveds(), findSpPreservation(), fixCallAndPhiRefs(), Boomerang::get(), Proc::getName(), LOG, numberStatements(), DataFlow::placePhiFunctions(), printDFG(), printToLog(), printXML(), PROC_INCYCLE, promoteSignature(), propagateStatements(), reverseStrengthReduction(), status, theReturnStatement, updateArguments(), updateCallDefines(), ReturnStatement::updateModifieds(), ReturnStatement::updateReturns(), and VERBOSE. |
|
Definition at line 5413 of file proc.cpp. References PhiAssign::begin(), StatementList::begin(), PhiAssign::end(), StatementList::end(), findFirstSymbol(), Assignment::getLeft(), getStatements(), TypingStatement::getType(), Statement::isPhi(), lookupSym(), and NULL. |
|
|
|
Return the next available local variable; make it the given type. Note: was returning TypedExp*. If nam is non null, use that name Definition at line 2761 of file proc.cpp. References Type::getCtype(), Location::local(), locals, LOG, newLocalName(), and NULL. |
|
Definition at line 2745 of file proc.cpp. References getRegName(), Exp::isSubscript(), and locals. Referenced by checkLocalFor(), and newLocal(). |
|
Definition at line 562 of file proc.h. References nextParam. |
|
Definition at line 788 of file proc.cpp. References cfg, Cfg::getFirstBB(), Cfg::getNextBB(), and stmtNumber. Referenced by earlyDecompile(), initialiseDecompile(), middleDecompile(), remUnusedStmtEtc(), StatementTest::testBypass(), and CfgTest::testRenameVars(). |
|
Definition at line 529 of file proc.h. References df, and DataFlow::placePhiFunctions(). |
|
Prepare for preservation analysis only.
|
|
print this proc, mainly for debugging
Definition at line 654 of file proc.cpp. References cfg, Proc::cluster, col, dumpLocals(), Cluster::getName(), Cfg::print(), UseCollector::print(), Signature::print(), printParams(), printSymbolMap(), and Proc::signature. Referenced by Boomerang::alert_decompile_debug_point(), dump(), Prog::generateRTL(), Decompiler::getRtlForProc(), Prog::print(), printAnalysedXML(), printDecodedXML(), prints(), printSSAXML(), and printToLog(). |
|
Definition at line 278 of file proc.cpp. References DUMP_XML, escapeXMLChars(), Boomerang::get(), Proc::getName(), and print(). |
|
Definition at line 531 of file proc.cpp. References SyntaxNode::evaluate(), getAST(), Proc::getName(), NULL, and SyntaxNode::printAST(). |
|
Reimplemented from Proc. Definition at line 226 of file proc.cpp. References calleeList, DUMP_XML, Proc::getName(), and Proc::visited. |
|
Definition at line 261 of file proc.cpp. References DUMP_XML, escapeXMLChars(), Boomerang::get(), Proc::getName(), and print(). Referenced by setDecoded(). |
|
Definition at line 723 of file proc.cpp. References LocationSet::begin(), StatementList::begin(), DFGcount, LocationSet::end(), StatementList::end(), Boomerang::get(), Proc::getName(), getStatements(), LOG, and VERBOSE. Referenced by middleDecompile(). |
|
Print the locals declaration in C style.
|
|
Definition at line 687 of file proc.cpp. References StatementList::begin(), StatementList::end(), and parameters. Referenced by initialParameters(), and print(). |
|
Definition at line 705 of file proc.cpp. References debug_buffer, DEBUG_BUFSIZE, and print(). |
|
Definition at line 295 of file proc.cpp. References DUMP_XML, escapeXMLChars(), Boomerang::get(), Proc::getName(), and print(). Referenced by printXML(). |
|
Print just the symbol map.
Definition at line 3987 of file proc.cpp. References getTypeForLocation(), and symbolMap. Referenced by print(). |
|
Definition at line 717 of file proc.cpp. Referenced by earlyDecompile(), generateCode(), initialiseDecompile(), middleDecompile(), rangeAnalysis(), remUnusedStmtEtc(), and updateCalls(). |
|
Definition at line 323 of file proc.cpp. References LocationSet::begin(), StatementList::begin(), LocationSet::end(), StatementList::end(), Boomerang::get(), RefExp::getDef(), Proc::getName(), Statement::getNumber(), and getStatements(). Referenced by printXML(). |
|
Definition at line 313 of file proc.cpp. References DUMP_XML, Prog::printCallGraphXML(), Proc::printDetailsXML(), printSSAXML(), printUseGraph(), and Proc::prog. Referenced by initialiseDecompile(), middleDecompile(), remUnusedStmtEtc(), and typeAnalysis(). |
|
Copy the decoded indirect control transfer instructions' RTLs to the front end's map, and decode any new targets for this CFG.
Definition at line 5166 of file proc.cpp. References Prog::addDecodedRtl(), cfg, DEBUG_SWITCH, Cfg::getFirstBB(), BasicBlock::getHiAddr(), BasicBlock::getLastRtl(), BasicBlock::getLastStmt(), Cfg::getNextBB(), LOG, NULL, and Proc::prog. |
|
Definition at line 2358 of file proc.cpp. References StatementList::begin(), StatementList::end(), Prog::getFloatConstant(), getStatements(), LOG, Location::memOf(), opFsize, opIntConst, opMemOf, opWild, and Proc::prog. |
|
promote the signature if possible
Definition at line 2740 of file proc.cpp. References Signature::promote(), and Proc::signature. Referenced by middleDecompile(), and StatementTest::testBypass(). |
|
|
|
Propagate statemtents; return true if change; set convert if an indirect call is converted to direct (else clear).
Definition at line 2680 of file proc.cpp. References Assign::accept(), StatementList::begin(), StatementList::end(), findLiveAtDomPhi(), getStatements(), and LOG. Referenced by earlyDecompile(), middleDecompile(), remUnusedStmtEtc(), typeAnalysis(), and CallStatement::updateArguments(). |
|
Definition at line 4489 of file proc.cpp. References UseCollector::begin(), col, and UseCollector::end(). |
|
prove any arbitary property of this procedure. If conditional is true, do not save the result, as it may be conditional on premises stored in other procedures Definition at line 3380 of file proc.cpp. References DEBUG_PROOF, Proc::getName(), Exp::isEquality(), LOG, and Proc::provenTrue. Referenced by findPreserveds(), and findSpPreservation(). |
|
helper function, should be private
Definition at line 3463 of file proc.cpp. References Exp::clone(), PhiAssign::end(), Exp::getSubExp2(), and LOG. |
|
Definition at line 5065 of file proc.cpp. References Cfg::addJunctionStatements(), cfg, clearRanges(), Cfg::establishDFTOrder(), Cfg::getEntryBB(), BasicBlock::getFirstStmt(), Proc::getName(), LOG, NULL, printToLog(), and Cfg::sortByAddress(). |
|
Analyse the whole group of procedures for conditional preserveds, and update till no change. Also finalise the whole group. Definition at line 1670 of file proc.cpp. References Boomerang::alert_decompiling(), cycleGrp, Boomerang::get(), LOG, PROC_INCYCLE, and VERBOSE. |
|
Definition at line 5261 of file proc.cpp. References Cfg::begin(), cfg, Cfg::end(), Proc::getName(), LOG, and NULL. |
|
|
|
Definition at line 1993 of file proc.cpp. References StatementList::begin(), StatementList::end(), and getStatements(). |
|
Definition at line 2657 of file proc.cpp. References StatementList::begin(), StatementList::end(), Statement::getNumber(), getStatements(), Statement::isNullStatement(), LOG, and removeStatement(). Referenced by remUnusedStmtEtc(). |
|
Definition at line 4754 of file proc.cpp. References Exp::accept(), Boomerang::alert_decompile_debug_point(), StatementList::append(), StatementList::begin(), cfg, checkForGainfulUse(), DEBUG_UNUSED, StatementList::end(), Exp::expSubscriptAllNull(), Boomerang::get(), Proc::getName(), Exp::getSubExp1(), Signature::isForced(), Exp::isSubscript(), LOG, parameters, Cfg::removeImplicitAssign(), Signature::removeParameter(), Proc::signature, symbolMap, and Proc::visited. Referenced by removeRedundantReturns(). |
|
|
|
Remove any returns that are not used by any callers return true if any returns are removed.
Definition at line 4819 of file proc.cpp. References Boomerang::alert_decompile_debug_point(), Boomerang::alert_decompiling(), DEBUG_UNUSED, Boomerang::get(), Proc::getName(), Signature::getNumReturns(), Signature::getReturnExp(), Signature::isForced(), LOG, NULL, removeRedundantParameters(), and Proc::signature. |
|
Reimplemented from Proc. Definition at line 2328 of file proc.cpp. References ReturnStatement::removeReturn(), and theReturnStatement. |
|
Definition at line 1951 of file proc.cpp. References LocationSet::begin(), StatementList::begin(), LocationSet::end(), StatementList::end(), Signature::getStackRegister(), getStatements(), Proc::prog, Location::regOf(), Proc::signature, and sp. |
|
remove a statement
Definition at line 814 of file proc.cpp. References Proc::provenTrue. Referenced by Cfg::removeImplicitAssign(), and removeNullStatements(). |
|
Definition at line 3364 of file proc.cpp. References StatementList::begin(), StatementList::end(), and parameters. |
|
Definition at line 3343 of file proc.cpp. References symbolMap. |
|
Definition at line 2849 of file proc.cpp. Referenced by mapSymbolToRepl(). |
|
Definition at line 2931 of file proc.cpp. References Statement::addUsedLocals(), Boomerang::alert_decompile_debug_point(), LocationSet::begin(), StatementList::begin(), DEBUG_UNUSED, Assignment::definesLoc(), LocationSet::end(), StatementList::end(), Boomerang::get(), Proc::getName(), getStatements(), Statement::isCall(), Statement::isReturn(), and LOG. Referenced by generateCode(). |
|
Definition at line 1590 of file proc.cpp. References Boomerang::alert_decompile_debug_point(), StatementList::begin(), StatementList::end(), Boomerang::get(), Assignment::getLeft(), Exp::getOper(), getStatements(), and opGlobal. |
|
Remove unused statements.
Definition at line 1489 of file proc.cpp. References addParameterSymbols(), Boomerang::alert_decompile_afterRemoveStmts(), Boomerang::alert_decompile_debug_point(), Boomerang::alert_decompiling(), branchAnalysis(), countRefs(), df, doRenameBlockVars(), findFinalParameters(), fixUglyBranches(), Boomerang::get(), Proc::getName(), LOG, numberStatements(), DataFlow::placePhiFunctions(), printToLog(), printXML(), PROC_FINAL, PROC_INCYCLE, propagateStatements(), removeNullStatements(), status, typeAnalysis(), updateCalls(), and VERBOSE. |
|
Definition at line 200 of file proc.cpp. References cfg, expFromSymbol(), getSymbolFor(), Location::local(), locals, mapSymbolToRepl(), and Cfg::searchAndReplace(). |
|
Reimplemented from Proc. Definition at line 176 of file proc.cpp. References Proc::renameParam(). |
|
Definition at line 4103 of file proc.cpp. References Boomerang::alert_decompile_debug_point(), StatementList::begin(), StatementList::end(), Boomerang::get(), RefExp::getDef(), getStatements(), Exp::getSubExp1(), Exp::isIntConst(), Statement::isPhi(), opMult, and tmp. Referenced by middleDecompile(). |
|
Definition at line 211 of file proc.cpp. References cfg, and Cfg::searchAll(). |
|
Definition at line 3841 of file proc.cpp. References StatementList::begin(), StatementList::end(), and getStatements(). |
|
Definition at line 2624 of file proc.cpp. References StatementList::begin(), StatementList::end(), getSymbolExp(), Assignment::getTypeFor(), LOG, Location::memOf(), NULL, opWildIntConst, Location::regOf(), result, and Assign::searchAll(). |
|
Definition at line 873 of file proc.h. References cfg. |
|
Records that this procedure has been decoded.
Definition at line 551 of file proc.cpp. References printDecodedXML(), PROC_DECODED, and setStatus(). Referenced by FrontEnd::decodeOnly(), StatementTest::testEmpty(), StatementTest::testEndlessLoop(), StatementTest::testFlow(), StatementTest::testKill(), StatementTest::testUse(), StatementTest::testUseKill(), StatementTest::testUseOverBB(), and StatementTest::testUseOverKill(). |
|
|
|
Set the entry BB for this procedure (constructor has the entry address).
Definition at line 583 of file proc.cpp. References Proc::address, cfg, Cfg::getFirstBB(), BasicBlock::getLowAddr(), and Cfg::getNextBB(). Referenced by ST20FrontEnd::processProc(), PPCFrontEnd::processProc(), and PentiumFrontEnd::processProc(). |
|
Definition at line 2809 of file proc.cpp. References Location::local(), and mapSymbolTo(). |
|
Find and if necessary insert an implicit reference before s whose address expression is a and type is t.
Definition at line 5185 of file proc.cpp. References StatementList::begin(), StatementList::end(), Statement::getBB(), and BasicBlock::getRTLs(). Referenced by Binary::descendType(). |
|
Definition at line 2794 of file proc.cpp. References Type::getCtype(), locals, and LOG. Referenced by StmtSsaXformer::visit(). |
|
Definition at line 187 of file proc.cpp. References StatementList::begin(), StatementList::end(), parameters, Signature::setParamType(), and Proc::signature. |
|
Get a name like eax or o2 from r24 or r8.
Definition at line 183 of file proc.cpp. References Signature::setParamType(), and Proc::signature. |
|
Definition at line 825 of file proc.h. References Exp::clone(), and Proc::recurPremises. |
|
Definition at line 463 of file proc.h. References PROC_SORTED, and setStatus(). |
|
Definition at line 681 of file proc.cpp. References Boomerang::alert_proc_status_change(), Boomerang::get(), and status. Referenced by decompile(), initialiseDecompile(), setDecoded(), setSorted(), and unDecode(). |
|
Definition at line 859 of file proc.h. References NULL, ReturnStatement::setRetAddr(), and theReturnStatement. Referenced by FrontEnd::createReturnBlock(). |
|
simplify the statements in this proc
Definition at line 486 of file proc.h. References cfg, and Cfg::simplify(). Referenced by typeAnalysis(). |
|
For debugging.
Definition at line 4040 of file proc.cpp. References symbolMap. |
|
Given a machine dependent location, return a generated symbolic representation for it.
|
|
Trim parameters. If depth not given or == -1, perform at all depths.
|
|
Global type analysis (for this procedure).
Definition at line 5014 of file proc.cpp. References addImplicitAssigns(), CON_TYPE_ANALYSIS, DFA_TYPE_ANALYSIS, dfaTypeAnalysis(), doRenameBlockVars(), ellipsisProcessing(), Proc::getName(), LOG, printXML(), propagateStatements(), and simplify(). Referenced by remUnusedStmtEtc(). |
|
Removes the decoded bit and throws away all the current information about this procedure.
Definition at line 562 of file proc.cpp. References cfg, Cfg::clear(), PROC_UNDECODED, and setStatus(). |
|
Change BB containing this statement from a COMPCALL to a CALL.
Definition at line 813 of file proc.h. References cfg, and Cfg::undoComputedBB(). Referenced by CallStatement::rangeAnalysis(). |
|
Update the arguments in calls.
Definition at line 4066 of file proc.cpp. References Boomerang::alert_decompile_debug_point(), Boomerang::alert_decompiling(), Cfg::begin(), cfg, Cfg::end(), Boomerang::get(), Proc::getName(), LOG, NULL, and Const::print(). Referenced by middleDecompile(), and updateCalls(). |
|
Update the defines in calls.
Definition at line 4090 of file proc.cpp. References StatementList::begin(), StatementList::end(), Proc::getName(), getStatements(), LOG, NULL, and CallStatement::updateDefines(). Referenced by earlyDecompile(), middleDecompile(), and updateCalls(). |
|
Definition at line 1739 of file proc.cpp. References Proc::getName(), LOG, printToLog(), updateArguments(), updateCallDefines(), and VERBOSE. Referenced by remUnusedStmtEtc(). |
|
Update parameters and call livenesses to take into account the changes causes by removing a return from this procedure, or a callee's parameter (which affects this procedure's arguments, which are also uses).
Definition at line 4939 of file proc.cpp. References cfg, DEBUG_UNUSED, Cfg::getFirstBB(), BasicBlock::getLastStmt(), Proc::getName(), Cfg::getNextBB(), Proc::isLib(), LOG, NULL, and parameters. |
|
|
|
Add a location to the UseCollector; this means this location is used before defined, and hence is an initial* parameter. Note that final parameters don't use this information; it's only for handling recursion. Definition at line 845 of file proc.h. References col, and UseCollector::insert(). |
|
|
|
Reimplemented from Proc. |
|
The set of address-escaped locals and parameters. If in this list, they should not be propagated Definition at line 382 of file proc.h. Referenced by isAddressEscapedVar(), and isPropagatable(). |
|
Set of callees (Procedures that this procedure calls). Used for call graph, among other things Definition at line 360 of file proc.h. Referenced by addCallee(), addCallees(), getCallees(), and printCallGraphXML(). |
|
|
A collector for initial parameters (locations used before being defined). Note that final parameters don't use this; it's only of use during group decompilation analysis (sorting out recursion) Definition at line 366 of file proc.h. Referenced by clearUses(), initialParameters(), print(), propagateToCollector(), and useBeforeDefine(). |
|
Pointer to a set of procedures involved in a recursion group. NOTE: Each procedure in the cycle points to the same set! However, there can be several separate cycles. E.g. in test/source/recursion.c, there is a cycle with f and g, while another is being built up (it only has c, d, and e at the point where the f-g cycle is found). Definition at line 402 of file proc.h. Referenced by doesRecurseTo(), isEarlyRecursive(), and recursionGroupAnalysis(). |
|
DataFlow object. Holds information relevant to transforming to and from SSA form. Definition at line 389 of file proc.h. Referenced by canRename(), doRenameBlockVars(), earlyDecompile(), findLiveAtDomPhi(), getDataFlow(), initialiseDecompile(), middleDecompile(), placePhiFunctions(), and remUnusedStmtEtc(). |
|
Definition at line 855 of file proc.h. Referenced by printDFG(). |
|
Definition at line 334 of file proc.h. Referenced by addLocal(), dumpLocals(), existsLocal(), findLocal(), findLocalFromRef(), generateCode(), getLocalName(), getLocalType(), getNumLocals(), getSymbolExp(), getTypeForLocation(), newLocal(), newLocalName(), renameLocal(), and setLocalType(). |
|
The local "symbol table", which is aware of overlaps.
Definition at line 355 of file proc.h. Referenced by UserProc(). |
|
|
|
Definition at line 337 of file proc.h. Referenced by nextParamNum(). |
|
The list of parameters, ordered and filtered. Note that a LocationList could be used, but then there would be nowhere to store the types (for DFA based TA) The RHS is just ignored; the list is of ImplicitAssigns. DESIGN ISSUE: it would be nice for the parameters' implicit assignments to be the sole definitions, i.e. not need other implicit assignments for these. But the targets of RefExp's are not expected to change address, so they are not suitable at present (since the addresses regularly get changed as the parameters get recreated). Definition at line 377 of file proc.h. Referenced by addParameterSymbols(), findFinalParameters(), getParameters(), initialParameters(), insertParameter(), isLocalOrParam(), makeParamsImplicit(), mapParameters(), printParams(), removeRedundantParameters(), removeSubscriptsFromParameters(), setParamType(), and updateForUseChange(). |
|
A map of stack locations (negative values) to types. This is currently PENTIUM specific and is computed from range information. |
|
The status of this user procedure. Status: undecoded .. final decompiled Definition at line 324 of file proc.h. Referenced by decompile(), earlyDecompile(), getStatus(), isDecoded(), isDecompiled(), isEarlyRecursive(), isSorted(), middleDecompile(), XMLProgParser::persistToXML(), remUnusedStmtEtc(), and setStatus(). |
|
Current statement number. Makes it easier to split decompile() into smaller pieces. Definition at line 394 of file proc.h. Referenced by initialiseDecompile(), and numberStatements(). |
|
Definition at line 350 of file proc.h. Referenced by dumpSymbolMap(), dumpSymbolMapx(), expFromSymbol(), findFirstSymbol(), getSymbolExp(), getSymbolFor(), getSymbolName(), isLocal(), lookupSym(), makeSymbolsImplicit(), mapSymbolTo(), printSymbolMap(), removeRedundantParameters(), removeSubscriptsFromSymbols(), removeSymbolMapping(), and testSymbolMap(). |
|
We ensure that there is only one return statement now. See code in frontend/frontend.cpp handling case STMT_RET. If no return statement, this will be NULL. Definition at line 854 of file proc.h. Referenced by findPreserveds(), getModifieds(), getTheReturnAddr(), getTheReturnStatement(), middleDecompile(), XMLProgParser::persistToXML(), removeReturn(), and setTheReturnAddr(). |