com php-src: correct place to start the sigio watcher: phpdbg.c phpdbg.h phpdbg_prompt.c
| From: | Bob Weinand | Date: | Tue, 21 Oct 2014 09:47:19 +0000 |
| Subject: | com php-src: correct place to start the sigio watcher: phpdbg.c phpdbg.h phpdbg_prompt.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-82523@lists.php.net to get a copy of this message | ||
Commit: 55936dc23d7adabb90c5cec06ac1eaf8e294f82b
Author: Anatol Belski <ab@php.net> Tue, 21 Oct 2014 09:55:22 +0200
Parents: da40b116a6fde9a8386e1902228e1e9353870c81
Branches: PHP-5.6
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=55936dc23d7adabb90c5cec06ac1eaf8e294f82b
Log:
correct place to start the sigio watcher
plus started with the eol command
Changed paths:
M phpdbg.c
M phpdbg.h
M phpdbg_prompt.c
Diff:
diff --git a/phpdbg.c b/phpdbg.c
index cd84aff..0eb07bc 100644
--- a/phpdbg.c
+++ b/phpdbg.c
@@ -93,6 +93,8 @@ static inline void php_phpdbg_globals_ctor(zend_phpdbg_globals *pg) /* {{{ */
pg->sigio_watcher_thread = INVALID_HANDLE_VALUE;
memset(&pg->swd, 0, sizeof(struct win32_sigio_watcher_data));
#endif
+
+ pg->eol = "\n";
} /* }}} */
static PHP_MINIT_FUNCTION(phpdbg) /* {{{ */
diff --git a/phpdbg.h b/phpdbg.h
index 09dc079..41124ea 100644
--- a/phpdbg.h
+++ b/phpdbg.h
@@ -114,9 +114,6 @@
#include "phpdbg_watch.h"
#ifdef PHP_WIN32
# include "phpdbg_sigio_win32.h"
-#else
-# define sigio_watcher_start()
-# define sigio_watcher_stop()
#endif
int phpdbg_do_parse(phpdbg_param_t *stack, char *input TSRMLS_DC);
@@ -289,6 +286,7 @@ ZEND_BEGIN_MODULE_GLOBALS(phpdbg)
HANDLE sigio_watcher_thread; /* sigio watcher thread handle */
struct win32_sigio_watcher_data swd;
#endif
+ char *eol;
ZEND_END_MODULE_GLOBALS(phpdbg) /* }}} */
#endif
diff --git a/phpdbg_prompt.c b/phpdbg_prompt.c
index 45f7b14..39d474c 100644
--- a/phpdbg_prompt.c
+++ b/phpdbg_prompt.c
@@ -83,6 +83,7 @@ const phpdbg_command_t phpdbg_prompt_commands[] = {
PHPDBG_COMMAND_D(quit, "exit phpdbg", 'q',
NULL, 0, PHPDBG_ASYNC_SAFE),
PHPDBG_COMMAND_D(wait, "wait for other process", 'W',
NULL, 0, 0),
PHPDBG_COMMAND_D(watch, "set watchpoint", 'w',
phpdbg_watch_commands, "|ss", 0),
+ //PHPDBG_COMMAND_D(eol, "set eol", 'E',
NULL, "|s", 0),
PHPDBG_END_COMMAND
}; /* }}} */
@@ -579,8 +580,6 @@ PHPDBG_COMMAND(run) /* {{{ */
zend_bool restore = 1;
zend_execute_data *ex = EG(current_execute_data);
- sigio_watcher_start();
-
if (!PHPDBG_G(ops)) {
if (phpdbg_compile(TSRMLS_C) == FAILURE) {
phpdbg_error("compile", "type=\"compilefailure\"
context=\"%s\"", "Failed to compile %s, cannot run", PHPDBG_G(exec));
@@ -637,7 +636,6 @@ PHPDBG_COMMAND(run) /* {{{ */
zend_execute(EG(active_op_array) TSRMLS_CC);
PHPDBG_G(flags) ^= PHPDBG_IS_INTERACTIVE;
phpdbg_notice("stop", "type=\"normal\"", "Script ended
normally");
- sigio_watcher_stop();
} zend_catch {
EG(active_op_array) = orig_op_array;
EG(opline_ptr) = orig_opline;
@@ -647,7 +645,6 @@ PHPDBG_COMMAND(run) /* {{{ */
phpdbg_error("stop", "type=\"bailout\"", "Caught exit/error
from VM");
restore = 0;
}
- sigio_watcher_stop();
} zend_end_try();
if (PHPDBG_G(socket_fd) != -1) {
@@ -669,7 +666,6 @@ PHPDBG_COMMAND(run) /* {{{ */
}
out:
- sigio_watcher_stop();
PHPDBG_FRAME(num) = 0;
return SUCCESS;
} /* }}} */
@@ -1208,6 +1204,11 @@ int phpdbg_interactive(zend_bool allow_async_unsafe TSRMLS_DC) /* {{{ */
if (phpdbg_do_parse(&stack, input TSRMLS_CC) <= 0) {
phpdbg_activate_err_buf(1 TSRMLS_CC);
+#ifdef PHP_WIN32
+ if (PHPDBG_G(flags) & PHPDBG_IS_REMOTE) {
+ sigio_watcher_start();
+ }
+#endif
switch (ret = phpdbg_stack_execute(&stack, allow_async_unsafe TSRMLS_CC)) {
case FAILURE:
if (!(PHPDBG_G(flags) & PHPDBG_IS_QUITTING)) {
@@ -1232,6 +1233,11 @@ int phpdbg_interactive(zend_bool allow_async_unsafe TSRMLS_DC) /* {{{ */
phpdbg_activate_err_buf(0 TSRMLS_CC);
phpdbg_free_err_buf(TSRMLS_C);
+#ifdef PHP_WIN32
+ if (PHPDBG_G(flags) & PHPDBG_IS_REMOTE) {
+ sigio_watcher_stop();
+ }
+#endif
}
phpdbg_stack_free(&stack);