diff options
author | Bob Weinand <bobwei9@hotmail.com> | 2015-09-23 18:30:13 +0200 |
---|---|---|
committer | Bob Weinand <bobwei9@hotmail.com> | 2015-09-23 18:30:13 +0200 |
commit | bccac3774bade617d88da45e7f1781151bb16160 (patch) | |
tree | efc2d722729e828ee824aee41b903b4d91222641 /sapi | |
parent | 4a174ca7e602fb20d12b8b665eaf3ce5d4d46bd3 (diff) | |
download | php-git-bccac3774bade617d88da45e7f1781151bb16160.tar.gz |
Fixed bug #70531 (-rr should not fallback to interactive mode in phpdbg)
Diffstat (limited to 'sapi')
-rw-r--r-- | sapi/phpdbg/phpdbg.c | 5 | ||||
-rw-r--r-- | sapi/phpdbg/phpdbg.h | 15 | ||||
-rw-r--r-- | sapi/phpdbg/phpdbg_help.c | 2 | ||||
-rw-r--r-- | sapi/phpdbg/phpdbg_prompt.c | 5 |
4 files changed, 19 insertions, 8 deletions
diff --git a/sapi/phpdbg/phpdbg.c b/sapi/phpdbg/phpdbg.c index bf3a45184e..a66576c61e 100644 --- a/sapi/phpdbg/phpdbg.c +++ b/sapi/phpdbg/phpdbg.c @@ -1835,6 +1835,11 @@ phpdbg_interact: if (phpdbg_startup_run) { quit_immediately = phpdbg_startup_run > 1; phpdbg_startup_run = 0; + if (quit_immediately) { + PHPDBG_G(flags) |= PHPDBG_IS_INTERACTIVE | PHPDBG_PREVENT_INTERACTIVE; + } else { + PHPDBG_G(flags) |= PHPDBG_IS_INTERACTIVE; + } PHPDBG_COMMAND_HANDLER(run)(NULL); if (quit_immediately) { /* if -r is on the command line more than once just quit */ diff --git a/sapi/phpdbg/phpdbg.h b/sapi/phpdbg/phpdbg.h index 01b0cbb3ca..56a0714758 100644 --- a/sapi/phpdbg/phpdbg.h +++ b/sapi/phpdbg/phpdbg.h @@ -183,16 +183,17 @@ int phpdbg_do_parse(phpdbg_param_t *stack, char *input); #define PHPDBG_IS_INITIALIZING (1ULL<<25) #define PHPDBG_IS_SIGNALED (1ULL<<26) #define PHPDBG_IS_INTERACTIVE (1ULL<<27) -#define PHPDBG_IS_BP_ENABLED (1ULL<<28) -#define PHPDBG_IS_REMOTE (1ULL<<29) -#define PHPDBG_IS_DISCONNECTED (1ULL<<30) -#define PHPDBG_WRITE_XML (1ULL<<31) +#define PHPDBG_PREVENT_INTERACTIVE (1ULL<<28) +#define PHPDBG_IS_BP_ENABLED (1ULL<<29) +#define PHPDBG_IS_REMOTE (1ULL<<30) +#define PHPDBG_IS_DISCONNECTED (1ULL<<31) +#define PHPDBG_WRITE_XML (1ULL<<32) -#define PHPDBG_SHOW_REFCOUNTS (1ULL<<32) +#define PHPDBG_SHOW_REFCOUNTS (1ULL<<33) -#define PHPDBG_IN_SIGNAL_HANDLER (1ULL<<33) +#define PHPDBG_IN_SIGNAL_HANDLER (1ULL<<34) -#define PHPDBG_DISCARD_OUTPUT (1ULL<<34) +#define PHPDBG_DISCARD_OUTPUT (1ULL<<35) #define PHPDBG_SEEK_MASK (PHPDBG_IN_UNTIL | PHPDBG_IN_FINISH | PHPDBG_IN_LEAVE) #define PHPDBG_BP_RESOLVE_MASK (PHPDBG_HAS_FUNCTION_OPLINE_BP | PHPDBG_HAS_METHOD_OPLINE_BP | PHPDBG_HAS_FILE_OPLINE_BP) diff --git a/sapi/phpdbg/phpdbg_help.c b/sapi/phpdbg/phpdbg_help.c index ea3df17c01..a99191d510 100644 --- a/sapi/phpdbg/phpdbg_help.c +++ b/sapi/phpdbg/phpdbg_help.c @@ -383,7 +383,7 @@ phpdbg_help_text_t phpdbg_help_text[] = { " **-I** Ignore default .phpdbginit" CR " **-O** **-O**my.oplog Sets oplog output file" CR " **-r** Run execution context" CR -" **-rr** Run execution context and quit after execution" CR +" **-rr** Run execution context and quit after execution (not respecting breakpoints)" CR " **-e** Generate extended information for debugger/profiler" CR " **-E** Enable step through eval, careful!" CR " **-S** **-S**cli Override SAPI name, careful!" CR diff --git a/sapi/phpdbg/phpdbg_prompt.c b/sapi/phpdbg/phpdbg_prompt.c index 0314d39f24..f5341075d0 100644 --- a/sapi/phpdbg/phpdbg_prompt.c +++ b/sapi/phpdbg/phpdbg_prompt.c @@ -1476,6 +1476,11 @@ void phpdbg_execute_ex(zend_execute_data *execute_data) /* {{{ */ } #endif + if (PHPDBG_G(flags) & PHPDBG_PREVENT_INTERACTIVE) { + phpdbg_print_opline_ex(execute_data, 0); + goto next; + } + /* check for uncaught exceptions */ if (exception && PHPDBG_G(handled_exception) != exception && !(PHPDBG_G(flags) & PHPDBG_IN_EVAL)) { zend_execute_data *prev_ex = execute_data; |