Stackdb
Stackdb is a stackable, multi-target and -level source debugger and memory forensics library.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Data Structures | Macros | Typedefs | Functions | Variables
target_php.c File Reference
#include <sys/types.h>
#include <unistd.h>
#include <glib.h>
#include "object.h"
#include "binfile.h"
#include "dwdebug.h"
#include "dwdebug_priv.h"
#include "target.h"
#include "target_api.h"
#include "probe_api.h"
#include "target_php.h"
Include dependency graph for target_php.c:

Go to the source code of this file.

Data Structures

struct  php_debugfile_info
 

Macros

#define PHP_UTIL_ZEND_HASH_APPLY_FREE   0
 
#define PHP_UTIL_ZEND_HASH_APPLY_SAVE   1 << 0
 
#define PHP_UTIL_ZEND_HASH_APPLY_STOP   1 << 1
 
#define PHP_ZEND_INTERNAL_FUNCTION   1U
 
#define PHP_ZEND_USER_FUNCTION   2U
 
#define PHP_ZEND_OVERLOADED_FUNCTION   3U
 
#define PHP_ZEND_EVAL_CODE   4U
 
#define PHP_ZEND_OVERLOADED_FUNCTION_TEMPORARY   5U
 
#define PHP_ZEND_INTERNAL_CLASS   1
 
#define PHP_ZEND_USER_CLASS   2
 
#define php_zhash_foreach_loadtype(target, zhash_val, lpc, value, value_type)
 

Typedefs

typedef int(* php_util_zend_hash_apply_func_t )(struct target *target, struct target_location_ctxt *tlctxt, struct value *k, struct value *v, void *priv)
 

Functions

GHashTable * php_zhash_to_ghash (struct target *target, struct value *zhash)
 
struct valuephp_zhash_find (struct target *target, struct value *zhash, char *key, struct symbol *type)
 
struct php_specphp_build_spec (void)
 
void php_free_spec (struct php_spec *spec)
 
int php_singlestep (struct target *target, tid_t tid, int isbp, struct target *overlay)
 
int php_singlestep_end (struct target *target, tid_t tid, struct target *overlay)
 
int __php_location_ops_setcurrentframe (struct location_ctxt *lctxt, int frame)
 
struct symbol__php_location_ops_getsymbol (struct location_ctxt *lctxt)
 
int __php_location_ops_getaddrsize (struct location_ctxt *lctxt)
 
int __php_location_ops_getregno (struct location_ctxt *lctxt, common_reg_t creg, REG *o_reg)
 
int __php_location_ops_readreg (struct location_ctxt *lctxt, REG regno, REGVAL *regval)
 
int __php_location_ops_writereg (struct location_ctxt *lctxt, REG regno, REGVAL regval)
 
int __php_location_ops_cachereg (struct location_ctxt *lctxt, REG regno, REGVAL regval)
 
int __php_location_ops_readipreg (struct location_ctxt *lctxt, REGVAL *regval)
 
int __php_location_ops_readword (struct location_ctxt *lctxt, ADDR real_addr, ADDR *pval)
 
int __php_location_ops_writeword (struct location_ctxt *lctxt, ADDR real_addr, ADDR pval)
 
int __php_location_ops_relocate (struct location_ctxt *lctxt, ADDR obj_addr, ADDR *real_addr)
 
int __php_location_ops_unrelocate (struct location_ctxt *lctxt, ADDR real_addr, ADDR *obj_addr)
 

Variables

struct target_ops php_ops
 
struct location_ops php_location_ops
 

Macro Definition Documentation

#define PHP_UTIL_ZEND_HASH_APPLY_FREE   0

Definition at line 313 of file target_php.c.

#define PHP_UTIL_ZEND_HASH_APPLY_SAVE   1 << 0

Definition at line 314 of file target_php.c.

#define PHP_UTIL_ZEND_HASH_APPLY_STOP   1 << 1

Definition at line 315 of file target_php.c.

#define PHP_ZEND_EVAL_CODE   4U

Definition at line 455 of file target_php.c.

#define PHP_ZEND_INTERNAL_CLASS   1

Definition at line 724 of file target_php.c.

#define PHP_ZEND_INTERNAL_FUNCTION   1U

Definition at line 452 of file target_php.c.

#define PHP_ZEND_OVERLOADED_FUNCTION   3U

Definition at line 454 of file target_php.c.

#define PHP_ZEND_OVERLOADED_FUNCTION_TEMPORARY   5U

Definition at line 456 of file target_php.c.

#define PHP_ZEND_USER_CLASS   2

Definition at line 725 of file target_php.c.

#define PHP_ZEND_USER_FUNCTION   2U

Definition at line 453 of file target_php.c.

#define php_zhash_foreach_loadtype (   target,
  zhash_val,
  lpc,
  value,
  value_type 
)

Definition at line 928 of file target_php.c.

Typedef Documentation

typedef int(* php_util_zend_hash_apply_func_t)(struct target *target, struct target_location_ctxt *tlctxt, struct value *k, struct value *v, void *priv)

Definition at line 316 of file target_php.c.

Function Documentation

int __php_location_ops_cachereg ( struct location_ctxt lctxt,
REG  regno,
REGVAL  regval 
)

Definition at line 2747 of file target_php.c.

int __php_location_ops_getaddrsize ( struct location_ctxt lctxt)

Definition at line 2722 of file target_php.c.

int __php_location_ops_getregno ( struct location_ctxt lctxt,
common_reg_t  creg,
REG o_reg 
)

Definition at line 2729 of file target_php.c.

struct symbol* __php_location_ops_getsymbol ( struct location_ctxt lctxt)

Definition at line 2713 of file target_php.c.

int __php_location_ops_readipreg ( struct location_ctxt lctxt,
REGVAL regval 
)

Definition at line 2753 of file target_php.c.

int __php_location_ops_readreg ( struct location_ctxt lctxt,
REG  regno,
REGVAL regval 
)

Definition at line 2735 of file target_php.c.

int __php_location_ops_readword ( struct location_ctxt lctxt,
ADDR  real_addr,
ADDR pval 
)

Definition at line 2758 of file target_php.c.

int __php_location_ops_relocate ( struct location_ctxt lctxt,
ADDR  obj_addr,
ADDR real_addr 
)

Definition at line 2795 of file target_php.c.

int __php_location_ops_setcurrentframe ( struct location_ctxt lctxt,
int  frame 
)

The interface to the dwdebug library's lsymbol_resolve* and symbol_resolve* functions.

Definition at line 2697 of file target_php.c.

int __php_location_ops_unrelocate ( struct location_ctxt lctxt,
ADDR  real_addr,
ADDR obj_addr 
)

Definition at line 2801 of file target_php.c.

int __php_location_ops_writereg ( struct location_ctxt lctxt,
REG  regno,
REGVAL  regval 
)

Definition at line 2741 of file target_php.c.

int __php_location_ops_writeword ( struct location_ctxt lctxt,
ADDR  real_addr,
ADDR  pval 
)

Definition at line 2776 of file target_php.c.

struct php_spec* php_build_spec ( void  )

Definition at line 938 of file target_php.c.

void php_free_spec ( struct php_spec spec)

Definition at line 946 of file target_php.c.

int php_singlestep ( struct target target,
tid_t  tid,
int  isbp,
struct target overlay 
)

Definition at line 2682 of file target_php.c.

int php_singlestep_end ( struct target target,
tid_t  tid,
struct target overlay 
)

Definition at line 2687 of file target_php.c.

struct value* php_zhash_find ( struct target target,
struct value zhash,
char *  key,
struct symbol type 
)
GHashTable* php_zhash_to_ghash ( struct target target,
struct value zhash 
)

Variable Documentation

struct location_ops php_location_ops
Initial value:
= {
}
int __php_location_ops_getregno(struct location_ctxt *lctxt, common_reg_t creg, REG *o_reg)
Definition: target_php.c:2729
int __php_location_ops_readword(struct location_ctxt *lctxt, ADDR real_addr, ADDR *pval)
Definition: target_php.c:2758
int __php_location_ops_readipreg(struct location_ctxt *lctxt, REGVAL *regval)
Definition: target_php.c:2753
int __php_location_ops_getaddrsize(struct location_ctxt *lctxt)
Definition: target_php.c:2722
struct symbol * __php_location_ops_getsymbol(struct location_ctxt *lctxt)
Definition: target_php.c:2713
int __php_location_ops_writereg(struct location_ctxt *lctxt, REG regno, REGVAL regval)
Definition: target_php.c:2741
int __php_location_ops_cachereg(struct location_ctxt *lctxt, REG regno, REGVAL regval)
Definition: target_php.c:2747
int __php_location_ops_setcurrentframe(struct location_ctxt *lctxt, int frame)
Definition: target_php.c:2697
int __php_location_ops_unrelocate(struct location_ctxt *lctxt, ADDR real_addr, ADDR *obj_addr)
Definition: target_php.c:2801
int __php_location_ops_writeword(struct location_ctxt *lctxt, ADDR real_addr, ADDR pval)
Definition: target_php.c:2776
int __php_location_ops_relocate(struct location_ctxt *lctxt, ADDR obj_addr, ADDR *real_addr)
Definition: target_php.c:2795
int __php_location_ops_readreg(struct location_ctxt *lctxt, REG regno, REGVAL *regval)
Definition: target_php.c:2735

Definition at line 2807 of file target_php.c.

struct target_ops php_ops

Definition at line 1015 of file target_php.c.