Fixed bug #70531 (-rr should not fallback to interactive mode in phpdbg)

This commit is contained in:
Bob Weinand 2015-09-23 18:30:13 +02:00
parent 4a174ca7e6
commit bccac3774b
5 changed files with 21 additions and 8 deletions

2
NEWS
View file

@ -30,6 +30,8 @@ PHP NEWS
- Phpdbg: - Phpdbg:
. Fixed bug #70532 (phpdbg must respect set_exception_handler). (Bob) . Fixed bug #70532 (phpdbg must respect set_exception_handler). (Bob)
. Fixed bug #70531 (Run and quit mode (-qrr) should not fallback to
interactive mode). (Bob)
- Session: - Session:
. Fixed bug #70529 (Session read causes "String is not zero-terminated" error). . Fixed bug #70529 (Session read causes "String is not zero-terminated" error).

View file

@ -1835,6 +1835,11 @@ phpdbg_interact:
if (phpdbg_startup_run) { if (phpdbg_startup_run) {
quit_immediately = phpdbg_startup_run > 1; quit_immediately = phpdbg_startup_run > 1;
phpdbg_startup_run = 0; 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); PHPDBG_COMMAND_HANDLER(run)(NULL);
if (quit_immediately) { if (quit_immediately) {
/* if -r is on the command line more than once just quit */ /* if -r is on the command line more than once just quit */

View file

@ -183,16 +183,17 @@ int phpdbg_do_parse(phpdbg_param_t *stack, char *input);
#define PHPDBG_IS_INITIALIZING (1ULL<<25) #define PHPDBG_IS_INITIALIZING (1ULL<<25)
#define PHPDBG_IS_SIGNALED (1ULL<<26) #define PHPDBG_IS_SIGNALED (1ULL<<26)
#define PHPDBG_IS_INTERACTIVE (1ULL<<27) #define PHPDBG_IS_INTERACTIVE (1ULL<<27)
#define PHPDBG_IS_BP_ENABLED (1ULL<<28) #define PHPDBG_PREVENT_INTERACTIVE (1ULL<<28)
#define PHPDBG_IS_REMOTE (1ULL<<29) #define PHPDBG_IS_BP_ENABLED (1ULL<<29)
#define PHPDBG_IS_DISCONNECTED (1ULL<<30) #define PHPDBG_IS_REMOTE (1ULL<<30)
#define PHPDBG_WRITE_XML (1ULL<<31) #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_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) #define PHPDBG_BP_RESOLVE_MASK (PHPDBG_HAS_FUNCTION_OPLINE_BP | PHPDBG_HAS_METHOD_OPLINE_BP | PHPDBG_HAS_FILE_OPLINE_BP)

View file

@ -383,7 +383,7 @@ phpdbg_help_text_t phpdbg_help_text[] = {
" **-I** Ignore default .phpdbginit" CR " **-I** Ignore default .phpdbginit" CR
" **-O** **-O**my.oplog Sets oplog output file" CR " **-O** **-O**my.oplog Sets oplog output file" CR
" **-r** Run execution context" 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** Generate extended information for debugger/profiler" CR
" **-E** Enable step through eval, careful!" CR " **-E** Enable step through eval, careful!" CR
" **-S** **-S**cli Override SAPI name, careful!" CR " **-S** **-S**cli Override SAPI name, careful!" CR

View file

@ -1476,6 +1476,11 @@ void phpdbg_execute_ex(zend_execute_data *execute_data) /* {{{ */
} }
#endif #endif
if (PHPDBG_G(flags) & PHPDBG_PREVENT_INTERACTIVE) {
phpdbg_print_opline_ex(execute_data, 0);
goto next;
}
/* check for uncaught exceptions */ /* check for uncaught exceptions */
if (exception && PHPDBG_G(handled_exception) != exception && !(PHPDBG_G(flags) & PHPDBG_IN_EVAL)) { if (exception && PHPDBG_G(handled_exception) != exception && !(PHPDBG_G(flags) & PHPDBG_IN_EVAL)) {
zend_execute_data *prev_ex = execute_data; zend_execute_data *prev_ex = execute_data;