Ghidra Decompiler Analysis Engine
Public Member Functions | Protected Attributes | List of all members
ActionGroup Class Reference

A group of actions (generally) applied in sequence. More...

#include <action.hh>

Inheritance diagram for ActionGroup:
Inheritance graph
[legend]
Collaboration diagram for ActionGroup:
Collaboration graph
[legend]

Public Member Functions

virtual ~ActionGroup (void)
 Destructor.
 
void addAction (Action *ac)
 Add an Action to the group. More...
 
virtual void clearBreakPoints (void)
 Clear all breakpoints set on this Action.
 
virtual Actionclone (const ActionGroupList &grouplist) const
 Clone the Action. More...
 
virtual void reset (Funcdata &data)
 Reset the Action for a new function. More...
 
virtual void resetStats (void)
 Reset all the counts to zero. More...
 
virtual int4 apply (Funcdata &data)
 Make a single attempt to apply this Action. More...
 
virtual int4 print (ostream &s, int4 num, int4 depth) const
 Print a description of this Action to stream. More...
 
virtual void printState (ostream &s) const
 Print status to stream. More...
 
virtual ActiongetSubAction (const string &specify)
 Retrieve a specific sub-action by name. More...
 
virtual RulegetSubRule (const string &specify)
 Retrieve a specific sub-rule by name. More...
 
virtual void printStatistics (ostream &s) const
 Dump statistics to stream. More...
 
- Public Member Functions inherited from Action
 Action (uint4 f, const string &nm, const string &g)
 Base constructor for an Action. More...
 
int4 perform (Funcdata &data)
 Perform this action (if necessary) More...
 
bool setBreakPoint (uint4 tp, const string &specify)
 Set a breakpoint on this action. More...
 
bool setWarning (bool val, const string &specify)
 Set a warning on this action. More...
 
bool disableRule (const string &specify)
 Disable a specific Rule within this. More...
 
bool enableRule (const string &specify)
 Enable a specific Rule within this. More...
 

Protected Attributes

vector< Action * > list
 List of actions to perform in the group.
 
vector< Action * >::iterator state
 Current action being applied.
 
- Protected Attributes inherited from Action
int4 lcount
 Changes not including last call to apply()
 
int4 count
 Number of changes made by this action so far.
 
uint4 status
 Current status.
 
uint4 breakpoint
 Breakpoint properties.
 
uint4 flags
 Behavior properties.
 
uint4 count_tests
 Number of times apply() has been called.
 
uint4 count_apply
 Number of times apply() made changes.
 
string name
 Name of the action.
 
string basegroup
 Base group this action belongs to.
 

Additional Inherited Members

- Public Types inherited from Action
enum  ruleflags {
  rule_repeatapply = 4, rule_onceperfunc = 8, rule_oneactperfunc = 16, rule_debug = 32,
  rule_warnings_on = 64, rule_warnings_given = 128
}
 Boolean behavior properties governing this particular Action. More...
 
enum  statusflags {
  status_start =1, status_breakstarthit =2, status_repeat =4, status_mid =8,
  status_end =16, status_actionbreak =32
}
 Boolean properties describing the status of an action. More...
 
enum  breakflags { break_start = 1, tmpbreak_start = 2, break_action = 4, tmpbreak_action = 8 }
 Break points associated with an Action. More...
 
- Protected Member Functions inherited from Action
void issueWarning (Architecture *glb)
 Warn that this Action has applied. More...
 
bool checkStartBreak (void)
 Check start breakpoint. More...
 
bool checkActionBreak (void)
 Check action breakpoint. More...
 

Detailed Description

A group of actions (generally) applied in sequence.

This is a a list of Action objects, which are usually applied in sequence. But the behavior properties of each individual Action may affect this. Properties (like rule_repeatapply) may be put directly to this group that also affect how the Actions are applied.

Member Function Documentation

◆ addAction()

void ActionGroup::addAction ( Action ac)

Add an Action to the group.

To be used only during the construction of this ActionGroup. This routine adds an Action to the end of this group's list.

Parameters
acis the Action to add

◆ apply()

int4 ActionGroup::apply ( Funcdata data)
virtual

Make a single attempt to apply this Action.

This is the main entry point for applying changes to a function that are specific to this Action. The method can inspect whatever it wants to decide if the Action does or does not apply. Changes are indicated by incrementing the count field.

Parameters
datais the function to inspect/modify
Returns
0 for a complete application, -1 for a partial completion (due to breakpoint)

Implements Action.

Reimplemented in ActionRestartGroup.

◆ clone()

Action * ActionGroup::clone ( const ActionGroupList grouplist) const
virtual

Clone the Action.

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

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

Implements Action.

Reimplemented in ActionRestartGroup.

◆ getSubAction()

Action * ActionGroup::getSubAction ( const string &  specify)
virtual

Retrieve a specific sub-action by name.

If this Action matches the given name, it is returned. If the name matches a sub-action, this is returned.

Parameters
specifyis the action name to match
Returns
the matching Action or sub-action

Reimplemented from Action.

◆ getSubRule()

Rule * ActionGroup::getSubRule ( const string &  specify)
virtual

Retrieve a specific sub-rule by name.

Find a Rule, as a component of this Action, with the given name.

Parameters
specifyis the name of the rule
Returns
the matching sub-rule

Reimplemented from Action.

◆ print()

int4 ActionGroup::print ( ostream &  s,
int4  num,
int4  depth 
) const
virtual

Print a description of this Action to stream.

The description is suitable for a console mode listing of actions

Parameters
sis the output stream
numis a starting index to associate with the action (and its sub-actions)
depthis amount of indent necessary before printing
Returns
the next available index

Reimplemented from Action.

◆ printState()

void ActionGroup::printState ( ostream &  s) const
virtual

Print status to stream.

This will the Action name and the next step to execute

Parameters
sis the output stream

Reimplemented from Action.

◆ printStatistics()

void ActionGroup::printStatistics ( ostream &  s) const
virtual

Dump statistics to stream.

Print out the collected statistics for the Action to stream

Parameters
sis the output stream

Reimplemented from Action.

◆ reset()

void ActionGroup::reset ( Funcdata data)
virtual

Reset the Action for a new function.

Parameters
datais the new function this Action may affect

Reimplemented from Action.

Reimplemented in ActionRestartGroup.

◆ resetStats()

void ActionGroup::resetStats ( void  )
virtual

Reset all the counts to zero.

Reset the statistics

Reimplemented from Action.


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