]> granicus.if.org Git - php/commitdiff
stop multiple executions from occuring at once, #5
authorkrakjoe <joe.watkins@live.co.uk>
Mon, 11 Nov 2013 15:54:33 +0000 (15:54 +0000)
committerkrakjoe <joe.watkins@live.co.uk>
Mon, 11 Nov 2013 15:54:33 +0000 (15:54 +0000)
phpdbg.c
phpdbg_prompt.c
test.php

index 351bdc6ba26508178df72bcecf6971b6ff2d1852..d24016275c7baed5ea0dd7c36156d7d63303ac02 100644 (file)
--- 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));
                
index f0f299ec51c9a6dee829f6668528de07ff12fa33..3e3929ec437e920840051d7c9796e2f54e63c646 100644 (file)
@@ -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;
+                               }
                        }
                }
 
index 938d7d8323df8171137ad1bafaf540521e7445e5..20fc66c7c5beee27af5dbf09e5633dabe44cbf68 100644 (file)
--- a/test.php
+++ b/test.php
@@ -6,6 +6,7 @@ function test() {
        $hidden = "variable";
        phpdbg_break();
 }
+
 function test2() {
     echo "Hello World 2\n";
 }