]> granicus.if.org Git - php/commitdiff
Merge branch 'PHP-7.0' into PHP-7.1
authorBob Weinand <bobwei9@hotmail.com>
Sat, 1 Oct 2016 18:14:26 +0000 (19:14 +0100)
committerBob Weinand <bobwei9@hotmail.com>
Sat, 1 Oct 2016 18:14:26 +0000 (19:14 +0100)
1  2 
sapi/phpdbg/phpdbg.c
sapi/phpdbg/phpdbg.h
sapi/phpdbg/phpdbg_prompt.c

index 1e0b214a2358b6d69aa71ebe8a25f097eef4146d,234d0f912e4d32821ba5f7a86c40f73f4a76078d..0e891f3869969853d59eb38d37854a11c4a0b573
@@@ -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();
Simple merge
index c0ce007715efa1212dd51abf969e8ecbf86ce387,7315ff2afe2a67999dc636209cc15d8665ac689d..4ade75587775503d2cececd224686e47521c8291
@@@ -728,6 -778,21 +777,21 @@@ free_cmd
                        php_build_argv(NULL, &PG(http_globals)[TRACK_VARS_SERVER]);
                }
  
 -              if (ex && ex->symbol_table) {
+               /* clean up from last execution */
++              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;