diff options
Diffstat (limited to 'sapi/phpdbg/phpdbg.c')
-rw-r--r-- | sapi/phpdbg/phpdbg.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/sapi/phpdbg/phpdbg.c b/sapi/phpdbg/phpdbg.c index f2f18b944e..74bf84adff 100644 --- a/sapi/phpdbg/phpdbg.c +++ b/sapi/phpdbg/phpdbg.c @@ -21,6 +21,7 @@ #if !defined(ZEND_SIGNALS) || defined(_WIN32) # include <signal.h> #endif + #include "phpdbg.h" #include "phpdbg_prompt.h" #include "phpdbg_bp.h" @@ -32,6 +33,8 @@ #include "zend_alloc.h" #include "phpdbg_eol.h" +#include "ext/standard/basic_functions.h" + /* {{{ remote console headers */ #ifndef _WIN32 # include <sys/socket.h> @@ -62,6 +65,7 @@ PHP_INI_BEGIN() PHP_INI_END() static zend_bool phpdbg_booted = 0; +static zend_bool phpdbg_fully_started = 0; #if PHP_VERSION_ID >= 50500 void (*zend_execute_old)(zend_execute_data *execute_data); @@ -520,6 +524,10 @@ static void php_sapi_phpdbg_log_message(char *message) /* {{{ */ phpdbg_list_file(file, 3, zend_get_executed_lineno() - 1, zend_get_executed_lineno()); efree(file); + if (!phpdbg_fully_started) { + return; + } + do { switch (phpdbg_interactive(1)) { case PHPDBG_LEAVE: @@ -1473,7 +1481,11 @@ phpdbg_main: if (settings) { PHPDBG_G(flags) |= PHPDBG_DISCARD_OUTPUT; } - phpdbg_compile(); + + zend_try { + phpdbg_compile(); + } zend_end_try(); + PHPDBG_G(flags) &= ~PHPDBG_DISCARD_OUTPUT; } @@ -1482,6 +1494,8 @@ phpdbg_main: PHPDBG_G(flags) |= PHPDBG_IS_STEPPING; } + phpdbg_fully_started = 1; + /* #ifndef for making compiler shutting up */ #ifndef _WIN32 phpdbg_interact: |