com php-src: Fix failing quit when quitting during execution: phpdbg_prompt.c
| From: | Bob Weinand | Date: | Mon, 27 Oct 2014 10:02:08 +0000 |
| Subject: | com php-src: Fix failing quit when quitting during execution: phpdbg_prompt.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-82683@lists.php.net to get a copy of this message | ||
Commit: b4db856d374d0df47e902b65639ab9a06346aa8a
Author: Bob Weinand <bobwei9@hotmail.com> Mon, 27 Oct 2014 11:02:08 +0100
Parents: 9139d031d8877f061f7cefafefa41260017e9563
Branches: PHP-5.6
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=b4db856d374d0df47e902b65639ab9a06346aa8a
Log:
Fix failing quit when quitting during execution
Changed paths:
M phpdbg_prompt.c
Diff:
diff --git a/phpdbg_prompt.c b/phpdbg_prompt.c
index 0e527c6..73ecbcb 100644
--- a/phpdbg_prompt.c
+++ b/phpdbg_prompt.c
@@ -653,6 +653,10 @@ PHPDBG_COMMAND(run) /* {{{ */
EG(opline_ptr) = orig_opline;
EG(return_value_ptr_ptr) = orig_retval_ptr;
+ if (PHPDBG_G(flags) & PHPDBG_IS_QUITTING) {
+ zend_bailout();
+ }
+
if (!(PHPDBG_G(flags) & PHPDBG_IS_STOPPING)) {
phpdbg_error("stop", "type=\"bailout\"", "Caught exit/error
from VM");
restore = 0;
@@ -1143,6 +1147,7 @@ PHPDBG_COMMAND(quit) /* {{{ */
/* don't allow this to loop, ever ... */
if (!(PHPDBG_G(flags) & PHPDBG_IS_STOPPING)) {
PHPDBG_G(flags) |= PHPDBG_IS_QUITTING;
+ PHPDBG_G(flags) &= ~(PHPDBG_IS_RUNNING | PHPDBG_IS_CLEANING);
zend_bailout();
}
@@ -1261,8 +1266,7 @@ int phpdbg_interactive(zend_bool allow_async_unsafe TSRMLS_DC) /* {{{ */
#ifdef PHP_WIN32
#define PARA ((phpdbg_param_t *)stack.next)->type
-#define HANDLE_SIGIO (PHPDBG_G(flags) & PHPDBG_IS_REMOTE) && PARA != EMPTY_PARAM
- if (HANDLE_SIGIO) {
+ if (PHPDBG_G(flags) & PHPDBG_IS_REMOTE && (RUN_PARAM == PARA || EVAL_PARAM == PARA))
{
sigio_watcher_start();
}
#endif
@@ -1279,29 +1283,22 @@ int phpdbg_interactive(zend_bool allow_async_unsafe TSRMLS_DC) /* {{{ */
case PHPDBG_FINISH:
case PHPDBG_UNTIL:
case PHPDBG_NEXT: {
-#ifdef PHP_WIN32
- if (HANDLE_SIGIO) {
- sigio_watcher_stop();
- sigio_watcher_start();
- }
-#endif
phpdbg_activate_err_buf(0 TSRMLS_CC);
phpdbg_free_err_buf(TSRMLS_C);
- if (!EG(in_execution) && !(PHPDBG_G(flags) & PHPDBG_IS_QUITTING)) {
+ if (!EG(in_execution) && !(PHPDBG_G(flags) & PHPDBG_IS_STOPPING)) {
phpdbg_error("command", "type=\"noexec\"", "Not
running");
}
+ break;
}
- break;
}
phpdbg_activate_err_buf(0 TSRMLS_CC);
phpdbg_free_err_buf(TSRMLS_C);
#ifdef PHP_WIN32
- if (HANDLE_SIGIO) {
+ if (PHPDBG_G(flags) & PHPDBG_IS_REMOTE && (RUN_PARAM == PARA || EVAL_PARAM == PARA))
{
sigio_watcher_stop();
}
#undef PARA
-#undef HANDLE_SIGIO
#endif
}
@@ -1446,7 +1443,7 @@ void phpdbg_execute_ex(zend_op_array *op_array TSRMLS_DC) /* {{{ */
}
#endif
- if ((PHPDBG_G(flags) & (PHPDBG_IS_STOPPING | PHPDBG_IS_RUNNING)) == PHPDBG_IS_STOPPING) {
+ if ((PHPDBG_G(flags) & PHPDBG_IS_STOPPING) && !(PHPDBG_G(flags) &
PHPDBG_IS_RUNNING)) {
zend_bailout();
}