com php-src: stop multiple executions from occuring at once, #5: phpdbg.c phpdbg_prompt.c test.php
| From: | Bob Weinand | Date: | Mon, 11 Nov 2013 15:54:33 +0000 |
| Subject: | com php-src: stop multiple executions from occuring at once, #5: phpdbg.c phpdbg_prompt.c test.php | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-75127@lists.php.net to get a copy of this message | ||
Commit: 3e3a7babaded7cd5f856debb1175c56ced3c1905
Author: krakjoe <joe.watkins@live.co.uk> Mon, 11 Nov 2013 15:54:33 +0000
Parents: da065d6fb2ad54450daf8f1b50d2934c6880a546
Branches: PHP-5.6
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=3e3a7babaded7cd5f856debb1175c56ced3c1905
Log:
stop multiple executions from occuring at once, #5
Bugs:
https://bugs.php.net/5
Changed paths:
M phpdbg.c
M phpdbg_prompt.c
M test.php
Diff:
diff --git a/phpdbg.c b/phpdbg.c
index 351bdc6..d240162 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 f0f299e..3e3929e 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 938d7d8..20fc66c 100644
--- a/test.php
+++ b/test.php
@@ -6,6 +6,7 @@ function test() {
$hidden = "variable";
phpdbg_break();
}
+
function test2() {
echo "Hello World 2\n";
}