From: krakjoe Date: Wed, 20 Nov 2013 16:50:12 +0000 (+0000) Subject: fix stepping into code from command line X-Git-Tag: php-5.6.0alpha1~110^2~164 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=311c22277d7b91ce5a9bd915efc22f5706acbc5a;p=php fix stepping into code from command line --- diff --git a/phpdbg.c b/phpdbg.c index 5e9432e1e6..9c3ca38923 100644 --- 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); diff --git a/phpdbg.h b/phpdbg.h index 889639a2ec..2f99543c6f 100644 --- 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)