* A break point must always set the correct id and type
* A set breakpoint function must always map new points
*/
-static inline void _phpdbg_break_mapping(int id, HashTable *table)
+static inline void _phpdbg_break_mapping(int id, HashTable *table) /* {{{ */
{
zend_hash_index_update_ptr(&PHPDBG_G(bp)[PHPDBG_BREAK_MAP], id, table);
}
+/* }}} */
#define PHPDBG_BREAK_MAPPING(id, table) _phpdbg_break_mapping(id, table)
#define PHPDBG_BREAK_UNMAPPING(id) \
phpdbg_export_breakpoints_to_string(&string);
fputs(string, handle);
}
+/* }}} */
PHPDBG_API void phpdbg_export_breakpoints_to_string(char **str) /* {{{ */
{
zend_hash_index_update_mem(method_table, opline, &new_break, sizeof(phpdbg_breakopline_t));
}
+/* }}} */
PHPDBG_API void phpdbg_set_breakpoint_function_opline(const char *function, zend_ulong opline) /* {{{ */
{
zend_hash_index_update_mem(func_table, opline, &new_break, sizeof(phpdbg_breakopline_t));
}
+/* }}} */
PHPDBG_API void phpdbg_set_breakpoint_file_opline(const char *file, zend_ulong opline) /* {{{ */
{
zend_hash_index_update_mem(file_table, opline, &new_break, sizeof(phpdbg_breakopline_t));
}
+/* }}} */
PHPDBG_API void phpdbg_set_breakpoint_opcode(const char *name, size_t name_len) /* {{{ */
{
phpdbg_try_file_init(init_file, init_file_len, 1);
}
}
+/* }}} */
PHPDBG_COMMAND(exec) /* {{{ */
{
return PHPDBG_NEXT;
} /* }}} */
-int phpdbg_skip_line_helper() {
+int phpdbg_skip_line_helper() /* {{{ */ {
PHPDBG_G(flags) |= PHPDBG_IN_UNTIL;
PHPDBG_G(seek_ex) = EG(current_execute_data);
{
return PHPDBG_UNTIL;
}
+/* }}} */
PHPDBG_COMMAND(until) /* {{{ */
{
return phpdbg_skip_line_helper();
} /* }}} */
-static void phpdbg_seek_to_end(void) {
+static void phpdbg_seek_to_end(void) /* {{{ */ {
const zend_op *opline = EG(current_execute_data)->opline;
const zend_op_array *op_array = &EG(current_execute_data)->func->op_array - 1;
}
}
}
+/* }}} */
PHPDBG_COMMAND(finish) /* {{{ */
{
return SUCCESS;
} /* }}} */
-static inline void phpdbg_handle_exception(void) /* }}} */
+static inline void phpdbg_handle_exception(void) /* {{{ */
{
zend_fcall_info fci;
zval trace;
zend_object *ex = EG(exception);
/* get filename and linenumber before unsetting exception */
+ /* not really useful??? see blow
const char *filename = zend_get_executed_filename();
uint32_t lineno = zend_get_executed_lineno();
+ */
EG(exception) = NULL;
return SUCCESS;
} /* }}} */
-int phpdbg_output_ev_variable(char *name, size_t len, char *keyname, size_t keylen, HashTable *parent, zval *zv) {
+int phpdbg_output_ev_variable(char *name, size_t len, char *keyname, size_t keylen, HashTable *parent, zval *zv) /* {{{ */ {
phpdbg_notice("eval", "variable=\"%.*s\"", "Printing variable %.*s", (int) len, name);
phpdbg_xml("<eval %r>");
zend_print_zval_r(zv, 0);
return SUCCESS;
}
+/* }}} */
PHPDBG_COMMAND(ev) /* {{{ */
{
return SUCCESS;
} /* }}} */
-static int add_module_info(zend_module_entry *module) {
+static int add_module_info(zend_module_entry *module) /* {{{ */ {
phpdbg_write("module", "name=\"%s\"", "%s\n", module->name);
return 0;
}
+/* }}} */
-static int add_zendext_info(zend_extension *ext) {
+static int add_zendext_info(zend_extension *ext) /* {{{ */ {
phpdbg_write("extension", "name=\"%s\"", "%s\n", ext->name);
return 0;
}
+/* }}} */
-PHPDBG_API const char *phpdbg_load_module_or_extension(char **path, char **name) {
+PHPDBG_API const char *phpdbg_load_module_or_extension(char **path, char **name) /* {{{ */ {
DL_HANDLE handle;
char *extension_dir;
DL_UNLOAD(handle);
return NULL;
}
+/* }}} */
PHPDBG_COMMAND(dl) /* {{{ */
{
} /* }}} */
/* only if *not* interactive and while executing */
-void phpdbg_force_interruption(void) {
+void phpdbg_force_interruption(void) /* {{{ */ {
zend_execute_data *data = EG(current_execute_data); /* should be always readable if not NULL */
PHPDBG_G(flags) |= PHPDBG_IN_SIGNAL_HANDLER;
zend_bailout();
}
}
+/* }}} */
PHPDBG_COMMAND(eol) /* {{{ */
{