From: krakjoe Date: Mon, 11 Nov 2013 15:54:33 +0000 (+0000) Subject: stop multiple executions from occuring at once, #5 X-Git-Tag: php-5.6.0alpha1~110^2~478 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3e3a7babaded7cd5f856debb1175c56ced3c1905;p=php stop multiple executions from occuring at once, #5 --- diff --git a/phpdbg.c b/phpdbg.c index 351bdc6ba2..d24016275c 100644 --- a/phpdbg.c +++ b/phpdbg.c @@ -396,7 +396,7 @@ int main(int argc, char *argv[]) /* {{{ */ zend_try { phpdbg_interactive(TSRMLS_C); } zend_catch { - + } zend_end_try(); } while(!PHPDBG_G(quitting)); diff --git a/phpdbg_prompt.c b/phpdbg_prompt.c index f0f299ec51..3e3929ec43 100644 --- a/phpdbg_prompt.c +++ b/phpdbg_prompt.c @@ -110,6 +110,11 @@ static PHPDBG_COMMAND(next) /* {{{ */ static PHPDBG_COMMAND(run) /* {{{ */ { + if (EG(in_execution)) { + printf("[Cannot start another execution while on is in progress]\n"); + return FAILURE; + } + if (PHPDBG_G(ops) || PHPDBG_G(exec)) { if (!PHPDBG_G(ops)) { if (phpdbg_compile(TSRMLS_C) == FAILURE) { @@ -528,7 +533,9 @@ zend_vm_enter: if (PHPDBG_G(has_file_bp) && phpdbg_find_breakpoint_file(execute_data->op_array TSRMLS_CC) == SUCCESS) { while (phpdbg_interactive(TSRMLS_C) != PHPDBG_NEXT) { - continue; + if (!PHPDBG_G(quitting)) { + continue; + } } } @@ -540,7 +547,9 @@ zend_vm_enter: if (phpdbg_find_breakpoint_symbol( previous->function_state.function TSRMLS_CC) == SUCCESS) { while (phpdbg_interactive(TSRMLS_C) != PHPDBG_NEXT) { - continue; + if (!PHPDBG_G(quitting)) { + continue; + } } } } @@ -550,10 +559,12 @@ zend_vm_enter: if (PHPDBG_G(has_opline_bp) && phpdbg_find_breakpoint_opline(execute_data->opline TSRMLS_CC) == SUCCESS) { while (phpdbg_interactive(TSRMLS_C) != PHPDBG_NEXT) { - continue; + if (!PHPDBG_G(quitting)) { + continue; + } } } - + PHPDBG_G(vmret) = execute_data->opline->handler(execute_data TSRMLS_CC); phpdbg_print_opline( @@ -561,7 +572,9 @@ zend_vm_enter: if (PHPDBG_G(stepping)) { while (phpdbg_interactive(TSRMLS_C) != PHPDBG_NEXT) { - continue; + if (!PHPDBG_G(quitting)) { + continue; + } } } diff --git a/test.php b/test.php index 938d7d8323..20fc66c7c5 100644 --- a/test.php +++ b/test.php @@ -6,6 +6,7 @@ function test() { $hidden = "variable"; phpdbg_break(); } + function test2() { echo "Hello World 2\n"; }