com php-src: Fixed bug #70531 (-rr should not fallback to interactive mode in phpdbg): NEWS sapi/phpdbg/phpdbg.c sapi/phpdbg/phpdbg.h
sapi/phpdbg/phpdbg_help.c sapi/phpdbg/phpdbg_prompt.c
| From: | Bob Weinand | Date: | Wed, 23 Sep 2015 16:30:13 +0000 |
| Subject: | com php-src: Fixed bug #70531 (-rr should not fallback to interactive mode in phpdbg): NEWS sapi/phpdbg/phpdbg.c sapi/phpdbg/phpdbg.h sapi/phpdbg/phpdbg_help.c sapi/phpdbg/phpdbg_prompt.c |
||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-89143@lists.php.net to get a copy of this message | ||
Commit: bccac3774bade617d88da45e7f1781151bb16160
Author: Bob Weinand <bobwei9@hotmail.com> Wed, 23 Sep 2015 18:30:13 +0200
Parents: 4a174ca7e602fb20d12b8b665eaf3ce5d4d46bd3
Branches: PHP-7.0
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=bccac3774bade617d88da45e7f1781151bb16160
Log:
Fixed bug #70531 (-rr should not fallback to interactive mode in phpdbg)
Bugs:
https://bugs.php.net/70531
Changed paths:
M NEWS
M sapi/phpdbg/phpdbg.c
M sapi/phpdbg/phpdbg.h
M sapi/phpdbg/phpdbg_help.c
M sapi/phpdbg/phpdbg_prompt.c
Diff:
diff --git a/NEWS b/NEWS
index 31e7ad9..8989980 100644
--- a/NEWS
+++ b/NEWS
@@ -30,6 +30,8 @@ PHP NEWS
- Phpdbg:
. 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:
. Fixed bug #70529 (Session read causes "String is not zero-terminated" error).
diff --git a/sapi/phpdbg/phpdbg.c b/sapi/phpdbg/phpdbg.c
index bf3a451..a66576c 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 01b0cbb..56a0714 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 ea3df17..a99191d 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 0314d39..f534107 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;