decompiler 1.0.0
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
ghidra::IfaceDecompCommand Class Reference

Root class for all decompiler specific commands. More...

#include <ifacedecomp.hh>

Inheritance diagram for ghidra::IfaceDecompCommand:
ghidra::IfaceCommand ghidra::IfcAddrrangeLoad ghidra::IfcAdjustVma ghidra::IfcAnalyzeRange ghidra::IfcBreakaction ghidra::IfcBreakstart ghidra::IfcCallFixup ghidra::IfcCallGraphBuild ghidra::IfcCallGraphDump ghidra::IfcCallGraphList ghidra::IfcCallGraphLoad ghidra::IfcCallOtherFixup ghidra::IfcCleararch ghidra::IfcComment ghidra::IfcCommentInstr ghidra::IfcContinue ghidra::IfcCountPcode ghidra::IfcDeadcodedelay ghidra::IfcDecompile ghidra::IfcDump ghidra::IfcDumpbinary ghidra::IfcDuplicateHash ghidra::IfcExecuteTestCommand ghidra::IfcFixupApply ghidra::IfcFlowOverride ghidra::IfcForceDatatypeFormat ghidra::IfcForceFormat ghidra::IfcForcegoto ghidra::IfcFuncload ghidra::IfcGlobalAdd ghidra::IfcGlobalRegisters ghidra::IfcGlobalRemove ghidra::IfcGlobalify ghidra::IfcGraphControlflow ghidra::IfcGraphDataflow ghidra::IfcGraphDom ghidra::IfcIsolate ghidra::IfcJumpOverride ghidra::IfcListOverride ghidra::IfcListTestCommands ghidra::IfcListaction ghidra::IfcListprototypes ghidra::IfcLoadTestFile ghidra::IfcLockPrototype ghidra::IfcMapParam ghidra::IfcMapReturn ghidra::IfcMapaddress ghidra::IfcMapconvert ghidra::IfcMapexternalref ghidra::IfcMapfunction ghidra::IfcMaphash ghidra::IfcMaplabel ghidra::IfcMapunionfacet ghidra::IfcNameVarnode ghidra::IfcOption ghidra::IfcParseFile ghidra::IfcParseLine ghidra::IfcPointerSetting ghidra::IfcPreferSplit ghidra::IfcPrintActionstats ghidra::IfcPrintBlocktree ghidra::IfcPrintCFlat ghidra::IfcPrintCGlobals ghidra::IfcPrintCStruct ghidra::IfcPrintCTypes ghidra::IfcPrintCXml ghidra::IfcPrintCover ghidra::IfcPrintExtrapop ghidra::IfcPrintHigh ghidra::IfcPrintInputs ghidra::IfcPrintInputsAll ghidra::IfcPrintLanguage ghidra::IfcPrintLocalrange ghidra::IfcPrintMap ghidra::IfcPrintParamMeasures ghidra::IfcPrintRaw ghidra::IfcPrintSignatures ghidra::IfcPrintSpaces ghidra::IfcPrintTree ghidra::IfcPrintVarnode ghidra::IfcPrintdisasm ghidra::IfcProduceC ghidra::IfcProducePrototypes ghidra::IfcProtooverride ghidra::IfcReadSymbols ghidra::IfcReadonly ghidra::IfcRemove ghidra::IfcRename ghidra::IfcResetActionstats ghidra::IfcRetype ghidra::IfcSaveAllSignatures ghidra::IfcSaveSignatures ghidra::IfcSetcontextrange ghidra::IfcSettrackedrange ghidra::IfcSignatureSettings ghidra::IfcSource ghidra::IfcStructureBlocks ghidra::IfcTypeVarnode ghidra::IfcUnlockPrototype ghidra::IfcVarnodeCover ghidra::IfcVarnodehighCover ghidra::IfcVolatile

Public Member Functions

virtual void setData (IfaceStatus *root, IfaceData *data)
 Associate a specific data object with this command.
 
virtual string getModule (void) const
 Get the formal module name to which this command belongs.
 
virtual IfaceDatacreateData (void)
 Create a specialized data object for this command (and its module)
 
virtual void iterationCallback (Funcdata *fd)
 Perform the per-function aspect of this command.
 
void iterateFunctionsAddrOrder (void)
 Iterate command over all functions in all scopes.
 
void iterateFunctionsLeafOrder (void)
 Iterate command over all functions in a call-graph traversal.
 
- Public Member Functions inherited from ghidra::IfaceCommand
virtual ~IfaceCommand (void)
 Destructor.
 
virtual void execute (istream &s)=0
 
void addWord (const string &temp)
 Add a token to the command line string associated with this command.
 
void removeWord (void)
 Remove the last token from the associated command line string.
 
const string & getCommandWord (int4 i) const
 Get the i-th command token.
 
void addWords (const vector< string > &wordlist)
 Add words to the associated command line string.
 
int4 numWords (void) const
 Return the number of tokens in the command line string.
 
void commandString (string &res) const
 Get the complete command line string.
 
int4 compare (const IfaceCommand &op2) const
 Order two commands by their command line strings.
 

Protected Member Functions

void iterateScopesRecursive (Scope *scope)
 Iterate recursively over all functions in given scope.
 
void iterateFunctionsAddrOrder (Scope *scope)
 Iterate over all functions in a given scope.
 

Protected Attributes

IfaceStatusstatus
 The console owning this command.
 
IfaceDecompDatadcp
 Data common to decompiler commands.
 

Detailed Description

Root class for all decompiler specific commands.

Commands share the data object IfaceDecompData and are capable of iterating over all functions in the program/architecture.

Member Function Documentation

◆ createData()

virtual IfaceData * ghidra::IfaceDecompCommand::createData ( void  )
inlinevirtual

Create a specialized data object for this command (and its module)

This method is only called once per module

Returns
the newly created data object for the module

Implements ghidra::IfaceCommand.

◆ getModule()

virtual string ghidra::IfaceDecompCommand::getModule ( void  ) const
inlinevirtual

Get the formal module name to which this command belongs.

Commands in the same module share data through their registered IfaceData object

Returns
the formal module name

Implements ghidra::IfaceCommand.

◆ iterateFunctionsAddrOrder() [1/2]

void ghidra::IfaceDecompCommand::iterateFunctionsAddrOrder ( Scope scope)
protected

Iterate over all functions in a given scope.

Runs over every function in the scope calling iterationCallback().

Parameters
scopeis the given scope

References ghidra::Scope::begin(), ghidra::Scope::end(), ghidra::FunctionSymbol::getFunction(), and iterationCallback().

◆ iterateFunctionsAddrOrder() [2/2]

void ghidra::IfaceDecompCommand::iterateFunctionsAddrOrder ( void  )

◆ iterateFunctionsLeafOrder()

void ghidra::IfaceDecompCommand::iterateFunctionsLeafOrder ( void  )

Iterate command over all functions in a call-graph traversal.

Traversal is based on the current CallGraph for the program. Child functions are traversed before their parents.

References ghidra::IfaceDecompData::cgraph, ghidra::IfaceDecompData::conf, dcp, and iterationCallback().

Referenced by ghidra::IfcProducePrototypes::execute(), and ghidra::IfcCallGraphList::execute().

◆ iterateScopesRecursive()

void ghidra::IfaceDecompCommand::iterateScopesRecursive ( Scope scope)
protected

Iterate recursively over all functions in given scope.

Runs over every function in the scope, or any sub-scope , calling iterationCallback()

Parameters
scopeis the given scope

References ghidra::Scope::childrenBegin(), ghidra::Scope::childrenEnd(), ghidra::Scope::isGlobal(), iterateFunctionsAddrOrder(), and iterateScopesRecursive().

Referenced by iterateFunctionsAddrOrder(), and iterateScopesRecursive().

◆ iterationCallback()

virtual void ghidra::IfaceDecompCommand::iterationCallback ( Funcdata fd)
inlinevirtual

◆ setData()

virtual void ghidra::IfaceDecompCommand::setData ( IfaceStatus root,
IfaceData data 
)
inlinevirtual

Associate a specific data object with this command.

Parameters
rootis the interface object this command is registered with
datais the data object the command should use

Implements ghidra::IfaceCommand.

References dcp, and status.


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