diff options
author | Bob Weinand <bobwei9@hotmail.com> | 2013-11-25 23:45:55 +0100 |
---|---|---|
committer | Bob Weinand <bobwei9@hotmail.com> | 2013-11-25 23:45:55 +0100 |
commit | 02ae3f8de1799d5ae4a6fa2cc86a34acb4767e9c (patch) | |
tree | e09cccc2933e87519fba1465178e819213b68893 /phpdbg_bp.c | |
parent | 4e6a8eeffa4cdec4b75303788e676468fdf6129e (diff) | |
download | php-git-02ae3f8de1799d5ae4a6fa2cc86a34acb4767e9c.tar.gz |
Merge branch 'master' of https://github.com/krakjoe/phpdbg
Diffstat (limited to 'phpdbg_bp.c')
-rw-r--r-- | phpdbg_bp.c | 40 |
1 files changed, 22 insertions, 18 deletions
diff --git a/phpdbg_bp.c b/phpdbg_bp.c index afd0be0d00..40a3a50fc7 100644 --- a/phpdbg_bp.c +++ b/phpdbg_bp.c @@ -48,20 +48,20 @@ PHPDBG_API void phpdbg_export_breakpoints(FILE *handle TSRMLS_DC) /* {{{ */ { HashPosition position; HashTable *table = NULL; - + if (PHPDBG_G(flags) & PHPDBG_HAS_FILE_BP) { zend_llist *brakes; table = &PHPDBG_G(bp)[PHPDBG_BREAK_FILE]; - + for (zend_hash_internal_pointer_reset_ex(table, &position); zend_hash_get_current_data_ex(table, (void*) &brakes, &position) == SUCCESS; zend_hash_move_forward_ex(table, &position)) { - + zend_llist_position lposition; phpdbg_breakfile_t *brake; zend_ulong count = zend_llist_count(brakes); - + if ((brake = zend_llist_get_first_ex(brakes, &lposition))) { phpdbg_notice( "Exporting file breakpoints in %s (%d)", brake->filename, count); @@ -72,14 +72,14 @@ PHPDBG_API void phpdbg_export_breakpoints(FILE *handle TSRMLS_DC) /* {{{ */ } } } - + if (PHPDBG_G(flags) & PHPDBG_HAS_SYM_BP) { phpdbg_breaksymbol_t *brake; - + table = &PHPDBG_G(bp)[PHPDBG_BREAK_SYM]; - + phpdbg_notice("Exporting symbol breakpoints (%d)", zend_hash_num_elements(table)); - + for (zend_hash_internal_pointer_reset_ex(table, &position); zend_hash_get_current_data_ex(table, (void*) &brake, &position) == SUCCESS; zend_hash_move_forward_ex(table, &position)) { @@ -106,36 +106,36 @@ PHPDBG_API void phpdbg_export_breakpoints(FILE *handle TSRMLS_DC) /* {{{ */ zend_hash_move_forward_ex(class, &mposition)) { if (!noted) { phpdbg_notice( - "Exporting method breakpoints in %s (%d)", + "Exporting method breakpoints in %s (%d)", brake->class_name, zend_hash_num_elements(class)); noted = 1; } - + fprintf( handle, "break %s::%s\n", brake->class_name, brake->func_name); } } } - + if (PHPDBG_G(flags) & PHPDBG_HAS_OPCODE_BP) { phpdbg_breakop_t *brake; - + table = &PHPDBG_G(bp)[PHPDBG_BREAK_OPCODE]; - + phpdbg_notice( "Exporting opcode breakpoints (%d)", zend_hash_num_elements(table)); - + for (zend_hash_internal_pointer_reset_ex(table, &position); zend_hash_get_current_data_ex(table, (void**) &brake, &position) == SUCCESS; zend_hash_move_forward_ex(table, &position)) { - + fprintf( - handle, "break op %s\n", brake->name); + handle, "break op %s\n", brake->name); } } - + /* export other types here after resolving errors from source command */ - + } /* }}} */ PHPDBG_API void phpdbg_set_breakpoint_file(const char *path, long line_num TSRMLS_DC) /* {{{ */ @@ -545,6 +545,10 @@ int phpdbg_find_conditional_breakpoint(TSRMLS_D) /* {{{ */ int phpdbg_find_breakpoint(zend_execute_data* execute_data TSRMLS_DC) /* {{{ */ { + if (!(PHPDBG_G(flags) & PHPDBG_IS_BP_ENABLED)) { + return FAILURE; + } + /* conditions cannot be executed by eval()'d code */ if (!(PHPDBG_G(flags) & PHPDBG_IN_EVAL) && (PHPDBG_G(flags) & PHPDBG_HAS_COND_BP) |