From: Bob Weinand Date: Sat, 1 Oct 2016 18:14:26 +0000 (+0100) Subject: Merge branch 'PHP-7.0' into PHP-7.1 X-Git-Tag: php-7.1.0RC4~99 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3fe1010ceebe231afcee8aceae6782c18da23539;p=php Merge branch 'PHP-7.0' into PHP-7.1 --- 3fe1010ceebe231afcee8aceae6782c18da23539 diff --cc sapi/phpdbg/phpdbg.c index 1e0b214a23,234d0f912e..0e891f3869 --- a/sapi/phpdbg/phpdbg.c +++ b/sapi/phpdbg/phpdbg.c @@@ -274,26 -262,11 +274,31 @@@ static PHP_MSHUTDOWN_FUNCTION(phpdbg) / PHPDBG_G(oplog_list) = NULL; } + fflush(stdout); + if (SG(request_info).argv0) { + free(SG(request_info).argv0); + SG(request_info).argv0 = NULL; + } + + return SUCCESS; +} +/* }}} */ + +static PHP_RINIT_FUNCTION(phpdbg) /* {{{ */ +{ + /* deactivate symbol table caching to have these properly destroyed upon stack leaving (especially important for watchpoints) */ + EG(symtable_cache_limit) = EG(symtable_cache) - 1; + + return SUCCESS; +} /* }}} */ + +static PHP_RSHUTDOWN_FUNCTION(phpdbg) /* {{{ */ +{ + if (PHPDBG_G(stdin_file)) { + fclose(PHPDBG_G(stdin_file)); + PHPDBG_G(stdin_file) = NULL; + } + return SUCCESS; } /* }}} */ @@@ -2014,7 -2036,13 +2047,12 @@@ phpdbg_out } } } - php_output_deactivate(); + { + php_stream_wrapper *wrapper = zend_hash_str_find_ptr(php_stream_get_url_stream_wrappers_hash(), ZEND_STRL("php")); + wrapper->wops->stream_opener = PHPDBG_G(orig_url_wrap_php); + } + zend_try { php_module_shutdown(); } zend_end_try(); diff --cc sapi/phpdbg/phpdbg_prompt.c index c0ce007715,7315ff2afe..4ade755877 --- a/sapi/phpdbg/phpdbg_prompt.c +++ b/sapi/phpdbg/phpdbg_prompt.c @@@ -728,6 -778,21 +777,21 @@@ free_cmd php_build_argv(NULL, &PG(http_globals)[TRACK_VARS_SERVER]); } + /* clean up from last execution */ - if (ex && ex->symbol_table) { ++ if (ex && (ZEND_CALL_INFO(ex) & ZEND_CALL_HAS_SYMBOL_TABLE)) { + zend_hash_clean(ex->symbol_table); + } else { + zend_rebuild_symbol_table(); + } + PHPDBG_G(handled_exception) = NULL; + + /* clean seek state */ + PHPDBG_G(flags) &= ~PHPDBG_SEEK_MASK; + zend_hash_clean(&PHPDBG_G(seek)); + + /* reset hit counters */ + phpdbg_reset_breakpoints(); + zend_try { PHPDBG_G(flags) ^= PHPDBG_IS_INTERACTIVE; PHPDBG_G(flags) |= PHPDBG_IS_RUNNING;