Ghidra 11.3.2
Ghidra internal decompiler documentation.
Loading...
Searching...
No Matches
ghidra::RuleDoubleIn Class Reference

Simply a double precision operation, pushing down one level, starting from a marked double precision input. More...

#include <double.hh>

Inheritance diagram for ghidra::RuleDoubleIn:
[legend]
Collaboration diagram for ghidra::RuleDoubleIn:
[legend]

Public Member Functions

 RuleDoubleIn (const string &g)
 Constructor.
 
virtual Ruleclone (const ActionGroupList &grouplist) const
 Clone the Rule.
 
virtual void reset (Funcdata &data)
 Reset this Rule.
 
virtual void getOpList (vector< uint4 > &oplist) const
 List of op codes this rule operates on.
 
virtual int4 applyOp (PcodeOp *op, Funcdata &data)
 Attempt to apply this Rule.
 
- Public Member Functions inherited from ghidra::Rule
 Rule (const string &g, uint4 fl, const string &nm)
 Construct given group, properties name.
 
virtual ~Rule (void)
 Destructor.
 
const string & getName (void) const
 Return the name of this Rule.
 
const string & getGroup (void) const
 Return the group this Rule belongs to.
 
uint4 getNumTests (void)
 Get number of attempted applications.
 
uint4 getNumApply (void)
 Get number of successful applications.
 
void setBreak (uint4 tp)
 Set a breakpoint on this Rule.
 
void clearBreak (uint4 tp)
 Clear a breakpoint on this Rule.
 
void clearBreakPoints (void)
 Clear all breakpoints on this Rule.
 
void turnOnWarnings (void)
 Enable warnings for this Rule.
 
void turnOffWarnings (void)
 Disable warnings for this Rule.
 
bool isDisabled (void) const
 Return true if this Rule is disabled.
 
void setDisable (void)
 Disable this Rule (within its pool)
 
void clearDisable (void)
 Enable this Rule (within its pool)
 
bool checkActionBreak (void)
 Check if an action breakpoint is turned on.
 
uint4 getBreakPoint (void) const
 Return breakpoint toggles.
 
virtual void resetStats (void)
 Reset Rule statistics.
 
virtual void printStatistics (ostream &s) const
 Print statistics for this Rule.
 

Private Member Functions

int4 attemptMarking (Varnode *vn, PcodeOp *subpieceOp)
 Determine if the given Varnode from a SUBPIECE should be marked as a double precision piece.
 

Additional Inherited Members

- Public Types inherited from ghidra::Rule
enum  typeflags { type_disable = 1 , rule_debug = 2 , warnings_on = 4 , warnings_given = 8 }
 Properties associated with a Rule. More...
 

Detailed Description

Simply a double precision operation, pushing down one level, starting from a marked double precision input.

This rule starts by trying to find a pair of Varnodes that are SUBPIECE from a whole, are marked as double precision, and that are then used in some double precision operation. The various operation forms are overlayed on the data-flow until a matching one is found. The pieces of the double precision operation are then transformed into a single logical operation on the whole.

Member Function Documentation

◆ applyOp()

int4 ghidra::RuleDoubleIn::applyOp ( PcodeOp op,
Funcdata data 
)
virtual

Attempt to apply this Rule.

This method contains the main logic for applying the Rule. It must use a given PcodeOp as the point at which the Rule applies. If it does apply, changes are made directly to the function and 1 (non-zero) is returned, otherwise 0 is returned.

Parameters
opis the given PcodeOp where the Rule may apply
datais the function to which to apply

Reimplemented from ghidra::Rule.

References ghidra::SplitVarnode::applyRuleIn(), attemptMarking(), ghidra::PcodeOp::getIn(), ghidra::PcodeOp::getOut(), ghidra::Funcdata::hasUnreachableBlocks(), ghidra::Varnode::isPrecisHi(), ghidra::Varnode::isPrecisLo(), and ghidra::SplitVarnode::wholeList().

◆ attemptMarking()

int4 ghidra::RuleDoubleIn::attemptMarking ( Varnode vn,
PcodeOp subpieceOp 
)
private

Determine if the given Varnode from a SUBPIECE should be marked as a double precision piece.

If the given Varnode looks like the most significant piece, there is another SUBPIECE that looks like the least significant piece, and the whole is from an operation that produces a logical whole, then mark the Varnode (and its companion) as double precision pieces and return 1.

Parameters
vnis the given Varnode
subpieceOpis the SUBPIECE PcodeOp producing the Varnode
Returns
1 if the pieces are marked, 0 otherwise

References ghidra::Varnode::beginDescend(), ghidra::PcodeOp::code(), ghidra::CPUI_SUBPIECE, ghidra::Varnode::endDescend(), ghidra::Varnode::getDef(), ghidra::PcodeOp::getIn(), ghidra::Varnode::getOffset(), ghidra::PcodeOp::getOpcode(), ghidra::PcodeOp::getOut(), ghidra::Varnode::getSize(), ghidra::Varnode::getType(), ghidra::TypeOp::isArithmeticOp(), ghidra::TypeOp::isFloatingPointOp(), ghidra::Varnode::isInput(), ghidra::Datatype::isPrimitiveWhole(), ghidra::Varnode::isTypeLock(), ghidra::Varnode::isWritten(), ghidra::Varnode::setPrecisHi(), and ghidra::Varnode::setPrecisLo().

Referenced by applyOp().

◆ clone()

virtual Rule * ghidra::RuleDoubleIn::clone ( const ActionGroupList grouplist) const
inlinevirtual

Clone the Rule.

If this Rule is a member of one of the groups in the grouplist, this returns a clone of the Rule, otherwise NULL is returned.

Parameters
grouplistis the list of groups being cloned
Returns
the cloned Rule or NULL

Implements ghidra::Rule.

References ghidra::ActionGroupList::contains(), and ghidra::Rule::getGroup().

◆ getOpList()

void ghidra::RuleDoubleIn::getOpList ( vector< uint4 > &  oplist) const
virtual

List of op codes this rule operates on.

Populate the given array with all possible OpCodes this Rule might apply to. By default, this method returns all possible OpCodes

Parameters
oplistis the array to populate

Reimplemented from ghidra::Rule.

References ghidra::CPUI_SUBPIECE.

◆ reset()

void ghidra::RuleDoubleIn::reset ( Funcdata data)
virtual

Reset this Rule.

Any state that is specific to a particular function is cleared by this method. This method can be used to initialize a Rule based on a new function it will apply to

Parameters
datais the new function about to be transformed

Reimplemented from ghidra::Rule.

References ghidra::Funcdata::setDoublePrecisRecovery().


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