summaryrefslogtreecommitdiff
path: root/sapi/phpdbg
diff options
context:
space:
mode:
Diffstat (limited to 'sapi/phpdbg')
-rw-r--r--sapi/phpdbg/.gitignore6
-rw-r--r--sapi/phpdbg/.travis.yml11
-rw-r--r--sapi/phpdbg/README.md2
-rw-r--r--sapi/phpdbg/config.m41
-rw-r--r--sapi/phpdbg/create-test.php2
-rw-r--r--sapi/phpdbg/phpdbg.c32
-rw-r--r--sapi/phpdbg/phpdbg.h4
-rw-r--r--sapi/phpdbg/phpdbg_bp.c2
-rw-r--r--sapi/phpdbg/phpdbg_bp.h2
-rw-r--r--sapi/phpdbg/phpdbg_break.c2
-rw-r--r--sapi/phpdbg/phpdbg_break.h2
-rw-r--r--sapi/phpdbg/phpdbg_btree.c2
-rw-r--r--sapi/phpdbg/phpdbg_btree.h2
-rw-r--r--sapi/phpdbg/phpdbg_cmd.c8
-rw-r--r--sapi/phpdbg/phpdbg_cmd.h2
-rw-r--r--sapi/phpdbg/phpdbg_eol.c2
-rw-r--r--sapi/phpdbg/phpdbg_eol.h2
-rw-r--r--sapi/phpdbg/phpdbg_frame.c2
-rw-r--r--sapi/phpdbg/phpdbg_frame.h2
-rw-r--r--sapi/phpdbg/phpdbg_help.c2
-rw-r--r--sapi/phpdbg/phpdbg_help.h2
-rw-r--r--sapi/phpdbg/phpdbg_info.c2
-rw-r--r--sapi/phpdbg/phpdbg_info.h2
-rw-r--r--sapi/phpdbg/phpdbg_io.c2
-rw-r--r--sapi/phpdbg/phpdbg_io.h2
-rw-r--r--sapi/phpdbg/phpdbg_lexer.h2
-rw-r--r--sapi/phpdbg/phpdbg_list.c2
-rw-r--r--sapi/phpdbg/phpdbg_list.h2
-rw-r--r--sapi/phpdbg/phpdbg_opcode.c10
-rw-r--r--sapi/phpdbg/phpdbg_opcode.h2
-rw-r--r--sapi/phpdbg/phpdbg_out.c2
-rw-r--r--sapi/phpdbg/phpdbg_out.h19
-rw-r--r--sapi/phpdbg/phpdbg_print.c2
-rw-r--r--sapi/phpdbg/phpdbg_print.h2
-rw-r--r--sapi/phpdbg/phpdbg_prompt.c4
-rw-r--r--sapi/phpdbg/phpdbg_prompt.h2
-rw-r--r--sapi/phpdbg/phpdbg_rinit_hook.c20
-rw-r--r--sapi/phpdbg/phpdbg_rinit_hook.h2
-rw-r--r--sapi/phpdbg/phpdbg_set.c2
-rw-r--r--sapi/phpdbg/phpdbg_set.h2
-rw-r--r--sapi/phpdbg/phpdbg_sigio_win32.c2
-rw-r--r--sapi/phpdbg/phpdbg_sigio_win32.h2
-rw-r--r--sapi/phpdbg/phpdbg_utils.c38
-rw-r--r--sapi/phpdbg/phpdbg_utils.h2
-rw-r--r--sapi/phpdbg/phpdbg_wait.c2
-rw-r--r--sapi/phpdbg/phpdbg_wait.h2
-rw-r--r--sapi/phpdbg/phpdbg_watch.c3
-rw-r--r--sapi/phpdbg/phpdbg_watch.h2
-rw-r--r--sapi/phpdbg/phpdbg_webdata_transfer.c4
-rw-r--r--sapi/phpdbg/phpdbg_webdata_transfer.h4
-rw-r--r--sapi/phpdbg/phpdbg_win.c2
-rw-r--r--sapi/phpdbg/phpdbg_win.h2
-rw-r--r--sapi/phpdbg/tests/run_001.phpt2
-rwxr-xr-xsapi/phpdbg/travis/ci.sh11
54 files changed, 127 insertions, 126 deletions
diff --git a/sapi/phpdbg/.gitignore b/sapi/phpdbg/.gitignore
deleted file mode 100644
index 51165dab2f..0000000000
--- a/sapi/phpdbg/.gitignore
+++ /dev/null
@@ -1,6 +0,0 @@
-.libs/
-phpdbg
-*.lo
-*.o
-*.output
-build
diff --git a/sapi/phpdbg/.travis.yml b/sapi/phpdbg/.travis.yml
deleted file mode 100644
index 2e777fbe13..0000000000
--- a/sapi/phpdbg/.travis.yml
+++ /dev/null
@@ -1,11 +0,0 @@
-language: c
-
-env:
-- PHP="PHP-5.4"
-- PHP="PHP-5.5"
-- PHP="PHP-5.6"
-
-before_script: ./travis/ci.sh
-
-script:
-- ./php-src/sapi/cli/php php-src/sapi/phpdbg/tests/run-tests.php -diff2stdout --phpdbg php-src/sapi/phpdbg/phpdbg
diff --git a/sapi/phpdbg/README.md b/sapi/phpdbg/README.md
index a2a84deb7b..9d1163bc47 100644
--- a/sapi/phpdbg/README.md
+++ b/sapi/phpdbg/README.md
@@ -5,8 +5,6 @@ Implemented as a SAPI module, phpdbg can exert complete control over the environ
phpdbg aims to be a lightweight, powerful, easy to use debugging platform for PHP 5.4+
-[![phpdbg on travis-ci](https://travis-ci.org/krakjoe/phpdbg.png?branch=master)](https://travis-ci.org/krakjoe/phpdbg)
-
Features
========
diff --git a/sapi/phpdbg/config.m4 b/sapi/phpdbg/config.m4
index 9fb4e62984..c3a26d38d5 100644
--- a/sapi/phpdbg/config.m4
+++ b/sapi/phpdbg/config.m4
@@ -46,6 +46,7 @@ if test "$BUILD_PHPDBG" = "" && test "$PHP_PHPDBG" != "no"; then
\$(EXTRA_LIBS) \
\$(PHPDBG_EXTRA_LIBS) \
\$(ZEND_EXTRA_LIBS) \
+ \$(PHP_FRAMEWORKS) \
-o \$(BUILD_BINARY)"
BUILD_PHPDBG_SHARED="\$(LIBTOOL) --mode=link \
diff --git a/sapi/phpdbg/create-test.php b/sapi/phpdbg/create-test.php
index 3388165d86..2d7f63f0e4 100644
--- a/sapi/phpdbg/create-test.php
+++ b/sapi/phpdbg/create-test.php
@@ -5,7 +5,7 @@
+----------------------------------------------------------------------+
| PHP Version 7 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2018 The PHP Group |
+ | Copyright (c) 1997-2017 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/sapi/phpdbg/phpdbg.c b/sapi/phpdbg/phpdbg.c
index c444a72d5f..0bb54a0b69 100644
--- a/sapi/phpdbg/phpdbg.c
+++ b/sapi/phpdbg/phpdbg.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 7 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2018 The PHP Group |
+ | Copyright (c) 1997-2017 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -580,10 +580,10 @@ static PHP_FUNCTION(phpdbg_get_executable)
zend_hash_add_empty_element(files, zval_get_string(filename));
} ZEND_HASH_FOREACH_END();
} else {
- GC_REFCOUNT(files)++;
+ GC_ADDREF(files);
}
} else {
- GC_REFCOUNT(files)++;
+ GC_ADDREF(files);
}
array_init(return_value);
@@ -632,7 +632,7 @@ static PHP_FUNCTION(phpdbg_get_executable)
}
} ZEND_HASH_FOREACH_END();
- if (!--GC_REFCOUNT(files)) {
+ if (!GC_DELREF(files)) {
zend_hash_destroy(files);
}
}
@@ -783,7 +783,7 @@ ZEND_BEGIN_ARG_INFO_EX(phpdbg_get_executable_arginfo, 0, 0, 0)
ZEND_ARG_INFO(0, options)
ZEND_END_ARG_INFO()
-zend_function_entry phpdbg_user_functions[] = {
+static const zend_function_entry phpdbg_user_functions[] = {
PHP_FE(phpdbg_clear, phpdbg_clear_arginfo)
PHP_FE(phpdbg_break_next, phpdbg_break_next_arginfo)
PHP_FE(phpdbg_break_file, phpdbg_break_file_arginfo)
@@ -1356,7 +1356,7 @@ php_stream *phpdbg_stream_url_wrap_php(php_stream_wrapper *wrapper, const char *
return stream;
}
- return PHPDBG_G(orig_url_wrap_php)(wrapper, path, mode, options, opened_path, context STREAMS_CC);
+ return PHPDBG_G(orig_url_wrap_php)->wops->stream_opener(wrapper, path, mode, options, opened_path, context STREAMS_CC);
} /* }}} */
int main(int argc, char **argv) /* {{{ */
@@ -1399,6 +1399,8 @@ int main(int argc, char **argv) /* {{{ */
void* (*_malloc)(size_t);
void (*_free)(void*);
void* (*_realloc)(void*, size_t);
+ php_stream_wrapper wrapper;
+ php_stream_wrapper_ops wops;
#ifndef _WIN32
@@ -1697,7 +1699,7 @@ phpdbg_main:
phpdbg_do_help_cmd(exec);
} else if (show_version) {
phpdbg_out(
- "phpdbg %s (built: %s %s)\nPHP %s, Copyright (c) 1997-2018 The PHP Group\n%s",
+ "phpdbg %s (built: %s %s)\nPHP %s, Copyright (c) 1997-2017 The PHP Group\n%s",
PHPDBG_VERSION,
__DATE__,
__TIME__,
@@ -1867,9 +1869,14 @@ phpdbg_main:
}
{
- php_stream_wrapper *wrapper = zend_hash_str_find_ptr(php_stream_get_url_stream_wrappers_hash(), ZEND_STRL("php"));
- PHPDBG_G(orig_url_wrap_php) = wrapper->wops->stream_opener;
- wrapper->wops->stream_opener = phpdbg_stream_url_wrap_php;
+ zval *zv = zend_hash_str_find(php_stream_get_url_stream_wrappers_hash(), ZEND_STRL("php"));
+ php_stream_wrapper *tmp_wrapper = Z_PTR_P(zv);
+ PHPDBG_G(orig_url_wrap_php) = tmp_wrapper;
+ memcpy(&wrapper, tmp_wrapper, sizeof(wrapper));
+ memcpy(&wops, tmp_wrapper->wops, sizeof(wops));
+ wops.stream_opener = phpdbg_stream_url_wrap_php;
+ wrapper.wops = (const php_stream_wrapper_ops*)&wops;
+ Z_PTR_P(zv) = &wrapper;
}
/* Make stdin, stdout and stderr accessible from PHP scripts */
@@ -2096,6 +2103,7 @@ phpdbg_out:
if (PHPDBG_G(exec) && strcmp("Standard input code", PHPDBG_G(exec)) == SUCCESS) { /* i.e. execution context has been read from stdin - back it up */
phpdbg_file_source *data = zend_hash_str_find_ptr(&PHPDBG_G(file_sources), PHPDBG_G(exec), PHPDBG_G(exec_len));
backup_phpdbg_compile = zend_string_alloc(data->len + 2, 1);
+ GC_MAKE_PERSISTENT_LOCAL(backup_phpdbg_compile);
sprintf(ZSTR_VAL(backup_phpdbg_compile), "?>%.*s", (int) data->len, data->buf);
}
@@ -2147,8 +2155,8 @@ phpdbg_out:
}
{
- 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);
+ zval *zv = zend_hash_str_find(php_stream_get_url_stream_wrappers_hash(), ZEND_STRL("php"));
+ Z_PTR_P(zv) = (void*)PHPDBG_G(orig_url_wrap_php);
}
zend_hash_destroy(&PHPDBG_G(file_sources));
diff --git a/sapi/phpdbg/phpdbg.h b/sapi/phpdbg/phpdbg.h
index 980db28be9..be7a91c4ca 100644
--- a/sapi/phpdbg/phpdbg.h
+++ b/sapi/phpdbg/phpdbg.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 7 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2018 The PHP Group |
+ | Copyright (c) 1997-2017 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -308,7 +308,7 @@ ZEND_BEGIN_MODULE_GLOBALS(phpdbg)
zend_bool last_was_newline; /* check if we don't need to output a newline upon next phpdbg_error or phpdbg_notice */
FILE *stdin_file; /* FILE pointer to stdin source file */
- php_stream *(*orig_url_wrap_php)(php_stream_wrapper *wrapper, const char *path, const char *mode, int options, zend_string **opened_path, php_stream_context *context STREAMS_DC);
+ const php_stream_wrapper *orig_url_wrap_php;
char input_buffer[PHPDBG_MAX_CMD]; /* stdin input buffer */
int input_buflen; /* length of stdin input buffer */
diff --git a/sapi/phpdbg/phpdbg_bp.c b/sapi/phpdbg/phpdbg_bp.c
index 27bf532dcc..6edb314582 100644
--- a/sapi/phpdbg/phpdbg_bp.c
+++ b/sapi/phpdbg/phpdbg_bp.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 7 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2018 The PHP Group |
+ | Copyright (c) 1997-2017 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/sapi/phpdbg/phpdbg_bp.h b/sapi/phpdbg/phpdbg_bp.h
index 761b0430a7..60c67072a9 100644
--- a/sapi/phpdbg/phpdbg_bp.h
+++ b/sapi/phpdbg/phpdbg_bp.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 7 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2018 The PHP Group |
+ | Copyright (c) 1997-2017 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/sapi/phpdbg/phpdbg_break.c b/sapi/phpdbg/phpdbg_break.c
index 7e07da996a..d3b1eabc7a 100644
--- a/sapi/phpdbg/phpdbg_break.c
+++ b/sapi/phpdbg/phpdbg_break.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 7 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2018 The PHP Group |
+ | Copyright (c) 1997-2017 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/sapi/phpdbg/phpdbg_break.h b/sapi/phpdbg/phpdbg_break.h
index c0a2d45b05..5b8fd13c28 100644
--- a/sapi/phpdbg/phpdbg_break.h
+++ b/sapi/phpdbg/phpdbg_break.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 7 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2018 The PHP Group |
+ | Copyright (c) 1997-2017 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/sapi/phpdbg/phpdbg_btree.c b/sapi/phpdbg/phpdbg_btree.c
index 4f5b1e7526..49b8cc6fa2 100644
--- a/sapi/phpdbg/phpdbg_btree.c
+++ b/sapi/phpdbg/phpdbg_btree.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 7 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2018 The PHP Group |
+ | Copyright (c) 1997-2017 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/sapi/phpdbg/phpdbg_btree.h b/sapi/phpdbg/phpdbg_btree.h
index 196e130305..a756af8d59 100644
--- a/sapi/phpdbg/phpdbg_btree.h
+++ b/sapi/phpdbg/phpdbg_btree.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 7 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2018 The PHP Group |
+ | Copyright (c) 1997-2017 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/sapi/phpdbg/phpdbg_cmd.c b/sapi/phpdbg/phpdbg_cmd.c
index b4a878818b..6bd6faf34d 100644
--- a/sapi/phpdbg/phpdbg_cmd.c
+++ b/sapi/phpdbg/phpdbg_cmd.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 7 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2018 The PHP Group |
+ | Copyright (c) 1997-2017 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -751,7 +751,11 @@ PHPDBG_API char *phpdbg_read_input(char *buffered) /* {{{ */
}
if (buffered == NULL) {
-#define USE_LIB_STAR (defined(HAVE_LIBREADLINE) || defined(HAVE_LIBEDIT))
+#if defined(HAVE_LIBREADLINE) || defined(HAVE_LIBEDIT)
+#define USE_LIB_STAR 1
+#else
+#define USE_LIB_STAR 0
+#endif
/* note: EOF makes readline write prompt again in local console mode - and ignored if compiled without readline */
#if USE_LIB_STAR
if ((PHPDBG_G(flags) & PHPDBG_IS_REMOTE) || !isatty(PHPDBG_G(io)[PHPDBG_STDIN].fd))
diff --git a/sapi/phpdbg/phpdbg_cmd.h b/sapi/phpdbg/phpdbg_cmd.h
index f5d5a8d465..b872e0a8a9 100644
--- a/sapi/phpdbg/phpdbg_cmd.h
+++ b/sapi/phpdbg/phpdbg_cmd.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 7 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2018 The PHP Group |
+ | Copyright (c) 1997-2017 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/sapi/phpdbg/phpdbg_eol.c b/sapi/phpdbg/phpdbg_eol.c
index 25ab833c51..9c1568eb55 100644
--- a/sapi/phpdbg/phpdbg_eol.c
+++ b/sapi/phpdbg/phpdbg_eol.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 7 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2018 The PHP Group |
+ | Copyright (c) 1997-2017 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/sapi/phpdbg/phpdbg_eol.h b/sapi/phpdbg/phpdbg_eol.h
index afc31a906e..4ccf6256fa 100644
--- a/sapi/phpdbg/phpdbg_eol.h
+++ b/sapi/phpdbg/phpdbg_eol.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 7 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2018 The PHP Group |
+ | Copyright (c) 1997-2017 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/sapi/phpdbg/phpdbg_frame.c b/sapi/phpdbg/phpdbg_frame.c
index 7cdedcb497..36832c0417 100644
--- a/sapi/phpdbg/phpdbg_frame.c
+++ b/sapi/phpdbg/phpdbg_frame.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 7 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2018 The PHP Group |
+ | Copyright (c) 1997-2017 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/sapi/phpdbg/phpdbg_frame.h b/sapi/phpdbg/phpdbg_frame.h
index 05655314c4..28f48c8de1 100644
--- a/sapi/phpdbg/phpdbg_frame.h
+++ b/sapi/phpdbg/phpdbg_frame.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 7 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2018 The PHP Group |
+ | Copyright (c) 1997-2017 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/sapi/phpdbg/phpdbg_help.c b/sapi/phpdbg/phpdbg_help.c
index e9caa18895..d7d7d5561e 100644
--- a/sapi/phpdbg/phpdbg_help.c
+++ b/sapi/phpdbg/phpdbg_help.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 7 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2018 The PHP Group |
+ | Copyright (c) 1997-2017 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/sapi/phpdbg/phpdbg_help.h b/sapi/phpdbg/phpdbg_help.h
index b34d84e538..8a4f44b704 100644
--- a/sapi/phpdbg/phpdbg_help.h
+++ b/sapi/phpdbg/phpdbg_help.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 7 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2018 The PHP Group |
+ | Copyright (c) 1997-2017 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/sapi/phpdbg/phpdbg_info.c b/sapi/phpdbg/phpdbg_info.c
index c0c9ac156a..5a20d69bbe 100644
--- a/sapi/phpdbg/phpdbg_info.c
+++ b/sapi/phpdbg/phpdbg_info.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 7 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2018 The PHP Group |
+ | Copyright (c) 1997-2017 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/sapi/phpdbg/phpdbg_info.h b/sapi/phpdbg/phpdbg_info.h
index 38137fec14..74182dd606 100644
--- a/sapi/phpdbg/phpdbg_info.h
+++ b/sapi/phpdbg/phpdbg_info.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 7 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2018 The PHP Group |
+ | Copyright (c) 1997-2017 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/sapi/phpdbg/phpdbg_io.c b/sapi/phpdbg/phpdbg_io.c
index ee5a656b60..05d423d6e1 100644
--- a/sapi/phpdbg/phpdbg_io.c
+++ b/sapi/phpdbg/phpdbg_io.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 7 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2018 The PHP Group |
+ | Copyright (c) 1997-2017 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/sapi/phpdbg/phpdbg_io.h b/sapi/phpdbg/phpdbg_io.h
index d0b69d9b41..79d0850651 100644
--- a/sapi/phpdbg/phpdbg_io.h
+++ b/sapi/phpdbg/phpdbg_io.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 7 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2018 The PHP Group |
+ | Copyright (c) 1997-2017 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/sapi/phpdbg/phpdbg_lexer.h b/sapi/phpdbg/phpdbg_lexer.h
index 90f9963b3c..54d0047e9c 100644
--- a/sapi/phpdbg/phpdbg_lexer.h
+++ b/sapi/phpdbg/phpdbg_lexer.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 7 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2018 The PHP Group |
+ | Copyright (c) 1997-2017 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/sapi/phpdbg/phpdbg_list.c b/sapi/phpdbg/phpdbg_list.c
index 865f75bc27..c3297244d0 100644
--- a/sapi/phpdbg/phpdbg_list.c
+++ b/sapi/phpdbg/phpdbg_list.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 7 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2018 The PHP Group |
+ | Copyright (c) 1997-2017 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/sapi/phpdbg/phpdbg_list.h b/sapi/phpdbg/phpdbg_list.h
index 474bfdf4f5..53479e6b61 100644
--- a/sapi/phpdbg/phpdbg_list.h
+++ b/sapi/phpdbg/phpdbg_list.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 7 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2018 The PHP Group |
+ | Copyright (c) 1997-2017 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/sapi/phpdbg/phpdbg_opcode.c b/sapi/phpdbg/phpdbg_opcode.c
index 0fd3d17edf..551d1f8a86 100644
--- a/sapi/phpdbg/phpdbg_opcode.c
+++ b/sapi/phpdbg/phpdbg_opcode.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 7 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2018 The PHP Group |
+ | Copyright (c) 1997-2017 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -37,7 +37,7 @@ static inline const char *phpdbg_decode_opcode(zend_uchar opcode) /* {{{ */
} /* }}} */
static inline char *phpdbg_decode_op(
- zend_op_array *ops, const znode_op *op, uint32_t type) /* {{{ */
+ zend_op_array *ops, const zend_op *opline, const znode_op *op, uint32_t type) /* {{{ */
{
char *decode = NULL;
@@ -56,7 +56,7 @@ static inline char *phpdbg_decode_op(
spprintf(&decode, 0, "~%u", EX_VAR_TO_NUM(op->var) - ops->last_var);
break;
case IS_CONST: {
- zval *literal = RT_CONSTANT(ops, *op);
+ zval *literal = RT_CONSTANT(opline, *op);
decode = phpdbg_short_zval_print(literal, 20);
} break;
}
@@ -68,7 +68,7 @@ char *phpdbg_decode_input_op(
uint32_t flags) {
char *result = NULL;
if (op_type != IS_UNUSED) {
- result = phpdbg_decode_op(ops, &op, op_type);
+ result = phpdbg_decode_op(ops, opline, &op, op_type);
} else if (ZEND_VM_OP_JMP_ADDR == (flags & ZEND_VM_OP_MASK)) {
spprintf(&result, 0, "J%td", OP_JMP_ADDR(opline, op) - ops->opcodes);
} else if (ZEND_VM_OP_NUM == (flags & ZEND_VM_OP_MASK)) {
@@ -118,7 +118,7 @@ char *phpdbg_decode_opline(zend_op_array *ops, zend_op *opline) /*{{{ */
spprintf(&decode[3], 0, "%" PRIu32, opline->result.num);
break;
default:
- decode[3] = phpdbg_decode_op(ops, &opline->result, opline->result_type);
+ decode[3] = phpdbg_decode_op(ops, opline, &opline->result, opline->result_type);
break;
}
diff --git a/sapi/phpdbg/phpdbg_opcode.h b/sapi/phpdbg/phpdbg_opcode.h
index 1bb861ed6f..8b2555a72a 100644
--- a/sapi/phpdbg/phpdbg_opcode.h
+++ b/sapi/phpdbg/phpdbg_opcode.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 7 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2018 The PHP Group |
+ | Copyright (c) 1997-2017 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/sapi/phpdbg/phpdbg_out.c b/sapi/phpdbg/phpdbg_out.c
index 1f35a3d1d5..1305bf6d5e 100644
--- a/sapi/phpdbg/phpdbg_out.c
+++ b/sapi/phpdbg/phpdbg_out.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 7 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2018 The PHP Group |
+ | Copyright (c) 1997-2017 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/sapi/phpdbg/phpdbg_out.h b/sapi/phpdbg/phpdbg_out.h
index 4d264ba53c..000a81f3d8 100644
--- a/sapi/phpdbg/phpdbg_out.h
+++ b/sapi/phpdbg/phpdbg_out.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 7 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2018 The PHP Group |
+ | Copyright (c) 1997-2017 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -34,11 +34,18 @@ enum {
P_LOG
};
-PHPDBG_API int phpdbg_print(int severity, int fd, const char *tag, const char *xmlfmt, const char *strfmt, ...) PHP_ATTRIBUTE_FORMAT(printf, 5, 6);
-PHPDBG_API int phpdbg_xml_internal(int fd, const char *fmt, ...) PHP_ATTRIBUTE_FORMAT(printf, 2, 3);
-PHPDBG_API int phpdbg_log_internal(int fd, const char *fmt, ...) PHP_ATTRIBUTE_FORMAT(printf, 2, 3);
-PHPDBG_API int phpdbg_out_internal(int fd, const char *fmt, ...) PHP_ATTRIBUTE_FORMAT(printf, 2, 3);
-PHPDBG_API int phpdbg_rlog_internal(int fd, const char *fmt, ...) PHP_ATTRIBUTE_FORMAT(printf, 2, 3);
+/* phpdbg uses lots of custom format specifiers, so we disable format checks by default. */
+#if defined(PHPDBG_CHECK_FORMAT_STRINGS)
+# define PHPDBG_ATTRIBUTE_FORMAT(type, idx, first) PHP_ATTRIBUTE_FORMAT(type, idx, first)
+#else
+# define PHPDBG_ATTRIBUTE_FORMAT(type, idx, first)
+#endif
+
+PHPDBG_API int phpdbg_print(int severity, int fd, const char *tag, const char *xmlfmt, const char *strfmt, ...) PHPDBG_ATTRIBUTE_FORMAT(printf, 5, 6);
+PHPDBG_API int phpdbg_xml_internal(int fd, const char *fmt, ...) PHPDBG_ATTRIBUTE_FORMAT(printf, 2, 3);
+PHPDBG_API int phpdbg_log_internal(int fd, const char *fmt, ...) PHPDBG_ATTRIBUTE_FORMAT(printf, 2, 3);
+PHPDBG_API int phpdbg_out_internal(int fd, const char *fmt, ...) PHPDBG_ATTRIBUTE_FORMAT(printf, 2, 3);
+PHPDBG_API int phpdbg_rlog_internal(int fd, const char *fmt, ...) PHPDBG_ATTRIBUTE_FORMAT(printf, 2, 3);
#define phpdbg_error(tag, xmlfmt, strfmt, ...) phpdbg_print(P_ERROR , PHPDBG_G(io)[PHPDBG_STDOUT].fd, tag, xmlfmt, strfmt, ##__VA_ARGS__)
#define phpdbg_notice(tag, xmlfmt, strfmt, ...) phpdbg_print(P_NOTICE , PHPDBG_G(io)[PHPDBG_STDOUT].fd, tag, xmlfmt, strfmt, ##__VA_ARGS__)
diff --git a/sapi/phpdbg/phpdbg_print.c b/sapi/phpdbg/phpdbg_print.c
index ed5633b845..829f632506 100644
--- a/sapi/phpdbg/phpdbg_print.c
+++ b/sapi/phpdbg/phpdbg_print.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 7 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2018 The PHP Group |
+ | Copyright (c) 1997-2017 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/sapi/phpdbg/phpdbg_print.h b/sapi/phpdbg/phpdbg_print.h
index 1a7d5e87a4..4d2312a159 100644
--- a/sapi/phpdbg/phpdbg_print.h
+++ b/sapi/phpdbg/phpdbg_print.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 7 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2018 The PHP Group |
+ | Copyright (c) 1997-2017 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/sapi/phpdbg/phpdbg_prompt.c b/sapi/phpdbg/phpdbg_prompt.c
index fc25e30af1..b6cd50179d 100644
--- a/sapi/phpdbg/phpdbg_prompt.c
+++ b/sapi/phpdbg/phpdbg_prompt.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 7 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2018 The PHP Group |
+ | Copyright (c) 1997-2017 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -1692,7 +1692,7 @@ int phpdbg_interactive(zend_bool allow_async_unsafe, char *input) /* {{{ */
backup_opline = EG(current_execute_data)->opline; \
} \
before_ex = EG(opline_before_exception); \
- ++GC_REFCOUNT(exception); \
+ GC_ADDREF(exception); \
zend_clear_exception(); \
} \
if (!(PHPDBG_G(flags) & PHPDBG_IN_EVAL)) { \
diff --git a/sapi/phpdbg/phpdbg_prompt.h b/sapi/phpdbg/phpdbg_prompt.h
index cac69c0120..3d6fd491c2 100644
--- a/sapi/phpdbg/phpdbg_prompt.h
+++ b/sapi/phpdbg/phpdbg_prompt.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 7 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2018 The PHP Group |
+ | Copyright (c) 1997-2017 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/sapi/phpdbg/phpdbg_rinit_hook.c b/sapi/phpdbg/phpdbg_rinit_hook.c
index 685c5b75a9..c62b272a16 100644
--- a/sapi/phpdbg/phpdbg_rinit_hook.c
+++ b/sapi/phpdbg/phpdbg_rinit_hook.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 7 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2018 The PHP Group |
+ | Copyright (c) 1997-2017 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -56,9 +56,9 @@ static PHP_RINIT_FUNCTION(phpdbg_webhelper) /* {{{ */
{
struct sockaddr_un sock;
int s = socket(AF_UNIX, SOCK_STREAM, 0);
- int len = strlen(PHPDBG_WG(path)) + sizeof(sock.sun_family);
+ size_t len = strlen(PHPDBG_WG(path)) + sizeof(sock.sun_family);
char buf[(1 << 8) + 1];
- int buflen;
+ ssize_t buflen;
sock.sun_family = AF_UNIX;
strcpy(sock.sun_path, PHPDBG_WG(path));
@@ -67,11 +67,15 @@ static PHP_RINIT_FUNCTION(phpdbg_webhelper) /* {{{ */
}
char *msg = NULL;
- char msglen[5] = {0};
- phpdbg_webdata_compress(&msg, (int *)msglen);
-
- send(s, msglen, 4, 0);
- send(s, msg, *(int *) msglen, 0);
+ size_t msglen = 0;
+ phpdbg_webdata_compress(&msg, &msglen);
+
+ buf[0] = (msglen >> 0) & 0xff;
+ buf[1] = (msglen >> 8) & 0xff;
+ buf[2] = (msglen >> 16) & 0xff;
+ buf[3] = (msglen >> 24) & 0xff;
+ send(s, buf, 4, 0);
+ send(s, msg, msglen, 0);
while ((buflen = recv(s, buf, sizeof(buf) - 1, 0)) > 0) {
php_write(buf, buflen);
diff --git a/sapi/phpdbg/phpdbg_rinit_hook.h b/sapi/phpdbg/phpdbg_rinit_hook.h
index adc3f1c681..0705dcc7c8 100644
--- a/sapi/phpdbg/phpdbg_rinit_hook.h
+++ b/sapi/phpdbg/phpdbg_rinit_hook.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 7 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2018 The PHP Group |
+ | Copyright (c) 1997-2017 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/sapi/phpdbg/phpdbg_set.c b/sapi/phpdbg/phpdbg_set.c
index 7cb8d0639f..9f28e37b20 100644
--- a/sapi/phpdbg/phpdbg_set.c
+++ b/sapi/phpdbg/phpdbg_set.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 7 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2018 The PHP Group |
+ | Copyright (c) 1997-2017 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/sapi/phpdbg/phpdbg_set.h b/sapi/phpdbg/phpdbg_set.h
index c4b0dd9523..92a1ee5e29 100644
--- a/sapi/phpdbg/phpdbg_set.h
+++ b/sapi/phpdbg/phpdbg_set.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 7 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2018 The PHP Group |
+ | Copyright (c) 1997-2017 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/sapi/phpdbg/phpdbg_sigio_win32.c b/sapi/phpdbg/phpdbg_sigio_win32.c
index b86ea05da2..46febb4798 100644
--- a/sapi/phpdbg/phpdbg_sigio_win32.c
+++ b/sapi/phpdbg/phpdbg_sigio_win32.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 7 |
+----------------------------------------------------------------------+
- | Copyright (c) 2014-2018 The PHP Group |
+ | Copyright (c) 2014-2017 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/sapi/phpdbg/phpdbg_sigio_win32.h b/sapi/phpdbg/phpdbg_sigio_win32.h
index d5d6383a8f..c1e5322693 100644
--- a/sapi/phpdbg/phpdbg_sigio_win32.h
+++ b/sapi/phpdbg/phpdbg_sigio_win32.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 7 |
+----------------------------------------------------------------------+
- | Copyright (c) 2014-2018 The PHP Group |
+ | Copyright (c) 2014-2017 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/sapi/phpdbg/phpdbg_utils.c b/sapi/phpdbg/phpdbg_utils.c
index 380e9f9e16..fa27fa96a8 100644
--- a/sapi/phpdbg/phpdbg_utils.c
+++ b/sapi/phpdbg/phpdbg_utils.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 7 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2018 The PHP Group |
+ | Copyright (c) 1997-2017 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -687,10 +687,12 @@ PHPDBG_API void phpdbg_xml_var_dump(zval *zv) {
break;
case IS_ARRAY:
myht = Z_ARRVAL_P(zv);
- if (ZEND_HASH_APPLY_PROTECTION(myht) && ++myht->u.v.nApplyCount > 1) {
- phpdbg_xml("<recursion />");
- --myht->u.v.nApplyCount;
- break;
+ if (!(GC_FLAGS(myht) & GC_IMMUTABLE)) {
+ if (GC_IS_RECURSIVE(myht)) {
+ phpdbg_xml("<recursion />");
+ break;
+ }
+ GC_PROTECT_RECURSION(myht);
}
phpdbg_xml("<array refstatus=\"%s\" num=\"%d\">", COMMON, zend_hash_num_elements(myht));
element_dump_func = phpdbg_xml_array_element_dump;
@@ -698,9 +700,8 @@ PHPDBG_API void phpdbg_xml_var_dump(zval *zv) {
goto head_done;
case IS_OBJECT:
myht = Z_OBJDEBUG_P(zv, is_temp);
- if (myht && ++myht->u.v.nApplyCount > 1) {
+ if (myht && GC_IS_RECURSIVE(myht)) {
phpdbg_xml("<recursion />");
- --myht->u.v.nApplyCount;
break;
}
@@ -715,7 +716,7 @@ head_done:
element_dump_func(val, key, num);
} ZEND_HASH_FOREACH_END();
zend_hash_apply_with_arguments(myht, (apply_func_args_t) element_dump_func, 0);
- --myht->u.v.nApplyCount;
+ GC_UNPROTECT_RECURSION(myht);
if (is_temp) {
zend_hash_destroy(myht);
efree(myht);
@@ -763,9 +764,9 @@ PHPDBG_API zend_bool phpdbg_check_caught_ex(zend_execute_data *execute_data, zen
zend_class_entry *ce;
cur = &op_array->opcodes[catch];
- if (!(ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(cur->op1))))) {
- ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(cur->op1)), EX_CONSTANT(cur->op1) + 1, ZEND_FETCH_CLASS_NO_AUTOLOAD);
- CACHE_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(cur->op1)), ce);
+ if (!(ce = CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(cur, cur->op1))))) {
+ ce = zend_fetch_class_by_name(Z_STR_P(RT_CONSTANT(cur, cur->op1)), RT_CONSTANT(cur, cur->op1) + 1, ZEND_FETCH_CLASS_NO_AUTOLOAD);
+ CACHE_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(cur, cur->op1)), ce);
}
if (ce == exception->ce || (ce && instanceof_function(exception->ce, ce))) {
@@ -843,12 +844,17 @@ char *phpdbg_short_zval_print(zval *zv, int maxlen) /* {{{ */
ZSTR_VAL(str), ZSTR_LEN(str) <= maxlen ? 0 : '+');
break;
}
- case IS_CONSTANT:
- decode = estrdup("<constant>");
- break;
- case IS_CONSTANT_AST:
- decode = estrdup("<ast>");
+ case IS_CONSTANT_AST: {
+ zend_ast *ast = Z_ASTVAL_P(zv);
+
+ if (ast->kind == ZEND_AST_CONSTANT
+ || ast->kind == ZEND_AST_CONSTANT_CLASS) {
+ decode = estrdup("<constant>");
+ } else {
+ decode = estrdup("<ast>");
+ }
break;
+ }
default:
spprintf(&decode, 0, "unknown type: %d", Z_TYPE_P(zv));
break;
diff --git a/sapi/phpdbg/phpdbg_utils.h b/sapi/phpdbg/phpdbg_utils.h
index c8a9554d0e..6423b6e8b0 100644
--- a/sapi/phpdbg/phpdbg_utils.h
+++ b/sapi/phpdbg/phpdbg_utils.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 7 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2018 The PHP Group |
+ | Copyright (c) 1997-2017 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/sapi/phpdbg/phpdbg_wait.c b/sapi/phpdbg/phpdbg_wait.c
index 305a7daf2a..19bbcaa822 100644
--- a/sapi/phpdbg/phpdbg_wait.c
+++ b/sapi/phpdbg/phpdbg_wait.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 7 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2018 The PHP Group |
+ | Copyright (c) 1997-2017 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/sapi/phpdbg/phpdbg_wait.h b/sapi/phpdbg/phpdbg_wait.h
index 71c6ace543..850483febf 100644
--- a/sapi/phpdbg/phpdbg_wait.h
+++ b/sapi/phpdbg/phpdbg_wait.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 7 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2018 The PHP Group |
+ | Copyright (c) 1997-2017 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/sapi/phpdbg/phpdbg_watch.c b/sapi/phpdbg/phpdbg_watch.c
index 0c0df7f97a..feeb77a445 100644
--- a/sapi/phpdbg/phpdbg_watch.c
+++ b/sapi/phpdbg/phpdbg_watch.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 7 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2018 The PHP Group |
+ | Copyright (c) 1997-2017 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -326,6 +326,7 @@ void phpdbg_watch_backup_data(phpdbg_watchpoint_t *watch) {
zend_string_release(watch->backup.str);
}
watch->backup.str = zend_string_init((char *) watch->addr.ptr + XtOffsetOf(zend_string, val) - XtOffsetOf(zend_string, len), *(size_t *) watch->addr.ptr, 1);
+ GC_MAKE_PERSISTENT_LOCAL(watch->backup.str);
break;
case WATCH_ON_HASHTABLE:
memcpy((char *) &watch->backup + HT_WATCH_OFFSET, watch->addr.ptr, watch->size);
diff --git a/sapi/phpdbg/phpdbg_watch.h b/sapi/phpdbg/phpdbg_watch.h
index 4d5e2153ae..497776081f 100644
--- a/sapi/phpdbg/phpdbg_watch.h
+++ b/sapi/phpdbg/phpdbg_watch.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 7 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2018 The PHP Group |
+ | Copyright (c) 1997-2017 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/sapi/phpdbg/phpdbg_webdata_transfer.c b/sapi/phpdbg/phpdbg_webdata_transfer.c
index ed0a853709..5cb6ea4a2d 100644
--- a/sapi/phpdbg/phpdbg_webdata_transfer.c
+++ b/sapi/phpdbg/phpdbg_webdata_transfer.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 7 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2018 The PHP Group |
+ | Copyright (c) 1997-2017 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -27,7 +27,7 @@ static int phpdbg_is_auto_global(char *name, int len) {
return ret;
}
-PHPDBG_API void phpdbg_webdata_compress(char **msg, int *len) {
+PHPDBG_API void phpdbg_webdata_compress(char **msg, size_t *len) {
zval array;
HashTable *ht;
zval zv[9] = {{{0}}};
diff --git a/sapi/phpdbg/phpdbg_webdata_transfer.h b/sapi/phpdbg/phpdbg_webdata_transfer.h
index 3a55fbe10f..b8473d30ef 100644
--- a/sapi/phpdbg/phpdbg_webdata_transfer.h
+++ b/sapi/phpdbg/phpdbg_webdata_transfer.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 7 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2018 The PHP Group |
+ | Copyright (c) 1997-2017 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -22,6 +22,6 @@
#include "zend.h"
#include "phpdbg.h"
-PHPDBG_API void phpdbg_webdata_compress(char **msg, int *len);
+PHPDBG_API void phpdbg_webdata_compress(char **msg, size_t *len);
#endif /* PHPDBG_WEBDATA_TRANSFER_H */
diff --git a/sapi/phpdbg/phpdbg_win.c b/sapi/phpdbg/phpdbg_win.c
index 964aed0194..03c30b0687 100644
--- a/sapi/phpdbg/phpdbg_win.c
+++ b/sapi/phpdbg/phpdbg_win.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 7 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2018 The PHP Group |
+ | Copyright (c) 1997-2017 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/sapi/phpdbg/phpdbg_win.h b/sapi/phpdbg/phpdbg_win.h
index ee9191b1ad..40341e7bda 100644
--- a/sapi/phpdbg/phpdbg_win.h
+++ b/sapi/phpdbg/phpdbg_win.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 7 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2018 The PHP Group |
+ | Copyright (c) 1997-2017 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/sapi/phpdbg/tests/run_001.phpt b/sapi/phpdbg/tests/run_001.phpt
index 30aab1f17a..626ecb323b 100644
--- a/sapi/phpdbg/tests/run_001.phpt
+++ b/sapi/phpdbg/tests/run_001.phpt
@@ -21,7 +21,7 @@ array(5) {
string(1) "3"
}
[Script ended normally]
-prompt> int(5)
+prompt> int(4)
array(4) {
[0]=>
string(%d) "%s"
diff --git a/sapi/phpdbg/travis/ci.sh b/sapi/phpdbg/travis/ci.sh
deleted file mode 100755
index 206b158b9b..0000000000
--- a/sapi/phpdbg/travis/ci.sh
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/usr/bin/env sh
-git clone https://github.com/php/php-src
-cd php-src
-git checkout $PHP
-cd sapi
-rm -rf phpdbg
-git clone https://github.com/krakjoe/phpdbg.git
-cd ../
-./buildconf --force
-./configure --disable-all --enable-phpdbg --enable-maintainer-zts
-make