Ghidra Decompiler Analysis Engine
|
A pool of Rules that apply simultaneously. More...
#include <action.hh>
Public Member Functions | |
virtual | ~ActionPool (void) |
Destructor. | |
void | addRule (Rule *rl) |
Add a Rule to the pool. More... | |
virtual void | clearBreakPoints (void) |
Clear all breakpoints set on this Action. | |
virtual Action * | clone (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 Rule * | getSubRule (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... | |
virtual Action * | getSubAction (const string &specify) |
Retrieve a specific sub-action by name. More... | |
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... | |
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. | |
A pool of Rules that apply simultaneously.
This class groups together a set of Rules as a formal Action. Rules are given an opportunity to apply to every PcodeOp in a function. Usually rule_repeatapply is enabled for this action, which causes all Rules to apply repeatedly until no Rule can make an additional change.
void ActionPool::addRule | ( | Rule * | rl | ) |
Add a Rule to the pool.
This method should only be invoked during construction of this ActionPool A single Rule is added to the pool. The Rule's OpCode is inspected by this method.
rl | is the Rule to add |
|
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.
data | is the function to inspect/modify |
Implements Action.
|
virtual |
|
virtual |
|
virtual |
Print a description of this Action to stream.
The description is suitable for a console mode listing of actions
s | is the output stream |
num | is a starting index to associate with the action (and its sub-actions) |
depth | is amount of indent necessary before printing |
Reimplemented from Action.
|
virtual |
|
virtual |
|
virtual |
|
virtual |