]> granicus.if.org Git - php/commitdiff
fix stepping into code from command line
authorkrakjoe <joe.watkins@live.co.uk>
Wed, 20 Nov 2013 16:50:12 +0000 (16:50 +0000)
committerkrakjoe <joe.watkins@live.co.uk>
Wed, 20 Nov 2013 16:50:12 +0000 (16:50 +0000)
phpdbg.c
phpdbg.h

index 5e9432e1e6552d6618c9b3acb739a6d1190ba589..9c3ca3892316f00301e6b8cc39372d34373ad787 100644 (file)
--- a/phpdbg.c
+++ b/phpdbg.c
@@ -452,6 +452,8 @@ int main(int argc, char **argv) /* {{{ */
        int php_optind, opt, show_banner = 1;
        long cleaning = 0;
        int run = 0;
+       int step = 0;
+       
 #ifdef ZTS
        void ***tsrm_ls;
 #endif
@@ -484,6 +486,7 @@ phpdbg_main:
        php_optind = 1;
        opt = 0;
        run = 0;
+       step = 0;
        
        while ((opt = php_getopt(argc, argv, OPTIONS, &php_optarg, &php_optind, 0, 2)) != -1) {
                switch (opt) {
@@ -564,7 +567,7 @@ phpdbg_main:
                        break;
 
                        case 's': /* set stepping on */
-                               flags |= PHPDBG_IS_STEPPING;
+                               step = 1;
                        break;
 
                        case 'b': /* set colours off */
@@ -653,6 +656,11 @@ phpdbg_main:
             }
         } zend_end_try();
         
+        /* step from here, not through init */
+        if (step) {
+               PHPDBG_G(flags) |= PHPDBG_IS_STEPPING;
+        }
+        
         if (run) {
                /* no need to try{}, run does it ... */
                PHPDBG_COMMAND_HANDLER(run)(NULL, NULL TSRMLS_CC);
index 889639a2ec849b7ff725ddbd87c857f84539d31e..2f99543c6f1cd49f9e9e9b415eb8f64af9c2879c 100644 (file)
--- a/phpdbg.h
+++ b/phpdbg.h
@@ -97,6 +97,7 @@
 #define PHPDBG_SEEK_MASK               (PHPDBG_IN_UNTIL|PHPDBG_IN_FINISH|PHPDBG_IN_LEAVE)
 
 #define PHPDBG_IS_REGISTERED   (1<<16)
+#define PHPDBG_IS_STEPONEVAL   (1<<17)
 
 #ifndef _WIN32
 #   define PHPDBG_DEFAULT_FLAGS    (PHPDBG_IS_QUIET|PHPDBG_IS_COLOURED)