Predator  [unstable] git snapshot
Data Fields
cl_code_listener Struct Reference

listener object - the core part of this interface More...

#include <code_listener.h>

Data Fields

void * data
 listener's internal data.
void(* file_open )(struct cl_code_listener *self, const char *file_name)
 file open callback
void(* file_close )(struct cl_code_listener *self)
 file close callback
void(* fnc_open )(struct cl_code_listener *self, const struct cl_operand *fcn)
 function definition initiation callback
void(* fnc_arg_decl )(struct cl_code_listener *self, int arg_id, const struct cl_operand *arg_src)
 function argument declaration callback
void(* fnc_close )(struct cl_code_listener *self)
 function definition complete callback
void(* bb_open )(struct cl_code_listener *self, const char *label)
 basic block initiation callback
void(* insn )(struct cl_code_listener *self, const struct cl_insn *insn)
 one-shot instruction callback
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.
void(* insn_call_arg )(struct cl_code_listener *self, int arg_id, const struct cl_operand *arg_src)
 CL_INSN_CALL per argument callback.
void(* insn_call_close )(struct cl_code_listener *self)
 CL_INSN_CALL complete callback.
void(* insn_switch_open )(struct cl_code_listener *self, const struct cl_loc *loc, const struct cl_operand *src)
 CL_INSN_SWITCH initiation callback.
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.
void(* insn_switch_close )(struct cl_code_listener *self)
 CL_INSN_SWITCH complete callback.
void(* acknowledge )(struct cl_code_listener *self)
 acknowledge that all regular callbacks have been sent and are supposed to be valid.
void(* destroy )(struct cl_code_listener *self)
 destroy code listener object

Detailed Description

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 796 of file code_listener.h.

Field Documentation

void(* acknowledge)(struct cl_code_listener *self)

acknowledge that all regular callbacks have been sent and are supposed to be valid.

Definition at line 936 of file code_listener.h.

void(* bb_open)(struct cl_code_listener *self, const char *label)

basic block initiation callback

Parameters
selfPointer to cl_code_listener object.
labelZero-terminated string containing label (and thus BB) name

Definition at line 850 of file code_listener.h.

void* data

listener's internal data.

Do not use this member.

Definition at line 800 of file code_listener.h.

void(* destroy)(struct cl_code_listener *self)

destroy code listener object

Parameters
selfPointer to cl_code_listener object.

Definition at line 943 of file code_listener.h.

void(* file_close)(struct cl_code_listener *self)

file close callback

Parameters
selfPointer to cl_code_listener object.

Definition at line 815 of file code_listener.h.

void(* file_open)(struct cl_code_listener *self, const char *file_name)

file open callback

Parameters
selfPointer to cl_code_listener object.
file_nameZero-terminated string with file name being opened.

Definition at line 807 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

Parameters
selfPointer to cl_code_listener object.
arg_idPosition of the argument being specified.
arg_srcFunction argument given as operand.

Definition at line 833 of file code_listener.h.

void(* fnc_close)(struct cl_code_listener *self)

function definition complete callback

Parameters
selfPointer to cl_code_listener object.

Definition at line 842 of file code_listener.h.

void(* fnc_open)(struct cl_code_listener *self, const struct cl_operand *fcn)

function definition initiation callback

Parameters
selfPointer to cl_code_listener object.
fncAn operand used as function declaration (without args).

Definition at line 823 of file code_listener.h.

void(* insn)(struct cl_code_listener *self, const struct cl_insn *insn)

one-shot instruction callback

Parameters
selfPointer to cl_code_listener object.
insnInstruction definition.

Definition at line 859 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.

Parameters
selfPointer to cl_code_listener object.
arg_idPosition of the argument being specified.
arg_srcCall argument given as operand.

Definition at line 882 of file code_listener.h.

void(* insn_call_close)(struct cl_code_listener *self)

CL_INSN_CALL complete callback.

Parameters
selfPointer to cl_code_listener object.

Definition at line 891 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.

Parameters
selfPointer to cl_code_listener object.
loclocation of the function definition
dstAn operand taking fnc's return value, may be CL_OPERAND_VOID
fncAn operand used as function to call (not necessarily constant)

Definition at line 870 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).

Parameters
selfPointer to cl_code_listener object.
loclocation of the function definition
val_loBegin of the range for given case.
val_hiEnd of the range for given case.
labelZero-terminated string containing label name

Definition at line 918 of file code_listener.h.

void(* insn_switch_close)(struct cl_code_listener *self)

CL_INSN_SWITCH complete callback.

Parameters
selfPointer to cl_code_listener object.

Definition at line 929 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.

Parameters
selfPointer to cl_code_listener object.
loclocation of the function definition
srcAn operand used as switch source.

Definition at line 900 of file code_listener.h.


The documentation for this struct was generated from the following file: