php-src/phpdbg_bp.h

147 lines
5.6 KiB
C
Raw Normal View History

/*
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
2014-01-17 22:09:07 +00:00
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.php.net/license/3_01.txt |
| If you did not receive a copy of the PHP license and are unable to |
| obtain it through the world-wide-web, please send a note to |
| license@php.net so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Authors: Felipe Pena <felipe@php.net> |
| Authors: Joe Watkins <joe.watkins@live.co.uk> |
| Authors: Bob Weinand <bwoebi@php.net> |
+----------------------------------------------------------------------+
*/
#ifndef PHPDBG_BP_H
#define PHPDBG_BP_H
2013-11-11 13:07:02 +00:00
/* {{{ */
typedef struct _zend_op *phpdbg_opline_ptr_t; /* }}} */
/* {{{ breakpoint base structure */
#define phpdbg_breakbase(name) \
int id; \
zend_uchar type; \
zend_ulong hits; \
2013-12-02 13:19:13 +00:00
zend_bool disabled; \
const char *name /* }}} */
/* {{{ breakpoint base */
typedef struct _phpdbg_breakbase_t {
phpdbg_breakbase(name);
} phpdbg_breakbase_t; /* }}} */
/**
* Breakpoint file-based representation
*/
typedef struct _phpdbg_breakfile_t {
phpdbg_breakbase(filename);
2013-11-26 10:02:58 +00:00
long line;
} phpdbg_breakfile_t;
/**
* Breakpoint symbol-based representation
*/
typedef struct _phpdbg_breaksymbol_t {
phpdbg_breakbase(symbol);
} phpdbg_breaksymbol_t;
/**
* Breakpoint method based representation
*/
typedef struct _phpdbg_breakmethod_t {
phpdbg_breakbase(class_name);
2013-11-26 10:02:58 +00:00
size_t class_len;
const char *func_name;
size_t func_len;
} phpdbg_breakmethod_t;
2013-11-28 20:36:45 +00:00
/**
* Breakpoint opline num based representation
*/
typedef struct _phpdbg_breakopline_t {
phpdbg_breakbase(func_name);
size_t func_len;
2013-11-28 20:36:45 +00:00
const char *class_name;
size_t class_len;
zend_ulong opline_num;
zend_ulong opline;
2013-11-28 20:36:45 +00:00
} phpdbg_breakopline_t;
2013-11-11 11:54:41 +00:00
/**
* Breakpoint opline based representation
*/
typedef struct _phpdbg_breakline_t {
phpdbg_breakbase(name);
zend_ulong opline;
phpdbg_breakopline_t *base;
2013-11-11 11:54:41 +00:00
} phpdbg_breakline_t;
2013-11-23 23:14:16 +00:00
/**
* Breakpoint opcode based representation
*/
typedef struct _phpdbg_breakop_t {
phpdbg_breakbase(name);
zend_ulong hash;
2013-11-23 23:14:16 +00:00
} phpdbg_breakop_t;
2013-11-13 14:22:01 +00:00
/**
2013-11-23 23:18:21 +00:00
* Breakpoint condition based representation
2013-11-13 14:22:01 +00:00
*/
typedef struct _phpdbg_breakcond_t {
phpdbg_breakbase(code);
size_t code_len;
2013-12-03 00:15:33 +00:00
zend_bool paramed;
phpdbg_param_t param;
2013-11-24 11:58:08 +00:00
zend_ulong hash;
2013-11-26 10:02:58 +00:00
zend_op_array *ops;
2013-11-13 14:22:01 +00:00
} phpdbg_breakcond_t;
/* {{{ Opline breaks API */
2013-11-28 20:36:45 +00:00
PHPDBG_API void phpdbg_resolve_op_array_breaks(zend_op_array *op_array TSRMLS_DC);
2013-11-28 21:03:59 +00:00
PHPDBG_API int phpdbg_resolve_op_array_break(phpdbg_breakopline_t *brake, zend_op_array *op_array TSRMLS_DC);
PHPDBG_API int phpdbg_resolve_opline_break(phpdbg_breakopline_t *new_break TSRMLS_DC); /* }}} */
2013-11-10 20:06:19 +00:00
2013-11-27 13:28:53 +00:00
/* {{{ Breakpoint Creation API */
PHPDBG_API void phpdbg_set_breakpoint_file(const char* filename, long lineno TSRMLS_DC);
PHPDBG_API void phpdbg_set_breakpoint_symbol(const char* func_name, size_t func_name_len TSRMLS_DC);
PHPDBG_API void phpdbg_set_breakpoint_method(const char* class_name, const char* func_name TSRMLS_DC);
PHPDBG_API void phpdbg_set_breakpoint_opcode(const char* opname, size_t opname_len TSRMLS_DC);
PHPDBG_API void phpdbg_set_breakpoint_opline(zend_ulong opline TSRMLS_DC);
PHPDBG_API void phpdbg_set_breakpoint_opline_ex(phpdbg_opline_ptr_t opline TSRMLS_DC);
PHPDBG_API void phpdbg_set_breakpoint_method_opline(const char *class, const char *method, zend_ulong opline TSRMLS_DC);
PHPDBG_API void phpdbg_set_breakpoint_function_opline(const char *function, zend_ulong opline TSRMLS_DC);
PHPDBG_API void phpdbg_set_breakpoint_file_opline(const char *file, zend_ulong opline TSRMLS_DC);
2013-12-03 00:15:33 +00:00
PHPDBG_API void phpdbg_set_breakpoint_expression(const char* expression, size_t expression_len TSRMLS_DC);
PHPDBG_API void phpdbg_set_breakpoint_at(const phpdbg_param_t *param, const phpdbg_input_t *input TSRMLS_DC); /* }}} */
2013-11-10 18:24:08 +00:00
2013-11-27 13:28:53 +00:00
/* {{{ Breakpoint Detection API */
PHPDBG_API phpdbg_breakbase_t* phpdbg_find_breakpoint(zend_execute_data* TSRMLS_DC); /* }}} */
2013-11-10 20:06:19 +00:00
2013-11-27 13:28:53 +00:00
/* {{{ Misc Breakpoint API */
PHPDBG_API void phpdbg_hit_breakpoint(phpdbg_breakbase_t* brake, zend_bool output TSRMLS_DC);
2013-11-23 18:12:51 +00:00
PHPDBG_API void phpdbg_print_breakpoints(zend_ulong type TSRMLS_DC);
2013-11-27 13:28:53 +00:00
PHPDBG_API void phpdbg_print_breakpoint(phpdbg_breakbase_t* brake TSRMLS_DC);
PHPDBG_API void phpdbg_reset_breakpoints(TSRMLS_D);
PHPDBG_API void phpdbg_clear_breakpoints(TSRMLS_D);
2013-12-02 13:19:13 +00:00
PHPDBG_API void phpdbg_delete_breakpoint(zend_ulong num TSRMLS_DC);
PHPDBG_API void phpdbg_enable_breakpoints(TSRMLS_D);
PHPDBG_API void phpdbg_enable_breakpoint(zend_ulong id TSRMLS_DC);
PHPDBG_API void phpdbg_disable_breakpoint(zend_ulong id TSRMLS_DC);
PHPDBG_API void phpdbg_disable_breakpoints(TSRMLS_D); /* }}} */
2013-11-11 17:19:05 +00:00
2013-12-02 13:43:21 +00:00
/* {{{ Breakbase API */
PHPDBG_API phpdbg_breakbase_t *phpdbg_find_breakbase(zend_ulong id TSRMLS_DC);
PHPDBG_API phpdbg_breakbase_t *phpdbg_find_breakbase_ex(zend_ulong id, HashTable ***table, HashPosition *position TSRMLS_DC); /* }}} */
2013-11-11 17:19:05 +00:00
2013-11-27 13:28:53 +00:00
/* {{{ Breakpoint Exportation API */
PHPDBG_API void phpdbg_export_breakpoints(FILE *handle TSRMLS_DC); /* }}} */
#endif /* PHPDBG_BP_H */