From 5cc88ca88a5388865ceab7c116be1c4c6b57a97f Mon Sep 17 00:00:00 2001 From: krakjoe Date: Mon, 18 Nov 2013 11:04:24 +0000 Subject: [PATCH] fix stack entry detection for symbol breakpoints count yield as return for leave/finish --- phpdbg_prompt.c | 18 +++++------------- test.php | 2 +- 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/phpdbg_prompt.c b/phpdbg_prompt.c index 66293e3a9f..e5cd87f1ac 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 870f9f4188..45aeb816cb 100644 --- a/test.php +++ b/test.php @@ -20,7 +20,7 @@ function test() { $foo(); - return $var; + yield $var; } $dbg = new phpdbg(); -- 2.50.1