|
Predator
[unstable] git snapshot
|
listener object - the core part of this interface More...
#include <code_listener.h>
Data Fields | |
| void * | data |
| listener's internal data. More... | |
| void(* | file_open )(struct cl_code_listener *self, const char *file_name) |
| file open callback More... | |
| void(* | file_close )(struct cl_code_listener *self) |
| file close callback More... | |
| void(* | fnc_open )(struct cl_code_listener *self, const struct cl_operand *fcn) |
| function definition initiation callback More... | |
| void(* | fnc_arg_decl )(struct cl_code_listener *self, int arg_id, const struct cl_operand *arg_src) |
| function argument declaration callback More... | |
| void(* | fnc_close )(struct cl_code_listener *self) |
| function definition complete callback More... | |
| void(* | bb_open )(struct cl_code_listener *self, const char *label) |
| basic block initiation callback More... | |
| void(* | insn )(struct cl_code_listener *self, const struct cl_insn *insn) |
| one-shot instruction callback More... | |
| void(* | insn_call_open )(struct cl_code_listener *self, const struct cl_loc *loc, const struct cl_operand *dst, const struct cl_operand *fnc) |
| CL_INSN_CALL initiation callback. More... | |
| void(* | insn_call_arg )(struct cl_code_listener *self, int arg_id, const struct cl_operand *arg_src) |
| CL_INSN_CALL per argument callback. More... | |
| void(* | insn_call_close )(struct cl_code_listener *self) |
| CL_INSN_CALL complete callback. More... | |
| void(* | insn_switch_open )(struct cl_code_listener *self, const struct cl_loc *loc, const struct cl_operand *src) |
| CL_INSN_SWITCH initiation callback. More... | |
| void(* | insn_switch_case )(struct cl_code_listener *self, const struct cl_loc *loc, const struct cl_operand *val_lo, const struct cl_operand *val_hi, const char *label) |
| CL_INSN_SWITCH per case callback. More... | |
| void(* | insn_switch_close )(struct cl_code_listener *self) |
| CL_INSN_SWITCH complete callback. More... | |
| void(* | acknowledge )(struct cl_code_listener *self) |
| acknowledge that all regular callbacks have been sent and are supposed to be valid. More... | |
| void(* | destroy )(struct cl_code_listener *self) |
| destroy code listener object More... | |
listener object - the core part of this interface
* It accepts a context-free language defined by substitution to regex:
*
* (file_open FILE_CONTENT file_close)* acknowledge destroy
*
*
* FILE_CONTENT is defined by substitution to regex:
*
* fnc_open (fnc_arg_decl)* FNC_BODY fnc_close
*
*
* FNC_BODY is defined by substitution to regex:
*
* FNC_ENTRY (bb_open (NONTERM_INSN)* TERM_INSN)*
*
*
* FNC_ENTRY is defined as:
*
* insn{CL_INSN_JMP}
*
*
* NON_TERM_INSN is defined as:
*
* INSN_CALL | insn{CL_INSN_UNOP, CL_INSN_BINOP}
*
*
* TERM_INSN is defined as:
*
* insn{CL_INSN_JMP, CL_INSN_COND, CL_INSN_RET, CL_INSN_ABORT} | INSN_SWITCH
*
*
* INSN_CALL is defined by regex:
*
* insn_call_open (insn_call_arg)* insn_call_close
*
*
* INSN_SWITCH is defined by regex:
*
* insn_switch_open (insn_switch_case)* insn_switch_close
*
*
Definition at line 770 of file code_listener.h.
| void(* acknowledge)(struct cl_code_listener *self) |
acknowledge that all regular callbacks have been sent and are supposed to be valid.
Definition at line 910 of file code_listener.h.
| void(* bb_open)(struct cl_code_listener *self, const char *label) |
basic block initiation callback
| self | Pointer to cl_code_listener object. |
| label | Zero-terminated string containing label (and thus BB) name |
Definition at line 824 of file code_listener.h.
| void* data |
| void(* destroy)(struct cl_code_listener *self) |
destroy code listener object
| self | Pointer to cl_code_listener object. |
Definition at line 917 of file code_listener.h.
| void(* file_close)(struct cl_code_listener *self) |
file close callback
| self | Pointer to cl_code_listener object. |
Definition at line 789 of file code_listener.h.
| void(* file_open)(struct cl_code_listener *self, const char *file_name) |
file open callback
| self | Pointer to cl_code_listener object. |
| file_name | Zero-terminated string with file name being opened. |
Definition at line 781 of file code_listener.h.
| void(* fnc_arg_decl)(struct cl_code_listener *self, int arg_id, const struct cl_operand *arg_src) |
function argument declaration callback
| self | Pointer to cl_code_listener object. |
| arg_id | Position of the argument being specified. |
| arg_src | Function argument given as operand. |
Definition at line 807 of file code_listener.h.
| void(* fnc_close)(struct cl_code_listener *self) |
function definition complete callback
| self | Pointer to cl_code_listener object. |
Definition at line 816 of file code_listener.h.
| void(* fnc_open)(struct cl_code_listener *self, const struct cl_operand *fcn) |
function definition initiation callback
| self | Pointer to cl_code_listener object. |
| fnc | An operand used as function declaration (without args). |
Definition at line 797 of file code_listener.h.
| void(* insn)(struct cl_code_listener *self, const struct cl_insn *insn) |
one-shot instruction callback
| self | Pointer to cl_code_listener object. |
| insn | Instruction definition. |
Definition at line 833 of file code_listener.h.
| void(* insn_call_arg)(struct cl_code_listener *self, int arg_id, const struct cl_operand *arg_src) |
CL_INSN_CALL per argument callback.
| self | Pointer to cl_code_listener object. |
| arg_id | Position of the argument being specified. |
| arg_src | Call argument given as operand. |
Definition at line 856 of file code_listener.h.
| void(* insn_call_close)(struct cl_code_listener *self) |
CL_INSN_CALL complete callback.
| self | Pointer to cl_code_listener object. |
Definition at line 865 of file code_listener.h.
| void(* insn_call_open)(struct cl_code_listener *self, const struct cl_loc *loc, const struct cl_operand *dst, const struct cl_operand *fnc) |
CL_INSN_CALL initiation callback.
| self | Pointer to cl_code_listener object. |
| loc | location of the function definition |
| dst | An operand taking fnc's return value, may be CL_OPERAND_VOID |
| fnc | An operand used as function to call (not necessarily constant) |
Definition at line 844 of file code_listener.h.
| void(* insn_switch_case)(struct cl_code_listener *self, const struct cl_loc *loc, const struct cl_operand *val_lo, const struct cl_operand *val_hi, const char *label) |
CL_INSN_SWITCH per case callback.
For a singleton case branch, val_lo and val_hi hold the same integral constants (literals). Otherwise, an integral range of constants can be specified. Default target is encoded as (CL_OPERAND_VOID == val_lo->code && CL_OPERAND_VOID == val_hi->code).
| self | Pointer to cl_code_listener object. |
| loc | location of the function definition |
| val_lo | Begin of the range for given case. |
| val_hi | End of the range for given case. |
| label | Zero-terminated string containing label name |
Definition at line 892 of file code_listener.h.
| void(* insn_switch_close)(struct cl_code_listener *self) |
CL_INSN_SWITCH complete callback.
| self | Pointer to cl_code_listener object. |
Definition at line 903 of file code_listener.h.
| void(* insn_switch_open)(struct cl_code_listener *self, const struct cl_loc *loc, const struct cl_operand *src) |
CL_INSN_SWITCH initiation callback.
| self | Pointer to cl_code_listener object. |
| loc | location of the function definition |
| src | An operand used as switch source. |
Definition at line 874 of file code_listener.h.
1.8.3.1