com php-src: fix stack entry detection for symbol breakpoints count yield as return for leave/finish: phpdbg_prompt.c test.php
| From: | Bob Weinand | Date: | Mon, 18 Nov 2013 11:04:24 +0000 |
| Subject: | com php-src: fix stack entry detection for symbol breakpoints count yield as return for leave/finish: phpdbg_prompt.c test.php | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-74853@lists.php.net to get a copy of this message | ||
Commit: 5cc88ca88a5388865ceab7c116be1c4c6b57a97f
Author: krakjoe <joe.watkins@live.co.uk> Mon, 18 Nov 2013 11:04:24 +0000
Parents: c70c156ca1b404fe183fef05d24bb87b12cbd4c3
Branches: PHP-5.6
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=5cc88ca88a5388865ceab7c116be1c4c6b57a97f
Log:
fix stack entry detection for symbol breakpoints
count yield as return for leave/finish
Changed paths:
M phpdbg_prompt.c
M test.php
Diff:
diff --git a/phpdbg_prompt.c b/phpdbg_prompt.c
index 66293e3..e5cd87f 100644
--- a/phpdbg_prompt.c
+++ b/phpdbg_prompt.c
@@ -1124,19 +1124,11 @@ zend_vm_enter:
}
if ((PHPDBG_G(flags) & (PHPDBG_HAS_METHOD_BP|PHPDBG_HAS_SYM_BP))) {
- zend_execute_data *previous = execute_data->prev_execute_data;
- if (previous && previous != execute_data && previous->opline) {
- /* check we are the beginning of a function entry */
- if (execute_data->opline == EG(active_op_array)->opcodes) {
- switch (previous->opline->opcode) {
- case ZEND_DO_FCALL:
- case ZEND_DO_FCALL_BY_NAME:
- case ZEND_INIT_STATIC_METHOD_CALL: {
- if (phpdbg_find_breakpoint_symbol(previous->function_state.function TSRMLS_CC) ==
SUCCESS) {
- DO_INTERACTIVE();
- }
- } break;
- }
+ /* check we are at the beginning of the stack */
+ if (execute_data->opline == EG(active_op_array)->opcodes) {
+ if (phpdbg_find_breakpoint_symbol(
+ execute_data->function_state.function TSRMLS_CC) == SUCCESS) {
+ DO_INTERACTIVE();
}
}
}
diff --git a/test.php b/test.php
index 870f9f4..45aeb81 100644
--- a/test.php
+++ b/test.php
@@ -20,7 +20,7 @@ function test() {
$foo();
- return $var;
+ yield $var;
}
$dbg = new phpdbg();