com php-src: fix symbol breakpoints: phpdbg_bp.c phpdbg _help.c phpdbg_prompt.c

From: Date: Sun, 10 Nov 2013 18:56:19 +0000
Subject: com php-src: fix symbol breakpoints: phpdbg_bp.c phpdbg _help.c phpdbg_prompt.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-75182@lists.php.net to get a copy of this message
Commit: 663a13635ac00b139d4882daeea44214b04cb9ba Author: krakjoe <joe.watkins@live.co.uk> Sun, 10 Nov 2013 18:56:19 +0000 Parents: fa63ecbba9e128ab49b6d3b753628cc82f7dfdb3 Branches: PHP-5.6 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=663a13635ac00b139d4882daeea44214b04cb9ba Log: fix symbol breakpoints Changed paths: M phpdbg_bp.c M phpdbg_help.c M phpdbg_prompt.c Diff: diff --git a/phpdbg_bp.c b/phpdbg_bp.c index a45ab16..52f0a24 100644 --- a/phpdbg_bp.c +++ b/phpdbg_bp.c @@ -135,7 +135,7 @@ int phpdbg_breakpoint_symbol(zend_function *fbc TSRMLS_DC) /* {{{ */ if (!fname) { fname = "main"; } - + if (zend_hash_find(&PHPDBG_G(bp_symbols), fname, strlen(fname), (void**)&break_list) == SUCCESS) { printf("breakpoint reached!\n"); diff --git a/phpdbg_help.c b/phpdbg_help.c index 26811d0..370c15e 100644 --- a/phpdbg_help.c +++ b/phpdbg_help.c @@ -82,10 +82,12 @@ PHPDBG_HELP(break) /* {{{ */ { printf("Setting a breakpoint stops execution at a specific stage, the syntax is:\n"); printf("\tfile:line\n"); - printf("[more to come]\n"); + printf("\tfunction\n"); printf("For example:\n"); printf("\tphpdbg> break test.php:1\n"); printf("Will break execution on line 1 of test.php\n"); + printf("\tphpdbg> break my_function\n"); + printf("Will break execution on entry to my_function\n"); return SUCCESS; } /* }}} */ diff --git a/phpdbg_prompt.c b/phpdbg_prompt.c index dee88d2..a5fa359 100644 --- a/phpdbg_prompt.c +++ b/phpdbg_prompt.c @@ -531,8 +531,6 @@ zend_vm_enter: } #endif - phpdbg_print_opline(execute_data TSRMLS_CC); - if (PHPDBG_G(has_file_bp) && phpdbg_breakpoint_file(execute_data->op_array TSRMLS_CC) == SUCCESS) { while (phpdbg_interactive(0, NULL TSRMLS_CC) != PHPDBG_NEXT) { @@ -540,15 +538,33 @@ zend_vm_enter: } } - if (PHPDBG_G(has_sym_bp) - && (execute_data->opline->opcode == ZEND_DO_FCALL || execute_data->opline->opcode == ZEND_DO_FCALL_BY_NAME) - && phpdbg_breakpoint_symbol(execute_data->function_state.function TSRMLS_CC) == SUCCESS) { - while (phpdbg_interactive(0, NULL TSRMLS_CC) != PHPDBG_NEXT) { - continue; - } - } - + if (PHPDBG_G(has_sym_bp)) { + zend_execute_data *previous = execute_data->prev_execute_data; + if (previous && (previous != execute_data)) { + if (previous->opline) { + if (previous->opline->opcode == ZEND_DO_FCALL || previous->opline->opcode == ZEND_DO_FCALL_BY_NAME) { + if (phpdbg_breakpoint_symbol(previous->function_state.function TSRMLS_CC) == SUCCESS) { + while (phpdbg_interactive(0, NULL TSRMLS_CC) != PHPDBG_NEXT) { + continue; + } + } + } + } + } else { + if (execute_data->opline->opcode == ZEND_DO_FCALL || execute_data->opline->opcode == ZEND_DO_FCALL_BY_NAME) { + if (phpdbg_breakpoint_symbol(execute_data->function_state.function TSRMLS_CC) == SUCCESS) { + while (phpdbg_interactive(0, NULL TSRMLS_CC) != PHPDBG_NEXT) { + continue; + } + } + } + } + } + PHPDBG_G(vmret) = execute_data->opline->handler(execute_data TSRMLS_CC); + + phpdbg_print_opline( + execute_data TSRMLS_CC); if (PHPDBG_G(stepping)) { while (phpdbg_interactive(

« previous php.cvs (#75182) next »