summaryrefslogtreecommitdiff
path: root/sapi/phpdbg
diff options
context:
space:
mode:
Diffstat (limited to 'sapi/phpdbg')
-rw-r--r--sapi/phpdbg/Changelog.md52
-rw-r--r--sapi/phpdbg/README.md117
-rw-r--r--sapi/phpdbg/config.m444
-rwxr-xr-x[-rw-r--r--]sapi/phpdbg/create-test.php2
-rw-r--r--sapi/phpdbg/phpdbg.1.in4
-rw-r--r--sapi/phpdbg/phpdbg.c90
-rw-r--r--sapi/phpdbg/phpdbg.h8
-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.c6
-rw-r--r--sapi/phpdbg/phpdbg_cmd.h2
-rw-r--r--sapi/phpdbg/phpdbg_eol.c27
-rw-r--r--sapi/phpdbg/phpdbg_eol.h2
-rw-r--r--sapi/phpdbg/phpdbg_frame.c17
-rw-r--r--sapi/phpdbg/phpdbg_frame.h2
-rw-r--r--sapi/phpdbg/phpdbg_help.c4
-rw-r--r--sapi/phpdbg/phpdbg_help.h2
-rw-r--r--sapi/phpdbg/phpdbg_info.c10
-rw-r--r--sapi/phpdbg/phpdbg_info.h2
-rw-r--r--sapi/phpdbg/phpdbg_io.c4
-rw-r--r--sapi/phpdbg/phpdbg_io.h2
-rw-r--r--sapi/phpdbg/phpdbg_lexer.c2085
-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.c2
-rw-r--r--sapi/phpdbg/phpdbg_opcode.h2
-rw-r--r--sapi/phpdbg/phpdbg_out.c19
-rw-r--r--sapi/phpdbg/phpdbg_out.h2
-rw-r--r--sapi/phpdbg/phpdbg_parser.c1953
-rw-r--r--sapi/phpdbg/phpdbg_parser.h130
-rw-r--r--sapi/phpdbg/phpdbg_parser.y11
-rw-r--r--sapi/phpdbg/phpdbg_print.c2
-rw-r--r--sapi/phpdbg/phpdbg_print.h2
-rw-r--r--sapi/phpdbg/phpdbg_prompt.c73
-rw-r--r--sapi/phpdbg/phpdbg_prompt.h2
-rw-r--r--sapi/phpdbg/phpdbg_rinit_hook.c2
-rw-r--r--sapi/phpdbg/phpdbg_rinit_hook.h4
-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.c18
-rw-r--r--sapi/phpdbg/phpdbg_utils.h4
-rw-r--r--sapi/phpdbg/phpdbg_wait.c28
-rw-r--r--sapi/phpdbg/phpdbg_wait.h2
-rw-r--r--sapi/phpdbg/phpdbg_watch.c7
-rw-r--r--sapi/phpdbg/phpdbg_watch.h2
-rw-r--r--sapi/phpdbg/phpdbg_webdata_transfer.c2
-rw-r--r--sapi/phpdbg/phpdbg_webdata_transfer.h2
-rw-r--r--sapi/phpdbg/phpdbg_win.c2
-rw-r--r--sapi/phpdbg/phpdbg_win.h2
-rw-r--r--sapi/phpdbg/tests/phpdbg_oplog_001.phpt2
-rw-r--r--sapi/phpdbg/tests/print_001.phpt24
-rw-r--r--sapi/phpdbg/tests/stepping_001.phpt4
-rw-r--r--sapi/phpdbg/tests/watch_001.phpt6
-rw-r--r--sapi/phpdbg/tests/watch_002.phpt6
-rw-r--r--sapi/phpdbg/tests/watch_003.phpt6
-rw-r--r--sapi/phpdbg/tests/watch_004.phpt6
-rw-r--r--sapi/phpdbg/tests/watch_005.phpt6
-rw-r--r--sapi/phpdbg/tests/watch_006.phpt6
-rw-r--r--sapi/phpdbg/web-bootstrap.php2
-rw-r--r--sapi/phpdbg/xml.md2
67 files changed, 338 insertions, 4513 deletions
diff --git a/sapi/phpdbg/Changelog.md b/sapi/phpdbg/Changelog.md
deleted file mode 100644
index c5d8b51514..0000000000
--- a/sapi/phpdbg/Changelog.md
+++ /dev/null
@@ -1,52 +0,0 @@
-ChangeLog for phpdbg
-====================
-
-Version 0.3.0 2013-00-00
-------------------------
-
-1. Added ability to disable an enable a single breakpoint
-2. Added ability to override SAPI name
-3. Added extended conditional breakpoint support "break at"
-4. Fix loading of zend extnsions with -z
-5. Fix crash when loading .phpdbginit with command line switch
-6. Fix crash on startup errors
-7. Added init.d for remote console (redhat)
-8. Added phpdbg_exec userland function
-9. Added testing facilities
-10. Added break on n-th opline support
-11. Improved trace output
-
-Version 0.2.0 2013-11-31
-------------------------
-
-1. Added "break delete <id>" command
-2. Added "break opcode <opcode>" command
-3. Added "set" command - control prompt and console colors
-4. .phpdbginit now searched in (additional) ini dirs
-5. Added source command - load additional .phpdbginit script during session
-6. Added remote console mode
-7. Added info memory command
-
-Version 0.1.0 2013-11-23
-------------------------
-
-1. New commands:
- - until (continue until the current line is executed)
- - frame (switch to a frame in the current stack for inspection)
- - info (quick access to useful information on the console)
- - finish (continue until the current function has returned)
- - leave (continue until the current function is returning)
- - shell (shell a command)
- - register (register a function for use as a command)
-2. Added printers for class and method
-3. Make uniform commands and aliases where possible
-4. Include all alias information and sub-command information in help
-5. Added signal handling to break execution (ctrl-c)
-6. Fixed #13 (Output Buffering Control seems fail)
-7. Fixed #14 (Fixed typo in Makefile.frag)
-
-
-Version 0.0.1 2013-11-15
-------------------------
-
-1. Initial features
diff --git a/sapi/phpdbg/README.md b/sapi/phpdbg/README.md
index 6eccb512de..68d9766f0a 100644
--- a/sapi/phpdbg/README.md
+++ b/sapi/phpdbg/README.md
@@ -1,81 +1,78 @@
-The interactive PHP debugger
-============================
+# The interactive PHP debugger
-Implemented as a SAPI module, phpdbg can exert complete control over the environment without impacting the functionality or performance of your code.
+Implemented as a SAPI module, phpdbg can exert complete control over the
+environment without impacting the functionality or performance of your code.
-phpdbg aims to be a lightweight, powerful, easy to use debugging platform for PHP 5.4+
+phpdbg aims to be a lightweight, powerful, easy to use debugging platform for
+PHP 5.4+.
-Features
-========
+## Features
- - Stepthrough Debugging
- - Flexible Breakpoints (Class Method, Function, File:Line, Address, Opcode)
- - Easy Access to PHP with built-in eval()
- - Easy Access to Currently Executing Code
- - Userland API
- - SAPI Agnostic - Easily Integrated
- - PHP Configuration File Support
- - JIT Super Globals - Set Your Own!!
- - Optional readline Support - Comfortable Terminal Operation
- - Remote Debugging Support - Bundled Java GUI
- - Easy Operation - See Help :)
+* Stepthrough Debugging
+* Flexible Breakpoints (Class Method, Function, File:Line, Address, Opcode)
+* Easy Access to PHP with built-in eval()
+* Easy Access to Currently Executing Code
+* Userland API
+* SAPI Agnostic - Easily Integrated
+* PHP Configuration File Support
+* JIT Super Globals - Set Your Own!!
+* Optional readline Support - Comfortable Terminal Operation
+* Remote Debugging Support - Bundled Java GUI
+* Easy Operation - See Help
-Planned
-=======
+## Planned
- - Improve Everything :)
+* Improve Everything :)
-Installation
-============
+## Installation
-To install **phpdbg**, you must compile the source against your PHP installation sources, and enable the SAPI with the configure command.
+To install **phpdbg**, you must compile the source against your PHP installation
+sources, and enable the SAPI with the configure command. It is enabled by
+default:
-```
-cd /usr/src/php-src/sapi
-git clone https://github.com/krakjoe/phpdbg
-cd ../
+```bash
+cd /path/to/php-src
./buildconf --force
-./configure --enable-phpdbg
+./configure
make -j8
-make install-phpdbg
+./sapi/phpdbg/phpdbg --version
```
-Where the source directory has been used previously to build PHP, there exists a file named *config.nice* which can be used to invoke configure with the same
-parameters as were used by the last execution of *configure*.
+Where the source directory has been used previously to build PHP, there exists a
+file named `config.nice` which can be used to invoke configure with the same
+parameters as were used by the last execution of `configure`.
-**Note:** PHP must be configured with the switch --with-readline for phpdbg to support history, autocompletion, tab-listing etc.
+**Note:** PHP must be configured with the switch `--with-readline` for phpdbg to
+support history, autocompletion, tab-listing etc.
-Command Line Options
-====================
+## Command line options
The following switches are implemented (just like cli SAPI):
- - -n ignore php ini
- - -c search for php ini in path
- - -z load zend extension
- - -d define php ini entry
+* `-n` ignore php ini
+* `-c` search for php ini in path
+* `-z` load zend extension
+* `-d` define php ini entry
The following switches change the default behaviour of phpdbg:
- - -v disables quietness
- - -s enabled stepping
- - -e sets execution context
- - -b boring - disables use of colour on the console
- - -I ignore .phpdbginit (default init file)
- - -i override .phpgdbinit location (implies -I)
- - -O set oplog output file
- - -q do not print banner on startup
- - -r jump straight to run
- - -E enable step through eval()
- - -l listen ports for remote mode
- - -a listen address for remote mode
- - -S override SAPI name
-
-**Note:** Passing -rr will cause phpdbg to quit after execution, rather than returning to the console.
-
-Getting Started
-===============
-
-See the website for tutorials/documentation
-
-https://phpdbg.room11.org
+* `-v` disables quietness
+* `-s` enabled stepping
+* `-e` sets execution context
+* `-b` boring - disables use of colour on the console
+* `-I` ignore .phpdbginit (default init file)
+* `-i` override .phpgdbinit location (implies -I)
+* `-O` set oplog output file
+* `-q` do not print banner on startup
+* `-r` jump straight to run
+* `-E` enable step through eval()
+* `-l` listen ports for remote mode
+* `-a` listen address for remote mode
+* `-S` override SAPI name
+
+**Note:** Passing `-rr` will cause phpdbg to quit after execution, rather than
+returning to the console.
+
+## Getting started
+
+See the [website](https://phpdbg.room11.org) for tutorials/documentation.
diff --git a/sapi/phpdbg/config.m4 b/sapi/phpdbg/config.m4
index 24bc557c8b..d4bceed4f7 100644
--- a/sapi/phpdbg/config.m4
+++ b/sapi/phpdbg/config.m4
@@ -1,17 +1,29 @@
-dnl config.m4 for sapi phpdbg
-
-PHP_ARG_ENABLE(phpdbg, for phpdbg support,
-[ --enable-phpdbg Build phpdbg], yes, yes)
-
-PHP_ARG_ENABLE(phpdbg-webhelper, for phpdbg web SAPI support,
-[ --enable-phpdbg-webhelper
- Build phpdbg web SAPI support], no)
-
-PHP_ARG_ENABLE(phpdbg-debug, for phpdbg debug build,
-[ --enable-phpdbg-debug Build phpdbg in debug mode], no, no)
-
-PHP_ARG_ENABLE(phpdbg-readline, for phpdbg readline support,
-[ --enable-phpdbg-readline Enable readline support in phpdbg (depends on static ext/readline)], no, no)
+PHP_ARG_ENABLE([phpdbg],
+ [for phpdbg support],
+ [AS_HELP_STRING([--enable-phpdbg],
+ [Build phpdbg])],
+ [yes],
+ [yes])
+
+PHP_ARG_ENABLE([phpdbg-webhelper],
+ [for phpdbg web SAPI support],
+ [AS_HELP_STRING([--enable-phpdbg-webhelper],
+ [Build phpdbg web SAPI support])],
+ [no])
+
+PHP_ARG_ENABLE([phpdbg-debug],
+ [for phpdbg debug build],
+ [AS_HELP_STRING([--enable-phpdbg-debug],
+ [Build phpdbg in debug mode])],
+ [no],
+ [no])
+
+PHP_ARG_ENABLE([phpdbg-readline],
+ [for phpdbg readline support],
+ [AS_HELP_STRING([--enable-phpdbg-readline],
+ [Enable readline support in phpdbg (depends on static ext/readline)])],
+ [no],
+ [no])
if test "$BUILD_PHPDBG" = "" && test "$PHP_PHPDBG" != "no"; then
AC_HEADER_TIOCGWINSZ
@@ -82,7 +94,3 @@ fi
if test "$PHP_PHPDBG_WEBHELPER" != "no"; then
PHP_NEW_EXTENSION(phpdbg_webhelper, phpdbg_rinit_hook.c phpdbg_webdata_transfer.c, $ext_shared)
fi
-
-dnl ## Local Variables:
-dnl ## tab-width: 4
-dnl ## End:
diff --git a/sapi/phpdbg/create-test.php b/sapi/phpdbg/create-test.php
index 3388165d86..e5f7cfe2e9 100644..100755
--- 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) 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.1.in b/sapi/phpdbg/phpdbg.1.in
index 80c14941d3..357a50b727 100644
--- a/sapi/phpdbg/phpdbg.1.in
+++ b/sapi/phpdbg/phpdbg.1.in
@@ -1,4 +1,4 @@
-.TH @program_prefix@phpdbg 1 "2018" "The PHP Group" "Scripting Language"
+.TH @program_prefix@phpdbg 1 "2019" "The PHP Group" "Scripting Language"
.SH NAME
@program_prefix@phpdbg \- The interactive PHP debugger
.SH SYNOPSIS
@@ -134,7 +134,7 @@ contributors all around the world.
.SH VERSION INFORMATION
This manpage describes \fBphpdbg\fP, for PHP version @PHP_VERSION@.
.SH COPYRIGHT
-Copyright \(co 1997\-2018 The PHP Group
+Copyright \(co The PHP Group
.LP
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 03aaf54431..463749ea3a 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) 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 |
@@ -218,18 +218,6 @@ static PHP_MINIT_FUNCTION(phpdbg) /* {{{ */
static PHP_MSHUTDOWN_FUNCTION(phpdbg) /* {{{ */
{
- zend_hash_destroy(&PHPDBG_G(bp)[PHPDBG_BREAK_FILE]);
- zend_hash_destroy(&PHPDBG_G(bp)[PHPDBG_BREAK_FILE_PENDING]);
- zend_hash_destroy(&PHPDBG_G(bp)[PHPDBG_BREAK_SYM]);
- zend_hash_destroy(&PHPDBG_G(bp)[PHPDBG_BREAK_FUNCTION_OPLINE]);
- zend_hash_destroy(&PHPDBG_G(bp)[PHPDBG_BREAK_METHOD_OPLINE]);
- zend_hash_destroy(&PHPDBG_G(bp)[PHPDBG_BREAK_FILE_OPLINE]);
- zend_hash_destroy(&PHPDBG_G(bp)[PHPDBG_BREAK_OPLINE]);
- zend_hash_destroy(&PHPDBG_G(bp)[PHPDBG_BREAK_OPCODE]);
- zend_hash_destroy(&PHPDBG_G(bp)[PHPDBG_BREAK_METHOD]);
- zend_hash_destroy(&PHPDBG_G(bp)[PHPDBG_BREAK_COND]);
- zend_hash_destroy(&PHPDBG_G(bp)[PHPDBG_BREAK_MAP]);
- zend_hash_destroy(&PHPDBG_G(seek));
zend_hash_destroy(&PHPDBG_G(registered));
phpdbg_destroy_watchpoints();
@@ -249,7 +237,7 @@ static PHP_MSHUTDOWN_FUNCTION(phpdbg) /* {{{ */
}
if (PHPDBG_G(exec)) {
- efree(PHPDBG_G(exec));
+ free(PHPDBG_G(exec));
PHPDBG_G(exec) = NULL;
}
@@ -258,12 +246,6 @@ static PHP_MSHUTDOWN_FUNCTION(phpdbg) /* {{{ */
PHPDBG_G(oplog) = NULL;
}
- if (PHPDBG_G(ops)) {
- destroy_op_array(PHPDBG_G(ops));
- efree(PHPDBG_G(ops));
- PHPDBG_G(ops) = NULL;
- }
-
if (PHPDBG_G(oplog_list)) {
phpdbg_oplog_list *cur = PHPDBG_G(oplog_list);
do {
@@ -325,11 +307,11 @@ static PHP_FUNCTION(phpdbg_exec)
if (sb.st_mode & (S_IFREG|S_IFLNK)) {
if (PHPDBG_G(exec)) {
ZVAL_STRINGL(return_value, PHPDBG_G(exec), PHPDBG_G(exec_len));
- efree(PHPDBG_G(exec));
+ free(PHPDBG_G(exec));
result = 0;
}
- PHPDBG_G(exec) = estrndup(ZSTR_VAL(exec), ZSTR_LEN(exec));
+ PHPDBG_G(exec) = zend_strndup(ZSTR_VAL(exec), ZSTR_LEN(exec));
PHPDBG_G(exec_len) = ZSTR_LEN(exec);
if (result) {
@@ -480,9 +462,9 @@ static PHP_FUNCTION(phpdbg_start_oplog)
static zend_always_inline zend_bool phpdbg_is_ignored_opcode(zend_uchar opcode) {
return
opcode == ZEND_NOP || opcode == ZEND_OP_DATA || opcode == ZEND_FE_FREE || opcode == ZEND_FREE || opcode == ZEND_ASSERT_CHECK || opcode == ZEND_VERIFY_RETURN_TYPE
- || opcode == ZEND_DECLARE_CONST || opcode == ZEND_DECLARE_CLASS || opcode == ZEND_DECLARE_INHERITED_CLASS || opcode == ZEND_DECLARE_FUNCTION
- || opcode == ZEND_DECLARE_INHERITED_CLASS_DELAYED || opcode == ZEND_VERIFY_ABSTRACT_CLASS || opcode == ZEND_ADD_TRAIT || opcode == ZEND_BIND_TRAITS
- || opcode == ZEND_DECLARE_ANON_CLASS || opcode == ZEND_DECLARE_ANON_INHERITED_CLASS || opcode == ZEND_FAST_RET || opcode == ZEND_TICKS
+ || opcode == ZEND_DECLARE_CONST || opcode == ZEND_DECLARE_CLASS || opcode == ZEND_DECLARE_FUNCTION
+ || opcode == ZEND_DECLARE_CLASS_DELAYED
+ || opcode == ZEND_DECLARE_ANON_CLASS || opcode == ZEND_FAST_RET || opcode == ZEND_TICKS
|| opcode == ZEND_EXT_STMT || opcode == ZEND_EXT_FCALL_BEGIN || opcode == ZEND_EXT_FCALL_END || opcode == ZEND_EXT_NOP || opcode == ZEND_BIND_GLOBAL
;
}
@@ -671,11 +653,11 @@ static PHP_FUNCTION(phpdbg_end_oplog)
{
zend_string *last_file = NULL;
- HashTable *file_ht;
+ HashTable *file_ht = NULL;
zend_string *last_function = (void *)~(uintptr_t)0;
zend_class_entry *last_scope = NULL;
- HashTable *insert_ht;
+ HashTable *insert_ht = NULL;
zend_long insert_idx;
do {
@@ -717,6 +699,7 @@ static PHP_FUNCTION(phpdbg_end_oplog)
insert_idx = cur->op->lineno;
}
+ ZEND_ASSERT(insert_ht && file_ht);
{
zval *num = zend_hash_index_find(insert_ht, insert_idx);
if (!num) {
@@ -901,6 +884,27 @@ static int php_sapi_phpdbg_activate(void) /* {{{ */
static int php_sapi_phpdbg_deactivate(void) /* {{{ */
{
+ /* Everything using ZMM should be freed here... */
+ zend_hash_destroy(&PHPDBG_G(file_sources));
+ zend_hash_destroy(&PHPDBG_G(bp)[PHPDBG_BREAK_FILE]);
+ zend_hash_destroy(&PHPDBG_G(bp)[PHPDBG_BREAK_FILE_PENDING]);
+ zend_hash_destroy(&PHPDBG_G(bp)[PHPDBG_BREAK_SYM]);
+ zend_hash_destroy(&PHPDBG_G(bp)[PHPDBG_BREAK_FUNCTION_OPLINE]);
+ zend_hash_destroy(&PHPDBG_G(bp)[PHPDBG_BREAK_METHOD_OPLINE]);
+ zend_hash_destroy(&PHPDBG_G(bp)[PHPDBG_BREAK_FILE_OPLINE]);
+ zend_hash_destroy(&PHPDBG_G(bp)[PHPDBG_BREAK_OPLINE]);
+ zend_hash_destroy(&PHPDBG_G(bp)[PHPDBG_BREAK_OPCODE]);
+ zend_hash_destroy(&PHPDBG_G(bp)[PHPDBG_BREAK_METHOD]);
+ zend_hash_destroy(&PHPDBG_G(bp)[PHPDBG_BREAK_COND]);
+ zend_hash_destroy(&PHPDBG_G(bp)[PHPDBG_BREAK_MAP]);
+ zend_hash_destroy(&PHPDBG_G(seek));
+
+ if (PHPDBG_G(ops)) {
+ destroy_op_array(PHPDBG_G(ops));
+ efree(PHPDBG_G(ops));
+ PHPDBG_G(ops) = NULL;
+ }
+
return SUCCESS;
}
@@ -1416,9 +1420,10 @@ int main(int argc, char **argv) /* {{{ */
phpdbg_main:
#ifdef ZTS
- tsrm_startup(1, 1, 0, NULL);
- (void)ts_resource(0);
+ php_tsrm_startup();
+# ifdef PHP_WIN32
ZEND_TSRMLS_CACHE_UPDATE();
+# endif
#endif
zend_signal_startup();
@@ -1659,16 +1664,17 @@ phpdbg_main:
phpdbg_set_color_ex(PHPDBG_COLOR_ERROR, PHPDBG_STRL("red-bold"));
phpdbg_set_color_ex(PHPDBG_COLOR_NOTICE, PHPDBG_STRL("green"));
- /* set default prompt */
- phpdbg_set_prompt(PHPDBG_DEFAULT_PROMPT);
-
if (settings > (zend_phpdbg_globals *) 0x2) {
#ifdef ZTS
- *((zend_phpdbg_globals *) (*((void ***) TSRMLS_CACHE))[TSRM_UNSHUFFLE_RSRC_ID(phpdbg_globals_id)]) = *settings;
+ zend_phpdbg_globals *ptr = TSRMG_BULK_STATIC(phpdbg_globals_id, zend_phpdbg_globals *);
+ *ptr = *settings;
#else
phpdbg_globals = *settings;
#endif
free(settings);
+ } else {
+ /* set default prompt */
+ phpdbg_set_prompt(PHPDBG_DEFAULT_PROMPT);
}
/* set flags from command line */
@@ -1690,7 +1696,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) The PHP Group\n%s",
PHPDBG_VERSION,
__DATE__,
__TIME__,
@@ -2092,10 +2098,6 @@ phpdbg_out:
zend_objects_store_mark_destructed(&EG(objects_store));
}
- zend_try {
- php_request_shutdown(NULL);
- } zend_end_try();
-
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);
@@ -2103,6 +2105,10 @@ phpdbg_out:
sprintf(ZSTR_VAL(backup_phpdbg_compile), "?>%.*s", (int) data->len, data->buf);
}
+ zend_try {
+ php_request_shutdown(NULL);
+ } zend_end_try();
+
/* backup globals when cleaning */
if ((cleaning > 0 || remote) && !quit_immediately) {
settings = calloc(1, sizeof(zend_phpdbg_globals));
@@ -2155,12 +2161,6 @@ phpdbg_out:
Z_PTR_P(zv) = (void*)PHPDBG_G(orig_url_wrap_php);
}
- zend_hash_destroy(&PHPDBG_G(file_sources));
-
- zend_try {
- php_module_shutdown();
- } zend_end_try();
-
#ifndef _WIN32
/* force override (no zend_signals) to prevent crashes due to signal recursion in SIGSEGV/SIGBUS handlers */
signal(SIGSEGV, SIG_DFL);
@@ -2171,6 +2171,8 @@ phpdbg_out:
#endif
}
+ php_module_shutdown();
+
sapi_shutdown();
if (sapi_name) {
diff --git a/sapi/phpdbg/phpdbg.h b/sapi/phpdbg/phpdbg.h
index 72501bffb4..d1b22e6f40 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) 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 |
@@ -46,7 +46,7 @@
#include "zend_ini_scanner.h"
#include "zend_stream.h"
#include "zend_signal.h"
-#if !defined(_WIN32) && !defined(ZEND_SIGNALS) && defined(HAVE_SIGNAL_H)
+#if !defined(_WIN32) && !defined(ZEND_SIGNALS)
# include <signal.h>
#elif defined(PHP_WIN32)
# include "win32/signal.h"
@@ -106,7 +106,7 @@
#define PHPDBG_NAME "phpdbg"
#define PHPDBG_AUTHORS "Felipe Pena, Joe Watkins and Bob Weinand" /* Ordered by last name */
#define PHPDBG_ISSUES "http://bugs.php.net/report.php"
-#define PHPDBG_VERSION "0.5.0"
+#define PHPDBG_VERSION PHP_VERSION
#define PHPDBG_INIT_FILENAME ".phpdbginit"
#define PHPDBG_DEFAULT_PROMPT "prompt>"
/* }}} */
@@ -121,7 +121,7 @@
#if !defined(PHPDBG_WEBDATA_TRANSFER_H) && !defined(PHPDBG_WEBHELPER_H)
#ifdef ZTS
-# define PHPDBG_G(v) TSRMG(phpdbg_globals_id, zend_phpdbg_globals *, v)
+# define PHPDBG_G(v) ZEND_TSRMG(phpdbg_globals_id, zend_phpdbg_globals *, v)
#else
# define PHPDBG_G(v) (phpdbg_globals.v)
#endif
diff --git a/sapi/phpdbg/phpdbg_bp.c b/sapi/phpdbg/phpdbg_bp.c
index c0053005ad..3a47c78470 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) 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..7e038bb10e 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) 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..719d93d166 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) 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..0aafa592e9 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) 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..c174920836 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) 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..4ffb72697a 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) 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 e93e92190e..b736481089 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) 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 |
@@ -573,7 +573,7 @@ PHPDBG_API const phpdbg_command_t *phpdbg_stack_resolve(const phpdbg_command_t *
const phpdbg_command_t *command = commands;
phpdbg_param_t *name = *top;
const phpdbg_command_t *matched[3] = {NULL, NULL, NULL};
- ulong matches = 0L;
+ zend_ulong matches = 0L;
while (command && command->name && command->handler) {
if (name->len == 1 || command->name_len >= name->len) {
@@ -645,7 +645,7 @@ PHPDBG_API const phpdbg_command_t *phpdbg_stack_resolve(const phpdbg_command_t *
}
/* ", " separated matches */
- phpdbg_error("command", "type=\"ambiguous\" command=\"%s\" matches=\"%lu\" matched=\"%s\"", "The command \"%s\" is ambigious, matching %lu commands (%s)", name->str, matches, list);
+ phpdbg_error("command", "type=\"ambiguous\" command=\"%s\" matches=\"%lu\" matched=\"%s\"", "The command \"%s\" is ambiguous, matching %lu commands (%s)", name->str, matches, list);
efree(list);
return NULL;
diff --git a/sapi/phpdbg/phpdbg_cmd.h b/sapi/phpdbg/phpdbg_cmd.h
index f5d5a8d465..b82ed9aceb 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) 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..dc4e07c76c 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) 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 |
@@ -81,27 +81,30 @@ char *phpdbg_eol_rep(int id)
return NULL;
}
+/* Marked as never_inline to work around a -Walloc-size-larger-than bug in GCC. */
+static zend_never_inline int count_lf_and_cr(const char *in, int in_len) {
+ int i, count = 0;
+ for (i = 0; i < in_len; i++) {
+ if (0x0a == in[i] || 0x0d == in[i]) {
+ count++;
+ }
+ }
+ return count;
+}
/* Inspired by https://ccrma.stanford.edu/~craig/utility/flip/flip.cpp */
void phpdbg_eol_convert(char **str, int *len)
{
- char *in = *str, *out ;
- int in_len = *len, out_len, cursor, i;
+ char *in = *str, *out;
+ int in_len = *len, cursor, i;
char last, cur;
if ((PHPDBG_G(flags) & PHPDBG_IS_REMOTE) != PHPDBG_IS_REMOTE) {
return;
}
- out_len = *len;
if (PHPDBG_EOL_CRLF == PHPDBG_G(eol)) { /* XXX add LFCR case if it's gonna be needed */
- /* depending on the source EOL the out str will have all CR/LF duplicated */
- for (i = 0; i < in_len; i++) {
- if (0x0a == in[i] || 0x0d == in[i]) {
- out_len++;
- }
- }
- out = (char *)emalloc(out_len);
+ out = (char *)emalloc(in_len + count_lf_and_cr(in, in_len));
last = cur = in[0];
i = cursor = 0;
@@ -142,7 +145,7 @@ void phpdbg_eol_convert(char **str, int *len)
}
/* We gonna have a smaller or equally long string, estimation is almost neglecting */
- out = (char *)emalloc(out_len);
+ out = (char *)emalloc(in_len);
last = cur = in[0];
i = cursor = 0;
diff --git a/sapi/phpdbg/phpdbg_eol.h b/sapi/phpdbg/phpdbg_eol.h
index 8d6ee8278e..46141c62cd 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) 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 2065277dfe..912089ea23 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) 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 |
@@ -171,7 +171,7 @@ void phpdbg_switch_frame(int frame) /* {{{ */
static void phpdbg_dump_prototype(zval *tmp) /* {{{ */
{
- zval *funcname, *class, class_zv, *type, *args, *argstmp;
+ zval *funcname, *class, class_zv, *args, *argstmp;
funcname = zend_hash_str_find(Z_ARRVAL_P(tmp), ZEND_STRL("function"));
@@ -183,21 +183,22 @@ static void phpdbg_dump_prototype(zval *tmp) /* {{{ */
}
if (class) {
- type = zend_hash_str_find(Z_ARRVAL_P(tmp), ZEND_STRL("type"));
+ zval *type = zend_hash_str_find(Z_ARRVAL_P(tmp), ZEND_STRL("type"));
+
+ phpdbg_xml(" symbol=\"%s%s%s\"", Z_STRVAL_P(class), Z_STRVAL_P(type), Z_STRVAL_P(funcname));
+ phpdbg_out("%s%s%s(", Z_STRVAL_P(class), Z_STRVAL_P(type), Z_STRVAL_P(funcname));
+ } else {
+ phpdbg_xml(" symbol=\"%s\"", Z_STRVAL_P(funcname));
+ phpdbg_out("%s(", Z_STRVAL_P(funcname));
}
args = zend_hash_str_find(Z_ARRVAL_P(tmp), ZEND_STRL("args"));
-
- phpdbg_xml(" symbol=\"%s%s%s\"", class ? Z_STRVAL_P(class) : "", class ? Z_STRVAL_P(type) : "", Z_STRVAL_P(funcname));
-
if (args) {
phpdbg_xml(">");
} else {
phpdbg_xml(" />");
}
- phpdbg_out("%s%s%s(", class ? Z_STRVAL_P(class) : "", class ? Z_STRVAL_P(type) : "", Z_STRVAL_P(funcname));
-
if (args) {
const zend_function *func = NULL;
const zend_arg_info *arginfo = NULL;
diff --git a/sapi/phpdbg/phpdbg_frame.h b/sapi/phpdbg/phpdbg_frame.h
index 05655314c4..d7d9534b1f 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) 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 b328906d3c..32d2485ff9 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) 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 |
@@ -924,7 +924,7 @@ phpdbg_help_text_t phpdbg_help_text[] = {
" Enable refcount display when hitting watchpoints" CR CR
" $P S b 4 off" CR
-" Temporarily disable breakpoint 4. This can be subsequently reenabled by a **S b 4 on**." CR
+" Temporarily disable breakpoint 4. This can be subsequently re-enabled by a **S b 4 on**." CR
//*********** check oplog syntax
},
diff --git a/sapi/phpdbg/phpdbg_help.h b/sapi/phpdbg/phpdbg_help.h
index b34d84e538..420e6fb014 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) 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 146a45681b..bcec3361fc 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) 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 |
@@ -343,11 +343,11 @@ PHPDBG_INFO(literal) /* {{{ */
PHPDBG_INFO(memory) /* {{{ */
{
size_t used, real, peak_used, peak_real;
- zend_mm_heap *heap;
+ zend_mm_heap *orig_heap = NULL;
zend_bool is_mm;
if (PHPDBG_G(flags) & PHPDBG_IN_SIGNAL_HANDLER) {
- heap = zend_mm_set_heap(phpdbg_original_heap_sigsafe_mem());
+ orig_heap = zend_mm_set_heap(phpdbg_original_heap_sigsafe_mem());
}
if ((is_mm = is_zend_mm())) {
used = zend_memory_usage(0);
@@ -355,8 +355,8 @@ PHPDBG_INFO(memory) /* {{{ */
peak_used = zend_memory_peak_usage(0);
peak_real = zend_memory_peak_usage(1);
}
- if (PHPDBG_G(flags) & PHPDBG_IN_SIGNAL_HANDLER) {
- zend_mm_set_heap(heap);
+ if (orig_heap) {
+ zend_mm_set_heap(orig_heap);
}
if (is_mm) {
diff --git a/sapi/phpdbg/phpdbg_info.h b/sapi/phpdbg/phpdbg_info.h
index 38137fec14..faf0090bd3 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) 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 1f26f7983b..6917daa9d9 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) 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 |
@@ -208,7 +208,7 @@ static int phpdbg_output_pager(int sock, const char *ptr, int len) {
if (*buf == 'q') {
break;
}
- write(sock, "\r", 1);
+ zend_quiet_write(sock, "\r", 1);
} else break;
}
}
diff --git a/sapi/phpdbg/phpdbg_io.h b/sapi/phpdbg/phpdbg_io.h
index deda272da2..d875d276cb 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) 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.c b/sapi/phpdbg/phpdbg_lexer.c
deleted file mode 100644
index 2ab0b5ac67..0000000000
--- a/sapi/phpdbg/phpdbg_lexer.c
+++ /dev/null
@@ -1,2085 +0,0 @@
-/* Generated by re2c 1.0.3 */
-#line 1 "sapi/phpdbg/phpdbg_lexer.l"
-/*
- * phpdbg_lexer.l
- */
-
-#include "phpdbg.h"
-#include "phpdbg_cmd.h"
-
-#include "phpdbg_parser.h"
-
-#define LEX(v) (PHPDBG_G(lexer).v)
-
-#define YYCTYPE unsigned char
-#define YYSETCONDITION(x) LEX(state) = x;
-#define YYGETCONDITION() LEX(state)
-#define YYCURSOR LEX(cursor)
-#define YYMARKER LEX(marker)
-#define YYCTXMARKER LEX(ctxmarker)
-#define yyleng LEX(len)
-#define yytext ((char*) LEX(text))
-#undef YYDEBUG
-#define YYDEBUG(a, b)
-#define YYFILL(n)
-
-#define NORMAL 0
-#define PRE_RAW 1
-#define RAW 2
-#define INITIAL 3
-
-ZEND_EXTERN_MODULE_GLOBALS(phpdbg)
-
-void phpdbg_init_lexer (phpdbg_param_t *stack, char *input) {
- PHPDBG_G(parser_stack) = stack;
-
- YYSETCONDITION(INITIAL);
-
- LEX(text) = YYCURSOR = (unsigned char *) input;
- LEX(len) = strlen(input);
-}
-
-static int unescape_string(char *s) {
- switch (*s) {
- case '\'':
- case '\"': {
- char start = *s;
- size_t off = 1;
- do {
- if (s[off] == '\\') {
- off++;
- }
- *s = s[off];
- } while ((++s)[off] != start);
- return off + 1;
- }
- }
-
- return 0;
-}
-
-int phpdbg_lex (phpdbg_param_t* yylval) {
-
-restart:
- LEX(text) = YYCURSOR;
-
-
-#line 68 "sapi/phpdbg/phpdbg_lexer.c"
-{
- YYCTYPE yych;
- unsigned int yyaccept = 0;
- if (YYGETCONDITION() < 2) {
- if (YYGETCONDITION() < 1) {
- goto yyc_NORMAL;
- } else {
- goto yyc_PRE_RAW;
- }
- } else {
- if (YYGETCONDITION() < 3) {
- goto yyc_RAW;
- } else {
- goto yyc_INITIAL;
- }
- }
-/* *********************************** */
-yyc_NORMAL:
- {
- static const unsigned char yybm[] = {
- /* table 1 .. 8: 0 */
- 0, 62, 62, 62, 62, 62, 62, 62,
- 62, 40, 0, 62, 62, 40, 62, 62,
- 62, 62, 62, 62, 62, 62, 62, 62,
- 62, 62, 62, 62, 62, 62, 62, 62,
- 40, 62, 50, 40, 62, 62, 62, 14,
- 62, 62, 62, 62, 62, 62, 63, 62,
- 127, 127, 127, 127, 127, 127, 127, 127,
- 127, 127, 40, 62, 62, 62, 62, 62,
- 62, 254, 254, 254, 254, 254, 254, 190,
- 190, 190, 190, 190, 190, 190, 190, 190,
- 190, 190, 190, 190, 190, 190, 190, 190,
- 190, 190, 190, 62, 2, 62, 62, 62,
- 62, 254, 254, 254, 254, 254, 254, 190,
- 190, 190, 190, 190, 190, 190, 190, 190,
- 190, 190, 190, 190, 190, 190, 190, 190,
- 190, 190, 190, 62, 62, 62, 62, 62,
- 62, 62, 62, 62, 62, 62, 62, 62,
- 62, 62, 62, 62, 62, 62, 62, 62,
- 62, 62, 62, 62, 62, 62, 62, 62,
- 62, 62, 62, 62, 62, 62, 62, 62,
- 62, 62, 62, 62, 62, 62, 62, 62,
- 62, 62, 62, 62, 62, 62, 62, 62,
- 62, 62, 62, 62, 62, 62, 62, 62,
- 62, 62, 62, 62, 62, 62, 62, 62,
- 62, 62, 62, 62, 62, 62, 62, 62,
- 62, 62, 62, 62, 62, 62, 62, 62,
- 62, 62, 62, 62, 62, 62, 62, 62,
- 62, 62, 62, 62, 62, 62, 62, 62,
- 62, 62, 62, 62, 62, 62, 62, 62,
- 62, 62, 62, 62, 62, 62, 62, 62,
- 62, 62, 62, 62, 62, 62, 62, 62,
- 62, 62, 62, 62, 62, 62, 62, 62,
- /* table 9 .. 10: 256 */
- 0, 64, 64, 64, 64, 64, 64, 64,
- 64, 128, 0, 64, 64, 128, 64, 64,
- 64, 64, 64, 64, 64, 64, 64, 64,
- 64, 64, 64, 64, 64, 64, 64, 64,
- 128, 64, 0, 0, 64, 64, 64, 0,
- 64, 64, 64, 64, 64, 64, 64, 64,
- 64, 64, 64, 64, 64, 64, 64, 64,
- 64, 64, 0, 64, 64, 64, 64, 64,
- 64, 64, 64, 64, 64, 64, 64, 64,
- 64, 64, 64, 64, 64, 64, 64, 64,
- 64, 64, 64, 64, 64, 64, 64, 64,
- 64, 64, 64, 64, 64, 64, 64, 64,
- 64, 64, 64, 64, 64, 64, 64, 64,
- 64, 64, 64, 64, 64, 64, 64, 64,
- 64, 64, 64, 64, 64, 64, 64, 64,
- 64, 64, 64, 64, 64, 64, 64, 64,
- 64, 64, 64, 64, 64, 64, 64, 64,
- 64, 64, 64, 64, 64, 64, 64, 64,
- 64, 64, 64, 64, 64, 64, 64, 64,
- 64, 64, 64, 64, 64, 64, 64, 64,
- 64, 64, 64, 64, 64, 64, 64, 64,
- 64, 64, 64, 64, 64, 64, 64, 64,
- 64, 64, 64, 64, 64, 64, 64, 64,
- 64, 64, 64, 64, 64, 64, 64, 64,
- 64, 64, 64, 64, 64, 64, 64, 64,
- 64, 64, 64, 64, 64, 64, 64, 64,
- 64, 64, 64, 64, 64, 64, 64, 64,
- 64, 64, 64, 64, 64, 64, 64, 64,
- 64, 64, 64, 64, 64, 64, 64, 64,
- 64, 64, 64, 64, 64, 64, 64, 64,
- 64, 64, 64, 64, 64, 64, 64, 64,
- 64, 64, 64, 64, 64, 64, 64, 64,
- };
- YYDEBUG(1, *YYCURSOR);
- YYFILL(11);
- yych = *YYCURSOR;
- if (yybm[256+yych] & 128) {
- goto yy8;
- }
- switch (yych) {
- case 0x00:
- case '\t':
- case '\n': goto yy3;
- case '"': goto yy11;
- case '#': goto yy13;
- case '\'': goto yy15;
- case '-': goto yy16;
- case '.':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9': goto yy17;
- case '0': goto yy20;
- case ':': goto yy21;
- case 'D':
- case 'd': goto yy22;
- case 'E':
- case 'e': goto yy23;
- case 'F':
- case 'f': goto yy24;
- case 'I':
- case 'i': goto yy25;
- case 'N':
- case 'n': goto yy26;
- case 'O':
- case 'o': goto yy27;
- case 'T':
- case 't': goto yy28;
- case 'Y':
- case 'y': goto yy29;
- case 'Z': goto yy30;
- case 'z': goto yy31;
- default: goto yy5;
- }
-yy3:
- YYDEBUG(3, *YYCURSOR);
- ++YYCURSOR;
- YYDEBUG(4, *YYCURSOR);
- yyleng = (size_t) YYCURSOR - (size_t) yytext;
-#line 89 "sapi/phpdbg/phpdbg_lexer.l"
- {
- return 0;
-}
-#line 211 "sapi/phpdbg/phpdbg_lexer.c"
-yy5:
- YYDEBUG(5, *YYCURSOR);
- yyaccept = 0;
- YYMARKER = ++YYCURSOR;
- YYFILL(3);
- yych = *YYCURSOR;
-yy6:
- YYDEBUG(6, *YYCURSOR);
- if (yybm[256+yych] & 64) {
- goto yy5;
- }
- if (yych <= ' ') goto yy7;
- if (yych == '#') goto yy7;
- if (yych <= '\'') goto yy32;
- goto yy34;
-yy7:
- YYDEBUG(7, *YYCURSOR);
- yyleng = (size_t) YYCURSOR - (size_t) yytext;
-#line 161 "sapi/phpdbg/phpdbg_lexer.l"
- {
- phpdbg_init_param(yylval, STR_PARAM);
- yylval->str = estrndup(yytext, yyleng - unescape_string(yytext));
- yylval->len = yyleng;
- return T_ID;
-}
-#line 237 "sapi/phpdbg/phpdbg_lexer.c"
-yy8:
- YYDEBUG(8, *YYCURSOR);
- ++YYCURSOR;
- YYFILL(1);
- yych = *YYCURSOR;
- YYDEBUG(9, *YYCURSOR);
- if (yybm[256+yych] & 128) {
- goto yy8;
- }
- YYDEBUG(10, *YYCURSOR);
- yyleng = (size_t) YYCURSOR - (size_t) yytext;
-#line 175 "sapi/phpdbg/phpdbg_lexer.l"
- {
- /* ignore whitespace */
-
- goto restart;
-}
-#line 255 "sapi/phpdbg/phpdbg_lexer.c"
-yy11:
- YYDEBUG(11, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == '"') goto yy32;
- goto yy36;
-yy12:
- YYDEBUG(12, *YYCURSOR);
- YYCURSOR = YYMARKER;
- if (yyaccept <= 3) {
- if (yyaccept <= 1) {
- if (yyaccept == 0) {
- goto yy7;
- } else {
- goto yy14;
- }
- } else {
- if (yyaccept == 2) {
- goto yy19;
- } else {
- goto yy83;
- }
- }
- } else {
- if (yyaccept <= 5) {
- if (yyaccept == 4) {
- goto yy86;
- } else {
- goto yy102;
- }
- } else {
- goto yy119;
- }
- }
-yy13:
- YYDEBUG(13, *YYCURSOR);
- yyaccept = 1;
- yych = *(YYMARKER = ++YYCURSOR);
- if (yych <= '.') {
- if (yych <= ',') goto yy14;
- if (yych <= '-') {
- YYCTXMARKER = YYCURSOR;
- goto yy41;
- }
- YYCTXMARKER = YYCURSOR;
- goto yy42;
- } else {
- if (yych <= '/') goto yy14;
- if (yych <= '9') {
- YYCTXMARKER = YYCURSOR;
- goto yy42;
- }
- }
-yy14:
- YYDEBUG(14, *YYCURSOR);
- yyleng = (size_t) YYCURSOR - (size_t) yytext;
-#line 110 "sapi/phpdbg/phpdbg_lexer.l"
- {
- YYSETCONDITION(INITIAL);
- return T_SEPARATOR;
-}
-#line 316 "sapi/phpdbg/phpdbg_lexer.c"
-yy15:
- YYDEBUG(15, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == '\'') goto yy32;
- goto yy46;
-yy16:
- YYDEBUG(16, *YYCURSOR);
- yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- if (yybm[0+yych] & 1) {
- goto yy17;
- }
- if (yych == 'r') goto yy51;
- goto yy6;
-yy17:
- YYDEBUG(17, *YYCURSOR);
- yyaccept = 2;
- YYMARKER = ++YYCURSOR;
- YYFILL(3);
- yych = *YYCURSOR;
- YYDEBUG(18, *YYCURSOR);
- if (yybm[0+yych] & 1) {
- goto yy17;
- }
- if (yych <= ' ') {
- if (yych <= '\n') {
- if (yych <= 0x00) goto yy19;
- if (yych <= 0x08) goto yy5;
- } else {
- if (yych == '\r') goto yy19;
- if (yych <= 0x1F) goto yy5;
- }
- } else {
- if (yych <= '&') {
- if (yych <= '!') goto yy5;
- if (yych <= '"') goto yy32;
- if (yych >= '$') goto yy5;
- } else {
- if (yych <= '\'') goto yy32;
- if (yych <= '/') goto yy5;
- if (yych <= ':') goto yy34;
- goto yy5;
- }
- }
-yy19:
- YYDEBUG(19, *YYCURSOR);
- yyleng = (size_t) YYCURSOR - (size_t) yytext;
-#line 142 "sapi/phpdbg/phpdbg_lexer.l"
- {
- phpdbg_init_param(yylval, NUMERIC_PARAM);
- yylval->num = atoi(yytext);
- return T_DIGITS;
-}
-#line 370 "sapi/phpdbg/phpdbg_lexer.c"
-yy20:
- YYDEBUG(20, *YYCURSOR);
- yyaccept = 2;
- yych = *(YYMARKER = ++YYCURSOR);
- if (yybm[0+yych] & 1) {
- goto yy17;
- }
- if (yych <= 0x1F) {
- if (yych <= '\n') {
- if (yych <= 0x00) goto yy19;
- if (yych <= 0x08) goto yy6;
- goto yy19;
- } else {
- if (yych == '\r') goto yy19;
- goto yy6;
- }
- } else {
- if (yych <= '#') {
- if (yych <= ' ') goto yy19;
- if (yych <= '"') goto yy6;
- goto yy19;
- } else {
- if (yych == 'x') goto yy52;
- goto yy6;
- }
- }
-yy21:
- YYDEBUG(21, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == ':') goto yy55;
- if (yych == '\\') goto yy57;
- goto yy53;
-yy22:
- YYDEBUG(22, *YYCURSOR);
- yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- if (yych == 'I') goto yy59;
- if (yych == 'i') goto yy59;
- goto yy6;
-yy23:
- YYDEBUG(23, *YYCURSOR);
- yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- if (yych == 'N') goto yy60;
- if (yych == 'n') goto yy60;
- goto yy6;
-yy24:
- YYDEBUG(24, *YYCURSOR);
- yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- if (yych == 'A') goto yy61;
- if (yych == 'a') goto yy61;
- goto yy6;
-yy25:
- YYDEBUG(25, *YYCURSOR);
- yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- if (yych == 'F') goto yy62;
- if (yych == 'f') goto yy62;
- goto yy6;
-yy26:
- YYDEBUG(26, *YYCURSOR);
- yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- if (yych == 'O') goto yy63;
- if (yych == 'o') goto yy63;
- goto yy6;
-yy27:
- YYDEBUG(27, *YYCURSOR);
- yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- if (yych <= 'N') {
- if (yych == 'F') goto yy64;
- if (yych <= 'M') goto yy6;
- goto yy65;
- } else {
- if (yych <= 'f') {
- if (yych <= 'e') goto yy6;
- goto yy64;
- } else {
- if (yych == 'n') goto yy65;
- goto yy6;
- }
- }
-yy28:
- YYDEBUG(28, *YYCURSOR);
- yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- if (yych == 'R') goto yy66;
- if (yych == 'r') goto yy66;
- goto yy6;
-yy29:
- YYDEBUG(29, *YYCURSOR);
- yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- if (yych == 'E') goto yy67;
- if (yych == 'e') goto yy67;
- goto yy6;
-yy30:
- YYDEBUG(30, *YYCURSOR);
- yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- if (yych == 'E') goto yy68;
- goto yy6;
-yy31:
- YYDEBUG(31, *YYCURSOR);
- yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- if (yych == 'e') goto yy69;
- goto yy6;
-yy32:
- YYDEBUG(32, *YYCURSOR);
- ++YYCURSOR;
- YYFILL(3);
- yych = *YYCURSOR;
-yy33:
- YYDEBUG(33, *YYCURSOR);
- if (yybm[0+yych] & 2) {
- goto yy32;
- }
- if (yych <= '#') goto yy12;
- goto yy70;
-yy34:
- YYDEBUG(34, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == '/') goto yy71;
- if (yych == '\\') goto yy57;
- goto yy12;
-yy35:
- YYDEBUG(35, *YYCURSOR);
- ++YYCURSOR;
- YYFILL(4);
- yych = *YYCURSOR;
-yy36:
- YYDEBUG(36, *YYCURSOR);
- if (yybm[0+yych] & 4) {
- goto yy35;
- }
- if (yych <= ' ') {
- if (yych <= 0x00) goto yy12;
- if (yych == '\n') goto yy12;
- } else {
- if (yych <= '"') goto yy72;
- if (yych <= '#') goto yy37;
- if (yych <= ':') goto yy39;
- goto yy40;
- }
-yy37:
- YYDEBUG(37, *YYCURSOR);
- ++YYCURSOR;
- YYFILL(1);
- yych = *YYCURSOR;
-yy38:
- YYDEBUG(38, *YYCURSOR);
- if (yybm[0+yych] & 8) {
- goto yy37;
- }
- if (yych <= '\n') goto yy12;
- if (yych <= '"') goto yy73;
- goto yy74;
-yy39:
- YYDEBUG(39, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == '/') goto yy75;
- goto yy38;
-yy40:
- YYDEBUG(40, *YYCURSOR);
- ++YYCURSOR;
- YYFILL(3);
- yych = *YYCURSOR;
- if (yych <= ' ') {
- if (yych <= '\n') {
- if (yych <= 0x00) goto yy12;
- if (yych <= 0x08) goto yy32;
- goto yy12;
- } else {
- if (yych == '\r') goto yy12;
- if (yych <= 0x1F) goto yy32;
- goto yy12;
- }
- } else {
- if (yych <= '9') {
- if (yych <= '!') goto yy32;
- if (yych <= '"') goto yy35;
- if (yych <= '#') goto yy12;
- goto yy32;
- } else {
- if (yych <= ':') goto yy70;
- if (yych == '\\') goto yy35;
- goto yy32;
- }
- }
-yy41:
- YYDEBUG(41, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == '.') goto yy42;
- if (yych <= '/') goto yy12;
- if (yych >= ':') goto yy12;
-yy42:
- YYDEBUG(42, *YYCURSOR);
- ++YYCURSOR;
- YYFILL(1);
- yych = *YYCURSOR;
- YYDEBUG(43, *YYCURSOR);
- if (yych == '.') goto yy42;
- if (yych <= '/') goto yy44;
- if (yych <= '9') goto yy42;
-yy44:
- YYDEBUG(44, *YYCURSOR);
- YYCURSOR = YYCTXMARKER;
- yyleng = (size_t) YYCURSOR - (size_t) yytext;
-#line 106 "sapi/phpdbg/phpdbg_lexer.l"
- {
- return T_POUND;
-}
-#line 586 "sapi/phpdbg/phpdbg_lexer.c"
-yy45:
- YYDEBUG(45, *YYCURSOR);
- ++YYCURSOR;
- YYFILL(4);
- yych = *YYCURSOR;
-yy46:
- YYDEBUG(46, *YYCURSOR);
- if (yybm[0+yych] & 16) {
- goto yy45;
- }
- if (yych <= '\n') {
- if (yych <= 0x00) goto yy12;
- if (yych >= '\n') goto yy12;
- } else {
- if (yych <= '#') goto yy47;
- if (yych <= '\'') goto yy72;
- if (yych <= ':') goto yy49;
- goto yy50;
- }
-yy47:
- YYDEBUG(47, *YYCURSOR);
- ++YYCURSOR;
- YYFILL(1);
- yych = *YYCURSOR;
-yy48:
- YYDEBUG(48, *YYCURSOR);
- if (yybm[0+yych] & 32) {
- goto yy47;
- }
- if (yych <= '\n') goto yy12;
- if (yych <= '\'') goto yy73;
- goto yy76;
-yy49:
- YYDEBUG(49, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == '/') goto yy77;
- goto yy48;
-yy50:
- YYDEBUG(50, *YYCURSOR);
- ++YYCURSOR;
- YYFILL(3);
- yych = *YYCURSOR;
- if (yych <= '"') {
- if (yych <= '\f') {
- if (yych <= 0x00) goto yy12;
- if (yych <= 0x08) goto yy32;
- if (yych <= '\n') goto yy12;
- goto yy32;
- } else {
- if (yych <= '\r') goto yy12;
- if (yych == ' ') goto yy12;
- goto yy32;
- }
- } else {
- if (yych <= '9') {
- if (yych <= '#') goto yy12;
- if (yych == '\'') goto yy45;
- goto yy32;
- } else {
- if (yych <= ':') goto yy70;
- if (yych == '\\') goto yy45;
- goto yy32;
- }
- }
-yy51:
- YYDEBUG(51, *YYCURSOR);
- yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- if (yych <= ' ') {
- if (yych <= '\f') {
- if (yych == '\t') goto yy78;
- goto yy6;
- } else {
- if (yych <= '\r') goto yy78;
- if (yych <= 0x1F) goto yy6;
- goto yy78;
- }
- } else {
- if (yych <= '.') {
- if (yych <= ',') goto yy6;
- if (yych <= '-') goto yy80;
- goto yy81;
- } else {
- if (yych <= '/') goto yy6;
- if (yych <= '9') goto yy81;
- goto yy6;
- }
- }
-yy52:
- YYDEBUG(52, *YYCURSOR);
- yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- if (yybm[0+yych] & 64) {
- goto yy84;
- }
- goto yy6;
-yy53:
- YYDEBUG(53, *YYCURSOR);
- ++YYCURSOR;
- YYDEBUG(54, *YYCURSOR);
- YYCURSOR -= 1;
- yyleng = (size_t) YYCURSOR - (size_t) yytext;
-#line 119 "sapi/phpdbg/phpdbg_lexer.l"
- {
- return T_COLON;
-}
-#line 693 "sapi/phpdbg/phpdbg_lexer.c"
-yy55:
- YYDEBUG(55, *YYCURSOR);
- ++YYCURSOR;
- YYDEBUG(56, *YYCURSOR);
- yyleng = (size_t) YYCURSOR - (size_t) yytext;
-#line 115 "sapi/phpdbg/phpdbg_lexer.l"
- {
- return T_DCOLON;
-}
-#line 703 "sapi/phpdbg/phpdbg_lexer.c"
-yy57:
- YYDEBUG(57, *YYCURSOR);
- yyaccept = 0;
- YYMARKER = ++YYCURSOR;
- YYFILL(1);
- yych = *YYCURSOR;
- YYDEBUG(58, *YYCURSOR);
- if (yych <= ' ') {
- if (yych <= '\n') {
- if (yych <= 0x00) goto yy7;
- if (yych <= 0x08) goto yy57;
- goto yy7;
- } else {
- if (yych == '\r') goto yy7;
- if (yych <= 0x1F) goto yy57;
- goto yy7;
- }
- } else {
- if (yych <= '&') {
- if (yych <= '!') goto yy57;
- if (yych <= '#') goto yy7;
- goto yy57;
- } else {
- if (yych <= '\'') goto yy7;
- if (yych == ':') goto yy87;
- goto yy57;
- }
- }
-yy59:
- YYDEBUG(59, *YYCURSOR);
- yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- if (yych == 'S') goto yy88;
- if (yych == 's') goto yy88;
- goto yy6;
-yy60:
- YYDEBUG(60, *YYCURSOR);
- yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- if (yych == 'A') goto yy89;
- if (yych == 'a') goto yy89;
- goto yy6;
-yy61:
- YYDEBUG(61, *YYCURSOR);
- yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- if (yych == 'L') goto yy90;
- if (yych == 'l') goto yy90;
- goto yy6;
-yy62:
- YYDEBUG(62, *YYCURSOR);
- yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- if (yych <= '\f') {
- if (yych == '\t') goto yy91;
- goto yy6;
- } else {
- if (yych <= '\r') goto yy91;
- if (yych == ' ') goto yy91;
- goto yy6;
- }
-yy63:
- YYDEBUG(63, *YYCURSOR);
- yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- if (yych <= '\f') {
- if (yych <= 0x00) goto yy94;
- if (yych <= 0x08) goto yy6;
- if (yych <= '\n') goto yy94;
- goto yy6;
- } else {
- if (yych <= '\r') goto yy94;
- if (yych == ' ') goto yy94;
- goto yy6;
- }
-yy64:
- YYDEBUG(64, *YYCURSOR);
- yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- if (yych == 'F') goto yy63;
- if (yych == 'f') goto yy63;
- goto yy6;
-yy65:
- YYDEBUG(65, *YYCURSOR);
- yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- if (yych <= '\f') {
- if (yych <= 0x00) goto yy96;
- if (yych <= 0x08) goto yy6;
- if (yych <= '\n') goto yy96;
- goto yy6;
- } else {
- if (yych <= '\r') goto yy96;
- if (yych == ' ') goto yy96;
- goto yy6;
- }
-yy66:
- YYDEBUG(66, *YYCURSOR);
- yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- if (yych == 'U') goto yy98;
- if (yych == 'u') goto yy98;
- goto yy6;
-yy67:
- YYDEBUG(67, *YYCURSOR);
- yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- if (yych == 'S') goto yy65;
- if (yych == 's') goto yy65;
- goto yy6;
-yy68:
- YYDEBUG(68, *YYCURSOR);
- yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- if (yych == 'N') goto yy99;
- goto yy6;
-yy69:
- YYDEBUG(69, *YYCURSOR);
- yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- if (yych == 'n') goto yy100;
- goto yy6;
-yy70:
- YYDEBUG(70, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych != '/') goto yy12;
-yy71:
- YYDEBUG(71, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == '/') goto yy101;
- goto yy12;
-yy72:
- YYDEBUG(72, *YYCURSOR);
- yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- if (yych <= '\r') {
- if (yych <= 0x08) {
- if (yych <= 0x00) goto yy7;
- goto yy33;
- } else {
- if (yych <= '\n') goto yy7;
- if (yych <= '\f') goto yy33;
- goto yy7;
- }
- } else {
- if (yych <= ' ') {
- if (yych <= 0x1F) goto yy33;
- goto yy7;
- } else {
- if (yych == '#') goto yy7;
- goto yy33;
- }
- }
-yy73:
- YYDEBUG(73, *YYCURSOR);
- ++YYCURSOR;
- goto yy7;
-yy74:
- YYDEBUG(74, *YYCURSOR);
- ++YYCURSOR;
- YYFILL(1);
- yych = *YYCURSOR;
- if (yych == '"') goto yy37;
- if (yych == '\\') goto yy37;
- goto yy12;
-yy75:
- YYDEBUG(75, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == '/') goto yy103;
- goto yy38;
-yy76:
- YYDEBUG(76, *YYCURSOR);
- ++YYCURSOR;
- YYFILL(1);
- yych = *YYCURSOR;
- if (yych == '\'') goto yy47;
- if (yych == '\\') goto yy47;
- goto yy12;
-yy77:
- YYDEBUG(77, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == '/') goto yy104;
- goto yy48;
-yy78:
- YYDEBUG(78, *YYCURSOR);
- ++YYCURSOR;
- YYFILL(2);
- yych = *YYCURSOR;
- YYDEBUG(79, *YYCURSOR);
- if (yych <= ' ') {
- if (yych <= '\f') {
- if (yych == '\t') goto yy78;
- goto yy12;
- } else {
- if (yych <= '\r') goto yy78;
- if (yych <= 0x1F) goto yy12;
- goto yy78;
- }
- } else {
- if (yych <= '.') {
- if (yych <= ',') goto yy12;
- if (yych <= '-') goto yy105;
- goto yy106;
- } else {
- if (yych <= '/') goto yy12;
- if (yych <= '9') goto yy106;
- goto yy12;
- }
- }
-yy80:
- YYDEBUG(80, *YYCURSOR);
- yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- if (yych == '.') goto yy81;
- if (yych <= '/') goto yy6;
- if (yych >= ':') goto yy6;
-yy81:
- YYDEBUG(81, *YYCURSOR);
- yyaccept = 3;
- YYMARKER = ++YYCURSOR;
- YYFILL(3);
- yych = *YYCURSOR;
- YYDEBUG(82, *YYCURSOR);
- if (yych <= '"') {
- if (yych <= '\f') {
- if (yych <= 0x00) goto yy83;
- if (yych <= 0x08) goto yy5;
- if (yych >= '\v') goto yy5;
- } else {
- if (yych <= 0x1F) {
- if (yych >= 0x0E) goto yy5;
- } else {
- if (yych <= ' ') goto yy83;
- if (yych <= '!') goto yy5;
- goto yy32;
- }
- }
- } else {
- if (yych <= '-') {
- if (yych <= '#') goto yy83;
- if (yych == '\'') goto yy32;
- goto yy5;
- } else {
- if (yych <= '/') {
- if (yych <= '.') goto yy81;
- goto yy5;
- } else {
- if (yych <= '9') goto yy81;
- if (yych <= ':') goto yy34;
- goto yy5;
- }
- }
- }
-yy83:
- YYDEBUG(83, *YYCURSOR);
- yyleng = (size_t) YYCURSOR - (size_t) yytext;
-#line 93 "sapi/phpdbg/phpdbg_lexer.l"
- {
- char *text = yytext + 2;
- while (*++text < '0');
- yylval->num = atoi(text);
- return T_REQ_ID;
-}
-#line 967 "sapi/phpdbg/phpdbg_lexer.c"
-yy84:
- YYDEBUG(84, *YYCURSOR);
- yyaccept = 4;
- YYMARKER = ++YYCURSOR;
- YYFILL(3);
- yych = *YYCURSOR;
- YYDEBUG(85, *YYCURSOR);
- if (yybm[0+yych] & 64) {
- goto yy84;
- }
- if (yych <= ' ') {
- if (yych <= '\n') {
- if (yych <= 0x00) goto yy86;
- if (yych <= 0x08) goto yy5;
- } else {
- if (yych == '\r') goto yy86;
- if (yych <= 0x1F) goto yy5;
- }
- } else {
- if (yych <= '&') {
- if (yych <= '!') goto yy5;
- if (yych <= '"') goto yy32;
- if (yych >= '$') goto yy5;
- } else {
- if (yych <= '\'') goto yy32;
- if (yych <= '/') goto yy5;
- if (yych <= ':') goto yy34;
- goto yy5;
- }
- }
-yy86:
- YYDEBUG(86, *YYCURSOR);
- yyleng = (size_t) YYCURSOR - (size_t) yytext;
-#line 148 "sapi/phpdbg/phpdbg_lexer.l"
- {
- phpdbg_init_param(yylval, ADDR_PARAM);
- yylval->addr = strtoul(yytext, 0, 16);
- return T_ADDR;
-}
-#line 1007 "sapi/phpdbg/phpdbg_lexer.c"
-yy87:
- YYDEBUG(87, *YYCURSOR);
- ++YYCURSOR;
- YYFILL(1);
- yych = *YYCURSOR;
- if (yych == '\\') goto yy57;
- goto yy12;
-yy88:
- YYDEBUG(88, *YYCURSOR);
- yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- if (yych == 'A') goto yy108;
- if (yych == 'a') goto yy108;
- goto yy6;
-yy89:
- YYDEBUG(89, *YYCURSOR);
- yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- if (yych == 'B') goto yy109;
- if (yych == 'b') goto yy109;
- goto yy6;
-yy90:
- YYDEBUG(90, *YYCURSOR);
- yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- if (yych == 'S') goto yy110;
- if (yych == 's') goto yy110;
- goto yy6;
-yy91:
- YYDEBUG(91, *YYCURSOR);
- ++YYCURSOR;
- YYFILL(1);
- yych = *YYCURSOR;
- YYDEBUG(92, *YYCURSOR);
- if (yych <= '\f') {
- if (yych == '\t') goto yy91;
- } else {
- if (yych <= '\r') goto yy91;
- if (yych == ' ') goto yy91;
- }
- YYDEBUG(93, *YYCURSOR);
- yyleng = (size_t) YYCURSOR - (size_t) yytext;
-#line 100 "sapi/phpdbg/phpdbg_lexer.l"
- {
- YYSETCONDITION(RAW);
- phpdbg_init_param(yylval, EMPTY_PARAM);
- return T_IF;
-}
-#line 1056 "sapi/phpdbg/phpdbg_lexer.c"
-yy94:
- YYDEBUG(94, *YYCURSOR);
- ++YYCURSOR;
- YYDEBUG(95, *YYCURSOR);
- YYCURSOR -= 1;
- yyleng = (size_t) YYCURSOR - (size_t) yytext;
-#line 136 "sapi/phpdbg/phpdbg_lexer.l"
- {
- phpdbg_init_param(yylval, NUMERIC_PARAM);
- yylval->num = 0;
- return T_FALSY;
-}
-#line 1069 "sapi/phpdbg/phpdbg_lexer.c"
-yy96:
- YYDEBUG(96, *YYCURSOR);
- ++YYCURSOR;
- YYDEBUG(97, *YYCURSOR);
- YYCURSOR -= 1;
- yyleng = (size_t) YYCURSOR - (size_t) yytext;
-#line 130 "sapi/phpdbg/phpdbg_lexer.l"
- {
- phpdbg_init_param(yylval, NUMERIC_PARAM);
- yylval->num = 1;
- return T_TRUTHY;
-}
-#line 1082 "sapi/phpdbg/phpdbg_lexer.c"
-yy98:
- YYDEBUG(98, *YYCURSOR);
- yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- if (yych == 'E') goto yy65;
- if (yych == 'e') goto yy65;
- goto yy6;
-yy99:
- YYDEBUG(99, *YYCURSOR);
- yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- if (yych == 'D') goto yy111;
- goto yy6;
-yy100:
- YYDEBUG(100, *YYCURSOR);
- yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- if (yych == 'd') goto yy111;
- goto yy6;
-yy101:
- YYDEBUG(101, *YYCURSOR);
- ++YYCURSOR;
-yy102:
- YYDEBUG(102, *YYCURSOR);
- yyleng = (size_t) YYCURSOR - (size_t) yytext;
-#line 123 "sapi/phpdbg/phpdbg_lexer.l"
- {
- phpdbg_init_param(yylval, STR_PARAM);
- yylval->str = estrndup(yytext, yyleng);
- yylval->len = yyleng;
- return T_PROTO;
-}
-#line 1115 "sapi/phpdbg/phpdbg_lexer.c"
-yy103:
- YYDEBUG(103, *YYCURSOR);
- yyaccept = 5;
- yych = *(YYMARKER = ++YYCURSOR);
- if (yych <= 0x00) goto yy102;
- if (yych == '\n') goto yy102;
- goto yy38;
-yy104:
- YYDEBUG(104, *YYCURSOR);
- yyaccept = 5;
- yych = *(YYMARKER = ++YYCURSOR);
- if (yych <= 0x00) goto yy102;
- if (yych == '\n') goto yy102;
- goto yy48;
-yy105:
- YYDEBUG(105, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == '.') goto yy106;
- if (yych <= '/') goto yy12;
- if (yych >= ':') goto yy12;
-yy106:
- YYDEBUG(106, *YYCURSOR);
- ++YYCURSOR;
- YYFILL(1);
- yych = *YYCURSOR;
- YYDEBUG(107, *YYCURSOR);
- if (yych == '.') goto yy106;
- if (yych <= '/') goto yy83;
- if (yych <= '9') goto yy106;
- goto yy83;
-yy108:
- YYDEBUG(108, *YYCURSOR);
- yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- if (yych == 'B') goto yy112;
- if (yych == 'b') goto yy112;
- goto yy6;
-yy109:
- YYDEBUG(109, *YYCURSOR);
- yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- if (yych == 'L') goto yy113;
- if (yych == 'l') goto yy113;
- goto yy6;
-yy110:
- YYDEBUG(110, *YYCURSOR);
- yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- if (yych == 'E') goto yy63;
- if (yych == 'e') goto yy63;
- goto yy6;
-yy111:
- YYDEBUG(111, *YYCURSOR);
- yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- if (yych == '_') goto yy114;
- goto yy6;
-yy112:
- YYDEBUG(112, *YYCURSOR);
- yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- if (yych == 'L') goto yy115;
- if (yych == 'l') goto yy115;
- goto yy6;
-yy113:
- YYDEBUG(113, *YYCURSOR);
- yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- if (yych == 'E') goto yy116;
- if (yych == 'e') goto yy116;
- goto yy6;
-yy114:
- YYDEBUG(114, *YYCURSOR);
- yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- if (yybm[0+yych] & 128) {
- goto yy117;
- }
- goto yy6;
-yy115:
- YYDEBUG(115, *YYCURSOR);
- yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- if (yych == 'E') goto yy120;
- if (yych == 'e') goto yy120;
- goto yy6;
-yy116:
- YYDEBUG(116, *YYCURSOR);
- yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- if (yych == 'D') goto yy65;
- if (yych == 'd') goto yy65;
- goto yy6;
-yy117:
- YYDEBUG(117, *YYCURSOR);
- yyaccept = 6;
- YYMARKER = ++YYCURSOR;
- YYFILL(3);
- yych = *YYCURSOR;
- YYDEBUG(118, *YYCURSOR);
- if (yybm[0+yych] & 128) {
- goto yy117;
- }
- if (yych <= ' ') {
- if (yych <= '\n') {
- if (yych <= 0x00) goto yy119;
- if (yych <= 0x08) goto yy5;
- } else {
- if (yych == '\r') goto yy119;
- if (yych <= 0x1F) goto yy5;
- }
- } else {
- if (yych <= '&') {
- if (yych <= '!') goto yy5;
- if (yych <= '"') goto yy32;
- if (yych >= '$') goto yy5;
- } else {
- if (yych <= '\'') goto yy32;
- if (yych == ':') goto yy34;
- goto yy5;
- }
- }
-yy119:
- YYDEBUG(119, *YYCURSOR);
- yyleng = (size_t) YYCURSOR - (size_t) yytext;
-#line 154 "sapi/phpdbg/phpdbg_lexer.l"
- {
- phpdbg_init_param(yylval, OP_PARAM);
- yylval->str = estrndup(yytext, yyleng);
- yylval->len = yyleng;
- return T_OPCODE;
-}
-#line 1248 "sapi/phpdbg/phpdbg_lexer.c"
-yy120:
- YYDEBUG(120, *YYCURSOR);
- yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- if (yych == 'D') goto yy63;
- if (yych == 'd') goto yy63;
- goto yy6;
- }
-/* *********************************** */
-yyc_PRE_RAW:
- {
- static const unsigned char yybm[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 64, 0, 0, 0, 64, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 64, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 128, 0,
- 128, 128, 128, 128, 128, 128, 128, 128,
- 128, 128, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- };
- YYDEBUG(121, *YYCURSOR);
- YYFILL(2);
- yych = *YYCURSOR;
- if (yych <= '\r') {
- if (yych == '\t') goto yy125;
- if (yych >= '\r') goto yy125;
- } else {
- if (yych <= ' ') {
- if (yych >= ' ') goto yy126;
- } else {
- if (yych == '-') goto yy129;
- }
- }
- YYDEBUG(123, *YYCURSOR);
- ++YYCURSOR;
-yy124:
- YYDEBUG(124, *YYCURSOR);
- yyleng = (size_t) YYCURSOR - (size_t) yytext;
-#line 199 "sapi/phpdbg/phpdbg_lexer.l"
- {
- YYSETCONDITION(RAW);
-
- YYCURSOR = LEX(text);
- goto restart;
-}
-#line 1319 "sapi/phpdbg/phpdbg_lexer.c"
-yy125:
- YYDEBUG(125, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yybm[0+yych] & 64) {
- goto yy126;
- }
- goto yy124;
-yy126:
- YYDEBUG(126, *YYCURSOR);
- ++YYCURSOR;
- YYFILL(1);
- yych = *YYCURSOR;
- YYDEBUG(127, *YYCURSOR);
- if (yybm[0+yych] & 64) {
- goto yy126;
- }
- YYDEBUG(128, *YYCURSOR);
- yyleng = (size_t) YYCURSOR - (size_t) yytext;
-#line 175 "sapi/phpdbg/phpdbg_lexer.l"
- {
- /* ignore whitespace */
-
- goto restart;
-}
-#line 1344 "sapi/phpdbg/phpdbg_lexer.c"
-yy129:
- YYDEBUG(129, *YYCURSOR);
- yych = *(YYMARKER = ++YYCURSOR);
- if (yych != 'r') goto yy124;
-yy130:
- YYDEBUG(130, *YYCURSOR);
- ++YYCURSOR;
- YYFILL(2);
- yych = *YYCURSOR;
- YYDEBUG(131, *YYCURSOR);
- if (yybm[0+yych] & 128) {
- goto yy134;
- }
- if (yych <= '\r') {
- if (yych == '\t') goto yy130;
- if (yych >= '\r') goto yy130;
- } else {
- if (yych <= ' ') {
- if (yych >= ' ') goto yy130;
- } else {
- if (yych == '-') goto yy133;
- }
- }
-yy132:
- YYDEBUG(132, *YYCURSOR);
- YYCURSOR = YYMARKER;
- goto yy124;
-yy133:
- YYDEBUG(133, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yybm[0+yych] & 128) {
- goto yy134;
- }
- goto yy132;
-yy134:
- YYDEBUG(134, *YYCURSOR);
- ++YYCURSOR;
- YYFILL(1);
- yych = *YYCURSOR;
- YYDEBUG(135, *YYCURSOR);
- if (yybm[0+yych] & 128) {
- goto yy134;
- }
- YYDEBUG(136, *YYCURSOR);
- yyleng = (size_t) YYCURSOR - (size_t) yytext;
-#line 93 "sapi/phpdbg/phpdbg_lexer.l"
- {
- char *text = yytext + 2;
- while (*++text < '0');
- yylval->num = atoi(text);
- return T_REQ_ID;
-}
-#line 1397 "sapi/phpdbg/phpdbg_lexer.c"
- }
-/* *********************************** */
-yyc_RAW:
- {
- static const unsigned char yybm[] = {
- 0, 232, 232, 232, 232, 232, 232, 232,
- 232, 232, 0, 232, 232, 232, 232, 232,
- 232, 232, 232, 232, 232, 232, 232, 232,
- 232, 232, 232, 232, 232, 232, 232, 232,
- 232, 232, 64, 224, 232, 232, 232, 32,
- 232, 232, 232, 232, 232, 232, 232, 232,
- 232, 232, 232, 232, 232, 232, 232, 232,
- 232, 232, 232, 232, 232, 232, 232, 232,
- 232, 232, 232, 232, 232, 232, 232, 232,
- 232, 232, 232, 232, 232, 232, 232, 232,
- 232, 232, 232, 232, 232, 232, 232, 232,
- 232, 232, 232, 232, 16, 232, 232, 232,
- 232, 232, 232, 232, 232, 232, 232, 232,
- 232, 232, 232, 232, 232, 232, 232, 232,
- 232, 232, 232, 232, 232, 232, 232, 232,
- 232, 232, 232, 232, 232, 232, 232, 232,
- 232, 232, 232, 232, 232, 232, 232, 232,
- 232, 232, 232, 232, 232, 232, 232, 232,
- 232, 232, 232, 232, 232, 232, 232, 232,
- 232, 232, 232, 232, 232, 232, 232, 232,
- 232, 232, 232, 232, 232, 232, 232, 232,
- 232, 232, 232, 232, 232, 232, 232, 232,
- 232, 232, 232, 232, 232, 232, 232, 232,
- 232, 232, 232, 232, 232, 232, 232, 232,
- 232, 232, 232, 232, 232, 232, 232, 232,
- 232, 232, 232, 232, 232, 232, 232, 232,
- 232, 232, 232, 232, 232, 232, 232, 232,
- 232, 232, 232, 232, 232, 232, 232, 232,
- 232, 232, 232, 232, 232, 232, 232, 232,
- 232, 232, 232, 232, 232, 232, 232, 232,
- 232, 232, 232, 232, 232, 232, 232, 232,
- 232, 232, 232, 232, 232, 232, 232, 232,
- };
- YYDEBUG(137, *YYCURSOR);
- YYFILL(1);
- yych = *YYCURSOR;
- if (yybm[0+yych] & 8) {
- goto yy141;
- }
- if (yych <= '\n') goto yy139;
- if (yych <= '"') goto yy144;
- if (yych <= '#') goto yy146;
- if (yych <= '\'') goto yy148;
- goto yy149;
-yy139:
- YYDEBUG(139, *YYCURSOR);
- ++YYCURSOR;
- YYDEBUG(140, *YYCURSOR);
- yyleng = (size_t) YYCURSOR - (size_t) yytext;
-#line 89 "sapi/phpdbg/phpdbg_lexer.l"
- {
- return 0;
-}
-#line 1456 "sapi/phpdbg/phpdbg_lexer.c"
-yy141:
- YYDEBUG(141, *YYCURSOR);
- YYMARKER = ++YYCURSOR;
- YYFILL(1);
- yych = *YYCURSOR;
- YYDEBUG(142, *YYCURSOR);
- if (yybm[0+yych] & 8) {
- goto yy141;
- }
- if (yych <= '\n') goto yy143;
- if (yych <= '"') goto yy144;
- if (yych <= '#') goto yy143;
- if (yych <= '\'') goto yy148;
- goto yy149;
-yy143:
- YYDEBUG(143, *YYCURSOR);
- yyleng = (size_t) YYCURSOR - (size_t) yytext;
-#line 168 "sapi/phpdbg/phpdbg_lexer.l"
- {
- phpdbg_init_param(yylval, STR_PARAM);
- yylval->str = estrdup(yytext);
- yylval->len = yyleng;
- return T_INPUT;
-}
-#line 1481 "sapi/phpdbg/phpdbg_lexer.c"
-yy144:
- YYDEBUG(144, *YYCURSOR);
- ++YYCURSOR;
- YYFILL(1);
- yych = *YYCURSOR;
- if (yybm[0+yych] & 32) {
- goto yy151;
- }
- if (yych >= '#') goto yy153;
-yy145:
- YYDEBUG(145, *YYCURSOR);
- YYCURSOR = YYMARKER;
- goto yy143;
-yy146:
- YYDEBUG(146, *YYCURSOR);
- ++YYCURSOR;
- YYDEBUG(147, *YYCURSOR);
- yyleng = (size_t) YYCURSOR - (size_t) yytext;
-#line 110 "sapi/phpdbg/phpdbg_lexer.l"
- {
- YYSETCONDITION(INITIAL);
- return T_SEPARATOR;
-}
-#line 1505 "sapi/phpdbg/phpdbg_lexer.c"
-yy148:
- YYDEBUG(148, *YYCURSOR);
- ++YYCURSOR;
- YYFILL(1);
- yych = *YYCURSOR;
- if (yybm[0+yych] & 64) {
- goto yy155;
- }
- if (yych <= '\'') goto yy145;
- goto yy157;
-yy149:
- YYDEBUG(149, *YYCURSOR);
- ++YYCURSOR;
- YYFILL(1);
- yych = *YYCURSOR;
- YYDEBUG(150, *YYCURSOR);
- if (yybm[0+yych] & 16) {
- goto yy149;
- }
- if (yych <= '!') {
- if (yych <= 0x00) goto yy143;
- if (yych == '\n') goto yy143;
- goto yy141;
- } else {
- if (yych <= '"') goto yy159;
- if (yych == '\'') goto yy160;
- goto yy141;
- }
-yy151:
- YYDEBUG(151, *YYCURSOR);
- ++YYCURSOR;
- YYFILL(1);
- yych = *YYCURSOR;
- YYDEBUG(152, *YYCURSOR);
- if (yybm[0+yych] & 32) {
- goto yy151;
- }
- if (yych <= '\n') goto yy145;
- if (yych <= '"') goto yy141;
-yy153:
- YYDEBUG(153, *YYCURSOR);
- ++YYCURSOR;
- YYFILL(1);
- yych = *YYCURSOR;
- YYDEBUG(154, *YYCURSOR);
- if (yybm[0+yych] & 32) {
- goto yy151;
- }
- if (yych <= '\n') goto yy145;
- if (yych <= '"') goto yy161;
- goto yy153;
-yy155:
- YYDEBUG(155, *YYCURSOR);
- ++YYCURSOR;
- YYFILL(1);
- yych = *YYCURSOR;
- YYDEBUG(156, *YYCURSOR);
- if (yybm[0+yych] & 64) {
- goto yy155;
- }
- if (yych <= '\n') goto yy145;
- if (yych <= '\'') goto yy141;
-yy157:
- YYDEBUG(157, *YYCURSOR);
- ++YYCURSOR;
- YYFILL(1);
- yych = *YYCURSOR;
- YYDEBUG(158, *YYCURSOR);
- if (yybm[0+yych] & 64) {
- goto yy155;
- }
- if (yych <= '\n') goto yy145;
- if (yych <= '\'') goto yy163;
- goto yy157;
-yy159:
- YYDEBUG(159, *YYCURSOR);
- YYMARKER = ++YYCURSOR;
- YYFILL(1);
- yych = *YYCURSOR;
- if (yych <= '"') {
- if (yych <= '\t') {
- if (yych <= 0x00) goto yy143;
- goto yy161;
- } else {
- if (yych <= '\n') goto yy143;
- if (yych <= '!') goto yy161;
- goto yy144;
- }
- } else {
- if (yych <= '\'') {
- if (yych <= '#') goto yy151;
- if (yych <= '&') goto yy161;
- goto yy165;
- } else {
- if (yych == '\\') goto yy166;
- goto yy161;
- }
- }
-yy160:
- YYDEBUG(160, *YYCURSOR);
- YYMARKER = ++YYCURSOR;
- YYFILL(1);
- yych = *YYCURSOR;
- if (yych <= '"') {
- if (yych <= '\t') {
- if (yych <= 0x00) goto yy143;
- goto yy163;
- } else {
- if (yych <= '\n') goto yy143;
- if (yych <= '!') goto yy163;
- goto yy168;
- }
- } else {
- if (yych <= '\'') {
- if (yych <= '#') goto yy155;
- if (yych <= '&') goto yy163;
- goto yy148;
- } else {
- if (yych == '\\') goto yy169;
- goto yy163;
- }
- }
-yy161:
- YYDEBUG(161, *YYCURSOR);
- YYMARKER = ++YYCURSOR;
- YYFILL(1);
- yych = *YYCURSOR;
- YYDEBUG(162, *YYCURSOR);
- if (yych <= '"') {
- if (yych <= '\t') {
- if (yych <= 0x00) goto yy143;
- goto yy161;
- } else {
- if (yych <= '\n') goto yy143;
- if (yych <= '!') goto yy161;
- goto yy159;
- }
- } else {
- if (yych <= '\'') {
- if (yych <= '#') goto yy151;
- if (yych <= '&') goto yy161;
- goto yy165;
- } else {
- if (yych == '\\') goto yy166;
- goto yy161;
- }
- }
-yy163:
- YYDEBUG(163, *YYCURSOR);
- YYMARKER = ++YYCURSOR;
- YYFILL(1);
- yych = *YYCURSOR;
- YYDEBUG(164, *YYCURSOR);
- if (yych <= '"') {
- if (yych <= '\t') {
- if (yych <= 0x00) goto yy143;
- goto yy163;
- } else {
- if (yych <= '\n') goto yy143;
- if (yych <= '!') goto yy163;
- goto yy168;
- }
- } else {
- if (yych <= '\'') {
- if (yych <= '#') goto yy155;
- if (yych <= '&') goto yy163;
- goto yy160;
- } else {
- if (yych == '\\') goto yy169;
- goto yy163;
- }
- }
-yy165:
- YYDEBUG(165, *YYCURSOR);
- ++YYCURSOR;
- YYFILL(1);
- yych = *YYCURSOR;
- if (yybm[0+yych] & 128) {
- goto yy171;
- }
- if (yych <= '\n') goto yy145;
- if (yych <= '"') goto yy163;
- if (yych <= '\'') goto yy151;
- goto yy173;
-yy166:
- YYDEBUG(166, *YYCURSOR);
- ++YYCURSOR;
- YYFILL(1);
- yych = *YYCURSOR;
- YYDEBUG(167, *YYCURSOR);
- if (yych <= '&') {
- if (yych <= 0x00) goto yy143;
- if (yych == '\n') goto yy143;
- goto yy161;
- } else {
- if (yych <= '\'') goto yy175;
- if (yych == '\\') goto yy166;
- goto yy161;
- }
-yy168:
- YYDEBUG(168, *YYCURSOR);
- ++YYCURSOR;
- YYFILL(1);
- yych = *YYCURSOR;
- if (yybm[0+yych] & 128) {
- goto yy171;
- }
- if (yych <= '\n') goto yy145;
- if (yych <= '"') goto yy155;
- if (yych <= '\'') goto yy161;
- goto yy173;
-yy169:
- YYDEBUG(169, *YYCURSOR);
- ++YYCURSOR;
- YYFILL(1);
- yych = *YYCURSOR;
- YYDEBUG(170, *YYCURSOR);
- if (yych <= '!') {
- if (yych <= 0x00) goto yy143;
- if (yych == '\n') goto yy143;
- goto yy163;
- } else {
- if (yych <= '"') goto yy176;
- if (yych == '\\') goto yy169;
- goto yy163;
- }
-yy171:
- YYDEBUG(171, *YYCURSOR);
- ++YYCURSOR;
- YYFILL(1);
- yych = *YYCURSOR;
- YYDEBUG(172, *YYCURSOR);
- if (yybm[0+yych] & 128) {
- goto yy171;
- }
- if (yych <= '\n') goto yy145;
- if (yych <= '"') goto yy163;
- if (yych <= '\'') goto yy161;
-yy173:
- YYDEBUG(173, *YYCURSOR);
- ++YYCURSOR;
- YYFILL(1);
- yych = *YYCURSOR;
- YYDEBUG(174, *YYCURSOR);
- if (yybm[0+yych] & 128) {
- goto yy171;
- }
- if (yych <= '\n') goto yy145;
- if (yych <= '\'') goto yy177;
- goto yy173;
-yy175:
- YYDEBUG(175, *YYCURSOR);
- YYMARKER = ++YYCURSOR;
- YYFILL(1);
- yych = *YYCURSOR;
- if (yych <= '"') {
- if (yych <= '\t') {
- if (yych <= 0x00) goto yy143;
- goto yy177;
- } else {
- if (yych <= '\n') goto yy143;
- if (yych <= '!') goto yy177;
- }
- } else {
- if (yych <= '\'') {
- if (yych <= '#') goto yy171;
- if (yych <= '&') goto yy177;
- goto yy165;
- } else {
- if (yych == '\\') goto yy179;
- goto yy177;
- }
- }
-yy176:
- YYDEBUG(176, *YYCURSOR);
- YYMARKER = ++YYCURSOR;
- YYFILL(1);
- yych = *YYCURSOR;
- if (yych <= '"') {
- if (yych <= '\t') {
- if (yych <= 0x00) goto yy143;
- } else {
- if (yych <= '\n') goto yy143;
- if (yych >= '"') goto yy168;
- }
- } else {
- if (yych <= '\'') {
- if (yych <= '#') goto yy171;
- if (yych >= '\'') goto yy175;
- } else {
- if (yych == '\\') goto yy179;
- }
- }
-yy177:
- YYDEBUG(177, *YYCURSOR);
- YYMARKER = ++YYCURSOR;
- YYFILL(1);
- yych = *YYCURSOR;
- YYDEBUG(178, *YYCURSOR);
- if (yych <= '"') {
- if (yych <= '\t') {
- if (yych <= 0x00) goto yy143;
- goto yy177;
- } else {
- if (yych <= '\n') goto yy143;
- if (yych <= '!') goto yy177;
- goto yy176;
- }
- } else {
- if (yych <= '\'') {
- if (yych <= '#') goto yy171;
- if (yych <= '&') goto yy177;
- goto yy175;
- } else {
- if (yych != '\\') goto yy177;
- }
- }
-yy179:
- YYDEBUG(179, *YYCURSOR);
- ++YYCURSOR;
- YYFILL(1);
- yych = *YYCURSOR;
- YYDEBUG(180, *YYCURSOR);
- if (yych <= '\n') {
- if (yych <= 0x00) goto yy143;
- if (yych <= '\t') goto yy177;
- goto yy143;
- } else {
- if (yych == '\\') goto yy179;
- goto yy177;
- }
- }
-/* *********************************** */
-yyc_INITIAL:
- {
- static const unsigned char yybm[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 128, 0, 0, 0, 128, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 128, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- };
- YYDEBUG(181, *YYCURSOR);
- YYFILL(4);
- yych = *YYCURSOR;
- if (yych <= 'E') {
- if (yych <= '\r') {
- if (yych == '\t') goto yy185;
- if (yych >= '\r') goto yy185;
- } else {
- if (yych == ' ') goto yy186;
- if (yych >= 'E') goto yy189;
- }
- } else {
- if (yych <= 'd') {
- if (yych <= 'Q') goto yy183;
- if (yych <= 'R') goto yy190;
- if (yych <= 'S') goto yy191;
- } else {
- if (yych <= 'q') {
- if (yych <= 'e') goto yy189;
- } else {
- if (yych <= 'r') goto yy192;
- if (yych <= 's') goto yy191;
- }
- }
- }
-yy183:
- YYDEBUG(183, *YYCURSOR);
- ++YYCURSOR;
-yy184:
- YYDEBUG(184, *YYCURSOR);
- yyleng = (size_t) YYCURSOR - (size_t) yytext;
-#line 206 "sapi/phpdbg/phpdbg_lexer.l"
- {
- YYSETCONDITION(NORMAL);
-
- YYCURSOR = LEX(text);
- goto restart;
-}
-#line 1913 "sapi/phpdbg/phpdbg_lexer.c"
-yy185:
- YYDEBUG(185, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yybm[0+yych] & 128) {
- goto yy186;
- }
- goto yy184;
-yy186:
- YYDEBUG(186, *YYCURSOR);
- ++YYCURSOR;
- YYFILL(1);
- yych = *YYCURSOR;
- YYDEBUG(187, *YYCURSOR);
- if (yybm[0+yych] & 128) {
- goto yy186;
- }
- YYDEBUG(188, *YYCURSOR);
- yyleng = (size_t) YYCURSOR - (size_t) yytext;
-#line 175 "sapi/phpdbg/phpdbg_lexer.l"
- {
- /* ignore whitespace */
-
- goto restart;
-}
-#line 1938 "sapi/phpdbg/phpdbg_lexer.c"
-yy189:
- YYDEBUG(189, *YYCURSOR);
- yych = *(YYMARKER = ++YYCURSOR);
- if (yych == 'V') goto yy193;
- if (yych == 'v') goto yy193;
- goto yy184;
-yy190:
- YYDEBUG(190, *YYCURSOR);
- yych = *(YYMARKER = ++YYCURSOR);
- if (yych == 'U') goto yy195;
- if (yych == 'u') goto yy195;
- goto yy184;
-yy191:
- YYDEBUG(191, *YYCURSOR);
- yych = *(YYMARKER = ++YYCURSOR);
- if (yych == 'H') goto yy196;
- if (yych == 'h') goto yy196;
- goto yy184;
-yy192:
- YYDEBUG(192, *YYCURSOR);
- yych = *(YYMARKER = ++YYCURSOR);
- if (yych <= 0x1F) {
- if (yych <= '\t') {
- if (yych <= 0x08) goto yy184;
- goto yy197;
- } else {
- if (yych == '\r') goto yy197;
- goto yy184;
- }
- } else {
- if (yych <= 'U') {
- if (yych <= ' ') goto yy197;
- if (yych <= 'T') goto yy184;
- goto yy195;
- } else {
- if (yych == 'u') goto yy195;
- goto yy184;
- }
- }
-yy193:
- YYDEBUG(193, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych <= '\f') {
- if (yych == '\t') goto yy200;
- } else {
- if (yych <= '\r') goto yy200;
- if (yych == ' ') goto yy200;
- }
-yy194:
- YYDEBUG(194, *YYCURSOR);
- YYCURSOR = YYMARKER;
- goto yy184;
-yy195:
- YYDEBUG(195, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych == 'N') goto yy203;
- if (yych == 'n') goto yy203;
- goto yy194;
-yy196:
- YYDEBUG(196, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych <= '\f') {
- if (yych == '\t') goto yy204;
- goto yy194;
- } else {
- if (yych <= '\r') goto yy204;
- if (yych == ' ') goto yy204;
- goto yy194;
- }
-yy197:
- YYDEBUG(197, *YYCURSOR);
- ++YYCURSOR;
- YYFILL(1);
- yych = *YYCURSOR;
- YYDEBUG(198, *YYCURSOR);
- if (yych <= '\f') {
- if (yych == '\t') goto yy197;
- } else {
- if (yych <= '\r') goto yy197;
- if (yych == ' ') goto yy197;
- }
- YYDEBUG(199, *YYCURSOR);
- yyleng = (size_t) YYCURSOR - (size_t) yytext;
-#line 193 "sapi/phpdbg/phpdbg_lexer.l"
- {
- YYSETCONDITION(PRE_RAW);
- phpdbg_init_param(yylval, EMPTY_PARAM);
- return T_RUN;
-}
-#line 2028 "sapi/phpdbg/phpdbg_lexer.c"
-yy200:
- YYDEBUG(200, *YYCURSOR);
- ++YYCURSOR;
- YYFILL(1);
- yych = *YYCURSOR;
- YYDEBUG(201, *YYCURSOR);
- if (yych <= '\f') {
- if (yych == '\t') goto yy200;
- } else {
- if (yych <= '\r') goto yy200;
- if (yych == ' ') goto yy200;
- }
- YYDEBUG(202, *YYCURSOR);
- yyleng = (size_t) YYCURSOR - (size_t) yytext;
-#line 181 "sapi/phpdbg/phpdbg_lexer.l"
- {
- YYSETCONDITION(PRE_RAW);
- phpdbg_init_param(yylval, EMPTY_PARAM);
- return T_EVAL;
-}
-#line 2049 "sapi/phpdbg/phpdbg_lexer.c"
-yy203:
- YYDEBUG(203, *YYCURSOR);
- yych = *++YYCURSOR;
- if (yych <= '\f') {
- if (yych == '\t') goto yy197;
- goto yy194;
- } else {
- if (yych <= '\r') goto yy197;
- if (yych == ' ') goto yy197;
- goto yy194;
- }
-yy204:
- YYDEBUG(204, *YYCURSOR);
- ++YYCURSOR;
- YYFILL(1);
- yych = *YYCURSOR;
- YYDEBUG(205, *YYCURSOR);
- if (yych <= '\f') {
- if (yych == '\t') goto yy204;
- } else {
- if (yych <= '\r') goto yy204;
- if (yych == ' ') goto yy204;
- }
- YYDEBUG(206, *YYCURSOR);
- yyleng = (size_t) YYCURSOR - (size_t) yytext;
-#line 187 "sapi/phpdbg/phpdbg_lexer.l"
- {
- YYSETCONDITION(PRE_RAW);
- phpdbg_init_param(yylval, EMPTY_PARAM);
- return T_SHELL;
-}
-#line 2081 "sapi/phpdbg/phpdbg_lexer.c"
- }
-}
-#line 213 "sapi/phpdbg/phpdbg_lexer.l"
-
-}
diff --git a/sapi/phpdbg/phpdbg_lexer.h b/sapi/phpdbg/phpdbg_lexer.h
index 90f9963b3c..e1cc55ccf3 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) 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 aab641cb56..35b023aebe 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) 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..68cbee8c16 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) 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 b14a1c23e2..2d6bcd4f78 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) 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.h b/sapi/phpdbg/phpdbg_opcode.h
index 1bb861ed6f..f84862fbae 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) 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 545e1c951d..88981e5c6f 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) 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 |
@@ -114,13 +114,8 @@ typedef struct buf_area buffy;
*/
#define PREFIX( str, length, ch ) *--str = ch ; length++ ; has_prefix = YES
-
-#ifdef HAVE_LOCALE_H
#include <locale.h>
#define LCONV_DECIMAL_POINT (*lconv->decimal_point)
-#else
-#define LCONV_DECIMAL_POINT '.'
-#endif
#define NUL '\0'
#define S_NULL "(null)"
#define S_NULL_LEN 6
@@ -155,9 +150,7 @@ static int format_converter(register buffy *odp, const char *fmt, zend_bool esca
char num_buf[NUM_BUF_SIZE];
char char_buf[2]; /* for printing %% and %<unknown> */
-#ifdef HAVE_LOCALE_H
struct lconv *lconv = NULL;
-#endif
/*
* Flag variables
@@ -621,11 +614,10 @@ static int format_converter(register buffy *odp, const char *fmt, zend_bool esca
s = "INF";
s_len = 3;
} else {
-#ifdef HAVE_LOCALE_H
if (!lconv) {
lconv = localeconv();
}
-#endif
+
s = php_conv_fp((*fmt == 'f')?'F':*fmt, fp_num, alternate_form,
(adjust_precision == NO) ? FLOAT_DIGITS : precision,
(*fmt == 'f')?LCONV_DECIMAL_POINT:'.',
@@ -678,11 +670,10 @@ static int format_converter(register buffy *odp, const char *fmt, zend_bool esca
/*
* * We use &num_buf[ 1 ], so that we have room for the sign
*/
-#ifdef HAVE_LOCALE_H
if (!lconv) {
lconv = localeconv();
}
-#endif
+
s = php_gcvt(fp_num, precision, (*fmt=='H' || *fmt == 'k') ? '.' : LCONV_DECIMAL_POINT, (*fmt == 'G' || *fmt == 'H')?'E':'e', &num_buf[1]);
if (*s == '-') {
prefix_char = *s++;
@@ -1039,9 +1030,8 @@ static int phpdbg_process_print(int fd, int type, const char *tag, const char *m
} else {
phpdbg_mixed_write(fd, msg, msglen);
}
- return msglen;
}
- break;
+ return msglen;
/* no formatting on logging output */
case P_LOG:
@@ -1055,6 +1045,7 @@ static int phpdbg_process_print(int fd, int type, const char *tag, const char *m
}
}
break;
+ EMPTY_SWITCH_DEFAULT_CASE()
}
if (PHPDBG_G(flags) & PHPDBG_WRITE_XML) {
diff --git a/sapi/phpdbg/phpdbg_out.h b/sapi/phpdbg/phpdbg_out.h
index da5cb0c4f8..c6d05bf114 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) 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_parser.c b/sapi/phpdbg/phpdbg_parser.c
deleted file mode 100644
index ae7533abe4..0000000000
--- a/sapi/phpdbg/phpdbg_parser.c
+++ /dev/null
@@ -1,1953 +0,0 @@
-/* A Bison parser, made by GNU Bison 2.7.12-4996. */
-
-/* Bison implementation for Yacc-like parsers in C
-
- Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc.
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>. */
-
-/* As a special exception, you may create a larger work that contains
- part or all of the Bison parser skeleton and distribute that work
- under terms of your choice, so long as that work isn't itself a
- parser generator using the skeleton or a modified version thereof
- as a parser skeleton. Alternatively, if you modify or redistribute
- the parser skeleton itself, you may (at your option) remove this
- special exception, which will cause the skeleton and the resulting
- Bison output files to be licensed under the GNU General Public
- License without this special exception.
-
- This special exception was added by the Free Software Foundation in
- version 2.2 of Bison. */
-
-/* C LALR(1) parser skeleton written by Richard Stallman, by
- simplifying the original so-called "semantic" parser. */
-
-/* All symbols defined below should begin with yy or YY, to avoid
- infringing on user name space. This should be done even for local
- variables, as they might otherwise be expanded by user macros.
- There are some unavoidable exceptions within include files to
- define necessary library symbols; they are noted "INFRINGES ON
- USER NAME SPACE" below. */
-
-/* Identify Bison output. */
-#define YYBISON 1
-
-/* Bison version. */
-#define YYBISON_VERSION "2.7.12-4996"
-
-/* Skeleton name. */
-#define YYSKELETON_NAME "yacc.c"
-
-/* Pure parsers. */
-#define YYPURE 1
-
-/* Push parsers. */
-#define YYPUSH 0
-
-/* Pull parsers. */
-#define YYPULL 1
-
-
-/* Substitute the variable and function names. */
-#define yyparse phpdbg_parse
-#define yylex phpdbg_lex
-#define yyerror phpdbg_error
-#define yylval phpdbg_lval
-#define yychar phpdbg_char
-#define yydebug phpdbg_debug
-#define yynerrs phpdbg_nerrs
-
-/* Copy the first part of user declarations. */
-/* Line 371 of yacc.c */
-#line 1 "sapi/phpdbg/phpdbg_parser.y"
-
-
-/*
- * phpdbg_parser.y
- * (from php-src root)
- */
-
-#include "phpdbg.h"
-#include "phpdbg_cmd.h"
-#include "phpdbg_utils.h"
-#include "phpdbg_cmd.h"
-#include "phpdbg_prompt.h"
-
-#define YYSTYPE phpdbg_param_t
-
-#include "phpdbg_parser.h"
-#include "phpdbg_lexer.h"
-
-#undef yyerror
-static int yyerror(const char *msg);
-
-ZEND_EXTERN_MODULE_GLOBALS(phpdbg)
-
-#ifdef _MSC_VER
-#define YYMALLOC malloc
-#define YYFREE free
-#endif
-
-
-/* Line 371 of yacc.c */
-#line 107 "sapi/phpdbg/phpdbg_parser.c"
-
-# ifndef YY_NULL
-# if defined __cplusplus && 201103L <= __cplusplus
-# define YY_NULL nullptr
-# else
-# define YY_NULL 0
-# endif
-# endif
-
-/* Enabling verbose error messages. */
-#ifdef YYERROR_VERBOSE
-# undef YYERROR_VERBOSE
-# define YYERROR_VERBOSE 1
-#else
-# define YYERROR_VERBOSE 1
-#endif
-
-/* In a future release of Bison, this section will be replaced
- by #include "phpdbg_parser.h". */
-#ifndef YY_PHPDBG_SAPI_PHPDBG_PHPDBG_PARSER_H_INCLUDED
-# define YY_PHPDBG_SAPI_PHPDBG_PHPDBG_PARSER_H_INCLUDED
-/* Enabling traces. */
-#ifndef YYDEBUG
-# define YYDEBUG 0
-#endif
-#if YYDEBUG
-extern int phpdbg_debug;
-#endif
-/* "%code requires" blocks. */
-/* Line 387 of yacc.c */
-#line 36 "sapi/phpdbg/phpdbg_parser.y"
-
-#include "phpdbg.h"
-#ifndef YY_TYPEDEF_YY_SCANNER_T
-#define YY_TYPEDEF_YY_SCANNER_T
-typedef void* yyscan_t;
-#endif
-
-
-/* Line 387 of yacc.c */
-#line 148 "sapi/phpdbg/phpdbg_parser.c"
-
-/* Tokens. */
-#ifndef YYTOKENTYPE
-# define YYTOKENTYPE
- /* Put the tokens into the symbol table, so that GDB and other debuggers
- know about them. */
- enum yytokentype {
- T_EVAL = 258,
- T_RUN = 259,
- T_SHELL = 260,
- T_IF = 261,
- T_TRUTHY = 262,
- T_FALSY = 263,
- T_STRING = 264,
- T_COLON = 265,
- T_DCOLON = 266,
- T_POUND = 267,
- T_SEPARATOR = 268,
- T_PROTO = 269,
- T_DIGITS = 270,
- T_LITERAL = 271,
- T_ADDR = 272,
- T_OPCODE = 273,
- T_ID = 274,
- T_INPUT = 275,
- T_UNEXPECTED = 276,
- T_REQ_ID = 277
- };
-#endif
-/* Tokens. */
-#define T_EVAL 258
-#define T_RUN 259
-#define T_SHELL 260
-#define T_IF 261
-#define T_TRUTHY 262
-#define T_FALSY 263
-#define T_STRING 264
-#define T_COLON 265
-#define T_DCOLON 266
-#define T_POUND 267
-#define T_SEPARATOR 268
-#define T_PROTO 269
-#define T_DIGITS 270
-#define T_LITERAL 271
-#define T_ADDR 272
-#define T_OPCODE 273
-#define T_ID 274
-#define T_INPUT 275
-#define T_UNEXPECTED 276
-#define T_REQ_ID 277
-
-
-
-#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
-typedef int YYSTYPE;
-# define YYSTYPE_IS_TRIVIAL 1
-# define yystype YYSTYPE /* obsolescent; will be withdrawn */
-# define YYSTYPE_IS_DECLARED 1
-#endif
-
-
-#ifdef YYPARSE_PARAM
-#if defined __STDC__ || defined __cplusplus
-int phpdbg_parse (void *YYPARSE_PARAM);
-#else
-int phpdbg_parse ();
-#endif
-#else /* ! YYPARSE_PARAM */
-#if defined __STDC__ || defined __cplusplus
-int phpdbg_parse (void);
-#else
-int phpdbg_parse ();
-#endif
-#endif /* ! YYPARSE_PARAM */
-
-#endif /* !YY_PHPDBG_SAPI_PHPDBG_PHPDBG_PARSER_H_INCLUDED */
-
-/* Copy the second part of user declarations. */
-
-/* Line 390 of yacc.c */
-#line 229 "sapi/phpdbg/phpdbg_parser.c"
-
-#ifdef short
-# undef short
-#endif
-
-#ifdef YYTYPE_UINT8
-typedef YYTYPE_UINT8 yytype_uint8;
-#else
-typedef unsigned char yytype_uint8;
-#endif
-
-#ifdef YYTYPE_INT8
-typedef YYTYPE_INT8 yytype_int8;
-#elif (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
-typedef signed char yytype_int8;
-#else
-typedef short int yytype_int8;
-#endif
-
-#ifdef YYTYPE_UINT16
-typedef YYTYPE_UINT16 yytype_uint16;
-#else
-typedef unsigned short int yytype_uint16;
-#endif
-
-#ifdef YYTYPE_INT16
-typedef YYTYPE_INT16 yytype_int16;
-#else
-typedef short int yytype_int16;
-#endif
-
-#ifndef YYSIZE_T
-# ifdef __SIZE_TYPE__
-# define YYSIZE_T __SIZE_TYPE__
-# elif defined size_t
-# define YYSIZE_T size_t
-# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
-# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
-# define YYSIZE_T size_t
-# else
-# define YYSIZE_T unsigned int
-# endif
-#endif
-
-#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
-
-#ifndef YY_
-# if defined YYENABLE_NLS && YYENABLE_NLS
-# if ENABLE_NLS
-# include <libintl.h> /* INFRINGES ON USER NAME SPACE */
-# define YY_(Msgid) dgettext ("bison-runtime", Msgid)
-# endif
-# endif
-# ifndef YY_
-# define YY_(Msgid) Msgid
-# endif
-#endif
-
-#ifndef __attribute__
-/* This feature is available in gcc versions 2.5 and later. */
-# if (! defined __GNUC__ || __GNUC__ < 2 \
- || (__GNUC__ == 2 && __GNUC_MINOR__ < 5))
-# define __attribute__(Spec) /* empty */
-# endif
-#endif
-
-/* Suppress unused-variable warnings by "using" E. */
-#if ! defined lint || defined __GNUC__
-# define YYUSE(E) ((void) (E))
-#else
-# define YYUSE(E) /* empty */
-#endif
-
-
-/* Identity function, used to suppress warnings about constant conditions. */
-#ifndef lint
-# define YYID(N) (N)
-#else
-#if (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
-static int
-YYID (int yyi)
-#else
-static int
-YYID (yyi)
- int yyi;
-#endif
-{
- return yyi;
-}
-#endif
-
-#if ! defined yyoverflow || YYERROR_VERBOSE
-
-/* The parser invokes alloca or malloc; define the necessary symbols. */
-
-# ifdef YYSTACK_USE_ALLOCA
-# if YYSTACK_USE_ALLOCA
-# ifdef __GNUC__
-# define YYSTACK_ALLOC __builtin_alloca
-# elif defined __BUILTIN_VA_ARG_INCR
-# include <alloca.h> /* INFRINGES ON USER NAME SPACE */
-# elif defined _AIX
-# define YYSTACK_ALLOC __alloca
-# elif defined _MSC_VER
-# include <malloc.h> /* INFRINGES ON USER NAME SPACE */
-# define alloca _alloca
-# else
-# define YYSTACK_ALLOC alloca
-# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
-# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
- /* Use EXIT_SUCCESS as a witness for stdlib.h. */
-# ifndef EXIT_SUCCESS
-# define EXIT_SUCCESS 0
-# endif
-# endif
-# endif
-# endif
-# endif
-
-# ifdef YYSTACK_ALLOC
- /* Pacify GCC's `empty if-body' warning. */
-# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
-# ifndef YYSTACK_ALLOC_MAXIMUM
- /* The OS might guarantee only one guard page at the bottom of the stack,
- and a page size can be as small as 4096 bytes. So we cannot safely
- invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
- to allow for a few compiler-allocated temporary stack slots. */
-# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
-# endif
-# else
-# define YYSTACK_ALLOC YYMALLOC
-# define YYSTACK_FREE YYFREE
-# ifndef YYSTACK_ALLOC_MAXIMUM
-# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
-# endif
-# if (defined __cplusplus && ! defined EXIT_SUCCESS \
- && ! ((defined YYMALLOC || defined malloc) \
- && (defined YYFREE || defined free)))
-# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
-# ifndef EXIT_SUCCESS
-# define EXIT_SUCCESS 0
-# endif
-# endif
-# ifndef YYMALLOC
-# define YYMALLOC malloc
-# if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
-void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
-# endif
-# endif
-# ifndef YYFREE
-# define YYFREE free
-# if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
-void free (void *); /* INFRINGES ON USER NAME SPACE */
-# endif
-# endif
-# endif
-#endif /* ! defined yyoverflow || YYERROR_VERBOSE */
-
-
-#if (! defined yyoverflow \
- && (! defined __cplusplus \
- || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
-
-/* A type that is properly aligned for any stack member. */
-union yyalloc
-{
- yytype_int16 yyss_alloc;
- YYSTYPE yyvs_alloc;
-};
-
-/* The size of the maximum gap between one aligned stack and the next. */
-# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
-
-/* The size of an array large to enough to hold all stacks, each with
- N elements. */
-# define YYSTACK_BYTES(N) \
- ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
- + YYSTACK_GAP_MAXIMUM)
-
-# define YYCOPY_NEEDED 1
-
-/* Relocate STACK from its old location to the new one. The
- local variables YYSIZE and YYSTACKSIZE give the old and new number of
- elements in the stack, and YYPTR gives the new location of the
- stack. Advance YYPTR to a properly aligned location for the next
- stack. */
-# define YYSTACK_RELOCATE(Stack_alloc, Stack) \
- do \
- { \
- YYSIZE_T yynewbytes; \
- YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
- Stack = &yyptr->Stack_alloc; \
- yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
- yyptr += yynewbytes / sizeof (*yyptr); \
- } \
- while (YYID (0))
-
-#endif
-
-#if defined YYCOPY_NEEDED && YYCOPY_NEEDED
-/* Copy COUNT objects from SRC to DST. The source and destination do
- not overlap. */
-# ifndef YYCOPY
-# if defined __GNUC__ && 1 < __GNUC__
-# define YYCOPY(Dst, Src, Count) \
- __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
-# else
-# define YYCOPY(Dst, Src, Count) \
- do \
- { \
- YYSIZE_T yyi; \
- for (yyi = 0; yyi < (Count); yyi++) \
- (Dst)[yyi] = (Src)[yyi]; \
- } \
- while (YYID (0))
-# endif
-# endif
-#endif /* !YYCOPY_NEEDED */
-
-/* YYFINAL -- State number of the termination state. */
-#define YYFINAL 27
-/* YYLAST -- Last index in YYTABLE. */
-#define YYLAST 50
-
-/* YYNTOKENS -- Number of terminals. */
-#define YYNTOKENS 23
-/* YYNNTS -- Number of nonterminals. */
-#define YYNNTS 7
-/* YYNRULES -- Number of rules. */
-#define YYNRULES 30
-/* YYNRULES -- Number of states. */
-#define YYNSTATES 46
-
-/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
-#define YYUNDEFTOK 2
-#define YYMAXUTOK 277
-
-#define YYTRANSLATE(YYX) \
- ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
-
-/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
-static const yytype_uint8 yytranslate[] =
-{
- 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
- 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
- 15, 16, 17, 18, 19, 20, 21, 22
-};
-
-#if YYDEBUG
-/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
- YYRHS. */
-static const yytype_uint8 yyprhs[] =
-{
- 0, 0, 3, 5, 9, 10, 12, 14, 16, 19,
- 22, 26, 31, 36, 42, 46, 52, 56, 59, 61,
- 63, 65, 67, 69, 71, 73, 75, 76, 80, 84,
- 87
-};
-
-/* YYRHS -- A `-1'-separated list of the rules' RHS. */
-static const yytype_int8 yyrhs[] =
-{
- 24, 0, -1, 25, -1, 24, 13, 25, -1, -1,
- 26, -1, 29, -1, 27, -1, 26, 27, -1, 26,
- 28, -1, 19, 10, 15, -1, 19, 10, 12, 15,
- -1, 14, 19, 10, 15, -1, 14, 19, 10, 12,
- 15, -1, 19, 11, 19, -1, 19, 11, 19, 12,
- 15, -1, 19, 12, 15, -1, 6, 20, -1, 18,
- -1, 17, -1, 16, -1, 7, -1, 8, -1, 15,
- -1, 19, -1, 22, -1, -1, 3, 28, 20, -1,
- 5, 28, 20, -1, 4, 28, -1, 4, 28, 20,
- -1
-};
-
-/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
-static const yytype_uint8 yyrline[] =
-{
- 0, 71, 71, 72, 73, 77, 78, 82, 83, 84,
- 88, 93, 98, 108, 118, 123, 129, 135, 140, 141,
- 142, 143, 144, 145, 146, 150, 151, 155, 160, 165,
- 169
-};
-#endif
-
-#if YYDEBUG || YYERROR_VERBOSE || 1
-/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
- First, the terminals, then, starting at YYNTOKENS, nonterminals. */
-static const char *const yytname[] =
-{
- "$end", "error", "$undefined", "\"eval\"", "\"run\"", "\"shell\"",
- "\"if (condition)\"", "\"truthy (true, on, yes or enabled)\"",
- "\"falsy (false, off, no or disabled)\"",
- "\"string (some input, perhaps)\"", "\": (colon)\"",
- "\":: (double colon)\"", "\"# (pound sign followed by digits)\"",
- "\"# (pound sign)\"", "\"protocol (file://)\"", "\"digits (numbers)\"",
- "\"literal (string)\"", "\"address\"", "\"opcode\"",
- "\"identifier (command or function name)\"",
- "\"input (input string or data)\"", "\"input\"",
- "\"request id (-r %d)\"", "$accept", "input", "command", "parameters",
- "parameter", "req_id", "full_expression", YY_NULL
-};
-#endif
-
-# ifdef YYPRINT
-/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
- token YYLEX-NUM. */
-static const yytype_uint16 yytoknum[] =
-{
- 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
- 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
- 275, 276, 277
-};
-# endif
-
-/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
-static const yytype_uint8 yyr1[] =
-{
- 0, 23, 24, 24, 24, 25, 25, 26, 26, 26,
- 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
- 27, 27, 27, 27, 27, 28, 28, 29, 29, 29,
- 29
-};
-
-/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
-static const yytype_uint8 yyr2[] =
-{
- 0, 2, 1, 3, 0, 1, 1, 1, 2, 2,
- 3, 4, 4, 5, 3, 5, 3, 2, 1, 1,
- 1, 1, 1, 1, 1, 1, 0, 3, 3, 2,
- 3
-};
-
-/* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM.
- Performed when YYTABLE doesn't specify something else to do. Zero
- means the default is an error. */
-static const yytype_uint8 yydefact[] =
-{
- 4, 26, 26, 26, 0, 21, 22, 0, 23, 20,
- 19, 18, 24, 0, 2, 5, 7, 6, 25, 0,
- 29, 0, 17, 0, 0, 0, 0, 1, 0, 8,
- 9, 27, 30, 28, 0, 0, 10, 14, 16, 3,
- 0, 12, 11, 0, 13, 15
-};
-
-/* YYDEFGOTO[NTERM-NUM]. */
-static const yytype_int8 yydefgoto[] =
-{
- -1, 13, 14, 15, 16, 19, 17
-};
-
-/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
- STATE-NUM. */
-#define YYPACT_NINF -17
-static const yytype_int8 yypact[] =
-{
- -3, -16, -16, -16, -10, -17, -17, 2, -17, -17,
- -17, -17, 26, 9, -17, 11, -17, -17, -17, 3,
- 4, 21, -17, 29, 19, 23, 25, -17, -3, -17,
- -17, -17, -17, -17, 20, 28, -17, 32, -17, -17,
- 30, -17, -17, 31, -17, -17
-};
-
-/* YYPGOTO[NTERM-NUM]. */
-static const yytype_int8 yypgoto[] =
-{
- -17, -17, 22, -17, 33, 5, -17
-};
-
-/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
- positive, shift that token. If negative, reduce the rule which
- number is the opposite. If YYTABLE_NINF, syntax error. */
-#define YYTABLE_NINF -1
-static const yytype_uint8 yytable[] =
-{
- 1, 2, 3, 4, 5, 6, 18, 20, 21, 27,
- 22, 7, 8, 9, 10, 11, 12, 4, 5, 6,
- 30, 23, 28, 31, 32, 7, 8, 9, 10, 11,
- 12, 35, 40, 18, 36, 41, 24, 25, 26, 34,
- 38, 33, 37, 42, 43, 44, 45, 0, 29, 0,
- 39
-};
-
-#define yypact_value_is_default(Yystate) \
- (!!((Yystate) == (-17)))
-
-#define yytable_value_is_error(Yytable_value) \
- YYID (0)
-
-static const yytype_int8 yycheck[] =
-{
- 3, 4, 5, 6, 7, 8, 22, 2, 3, 0,
- 20, 14, 15, 16, 17, 18, 19, 6, 7, 8,
- 15, 19, 13, 20, 20, 14, 15, 16, 17, 18,
- 19, 12, 12, 22, 15, 15, 10, 11, 12, 10,
- 15, 20, 19, 15, 12, 15, 15, -1, 15, -1,
- 28
-};
-
-/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
- symbol of state STATE-NUM. */
-static const yytype_uint8 yystos[] =
-{
- 0, 3, 4, 5, 6, 7, 8, 14, 15, 16,
- 17, 18, 19, 24, 25, 26, 27, 29, 22, 28,
- 28, 28, 20, 19, 10, 11, 12, 0, 13, 27,
- 28, 20, 20, 20, 10, 12, 15, 19, 15, 25,
- 12, 15, 15, 12, 15, 15
-};
-
-#define yyerrok (yyerrstatus = 0)
-#define yyclearin (yychar = YYEMPTY)
-#define YYEMPTY (-2)
-#define YYEOF 0
-
-#define YYACCEPT goto yyacceptlab
-#define YYABORT goto yyabortlab
-#define YYERROR goto yyerrorlab
-
-
-/* Like YYERROR except do call yyerror. This remains here temporarily
- to ease the transition to the new meaning of YYERROR, for GCC.
- Once GCC version 2 has supplanted version 1, this can go. However,
- YYFAIL appears to be in use. Nevertheless, it is formally deprecated
- in Bison 2.4.2's NEWS entry, where a plan to phase it out is
- discussed. */
-
-#define YYFAIL goto yyerrlab
-#if defined YYFAIL
- /* This is here to suppress warnings from the GCC cpp's
- -Wunused-macros. Normally we don't worry about that warning, but
- some users do, and we want to make it easy for users to remove
- YYFAIL uses, which will produce warnings from Bison 2.5. */
-#endif
-
-#define YYRECOVERING() (!!yyerrstatus)
-
-#define YYBACKUP(Token, Value) \
-do \
- if (yychar == YYEMPTY) \
- { \
- yychar = (Token); \
- yylval = (Value); \
- YYPOPSTACK (yylen); \
- yystate = *yyssp; \
- goto yybackup; \
- } \
- else \
- { \
- yyerror (YY_("syntax error: cannot back up")); \
- YYERROR; \
- } \
-while (YYID (0))
-
-/* Error token number */
-#define YYTERROR 1
-#define YYERRCODE 256
-
-
-/* This macro is provided for backward compatibility. */
-#ifndef YY_LOCATION_PRINT
-# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
-#endif
-
-
-/* YYLEX -- calling `yylex' with the right arguments. */
-#ifdef YYLEX_PARAM
-# define YYLEX yylex (&yylval, YYLEX_PARAM)
-#else
-# define YYLEX yylex (&yylval)
-#endif
-
-/* Enable debugging if requested. */
-#if YYDEBUG
-
-# ifndef YYFPRINTF
-# include <stdio.h> /* INFRINGES ON USER NAME SPACE */
-# define YYFPRINTF fprintf
-# endif
-
-# define YYDPRINTF(Args) \
-do { \
- if (yydebug) \
- YYFPRINTF Args; \
-} while (YYID (0))
-
-# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
-do { \
- if (yydebug) \
- { \
- YYFPRINTF (stderr, "%s ", Title); \
- yy_symbol_print (stderr, \
- Type, Value); \
- YYFPRINTF (stderr, "\n"); \
- } \
-} while (YYID (0))
-
-
-/*--------------------------------.
-| Print this symbol on YYOUTPUT. |
-`--------------------------------*/
-
-/*ARGSUSED*/
-#if (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
-static void
-yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
-#else
-static void
-yy_symbol_value_print (yyoutput, yytype, yyvaluep)
- FILE *yyoutput;
- int yytype;
- YYSTYPE const * const yyvaluep;
-#endif
-{
- FILE *yyo = yyoutput;
- YYUSE (yyo);
- if (!yyvaluep)
- return;
-# ifdef YYPRINT
- if (yytype < YYNTOKENS)
- YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
-# else
- YYUSE (yyoutput);
-# endif
- YYUSE (yytype);
-}
-
-
-/*--------------------------------.
-| Print this symbol on YYOUTPUT. |
-`--------------------------------*/
-
-#if (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
-static void
-yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
-#else
-static void
-yy_symbol_print (yyoutput, yytype, yyvaluep)
- FILE *yyoutput;
- int yytype;
- YYSTYPE const * const yyvaluep;
-#endif
-{
- if (yytype < YYNTOKENS)
- YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
- else
- YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
-
- yy_symbol_value_print (yyoutput, yytype, yyvaluep);
- YYFPRINTF (yyoutput, ")");
-}
-
-/*------------------------------------------------------------------.
-| yy_stack_print -- Print the state stack from its BOTTOM up to its |
-| TOP (included). |
-`------------------------------------------------------------------*/
-
-#if (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
-static void
-yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
-#else
-static void
-yy_stack_print (yybottom, yytop)
- yytype_int16 *yybottom;
- yytype_int16 *yytop;
-#endif
-{
- YYFPRINTF (stderr, "Stack now");
- for (; yybottom <= yytop; yybottom++)
- {
- int yybot = *yybottom;
- YYFPRINTF (stderr, " %d", yybot);
- }
- YYFPRINTF (stderr, "\n");
-}
-
-# define YY_STACK_PRINT(Bottom, Top) \
-do { \
- if (yydebug) \
- yy_stack_print ((Bottom), (Top)); \
-} while (YYID (0))
-
-
-/*------------------------------------------------.
-| Report that the YYRULE is going to be reduced. |
-`------------------------------------------------*/
-
-#if (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
-static void
-yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
-#else
-static void
-yy_reduce_print (yyvsp, yyrule)
- YYSTYPE *yyvsp;
- int yyrule;
-#endif
-{
- int yynrhs = yyr2[yyrule];
- int yyi;
- unsigned long int yylno = yyrline[yyrule];
- YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
- yyrule - 1, yylno);
- /* The symbols being reduced. */
- for (yyi = 0; yyi < yynrhs; yyi++)
- {
- YYFPRINTF (stderr, " $%d = ", yyi + 1);
- yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
- &(yyvsp[(yyi + 1) - (yynrhs)])
- );
- YYFPRINTF (stderr, "\n");
- }
-}
-
-# define YY_REDUCE_PRINT(Rule) \
-do { \
- if (yydebug) \
- yy_reduce_print (yyvsp, Rule); \
-} while (YYID (0))
-
-/* Nonzero means print parse trace. It is left uninitialized so that
- multiple parsers can coexist. */
-int yydebug;
-#else /* !YYDEBUG */
-# define YYDPRINTF(Args)
-# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
-# define YY_STACK_PRINT(Bottom, Top)
-# define YY_REDUCE_PRINT(Rule)
-#endif /* !YYDEBUG */
-
-
-/* YYINITDEPTH -- initial size of the parser's stacks. */
-#ifndef YYINITDEPTH
-# define YYINITDEPTH 200
-#endif
-
-/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
- if the built-in stack extension method is used).
-
- Do not make this value too large; the results are undefined if
- YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
- evaluated with infinite-precision integer arithmetic. */
-
-#ifndef YYMAXDEPTH
-# define YYMAXDEPTH 10000
-#endif
-
-
-#if YYERROR_VERBOSE
-
-# ifndef yystrlen
-# if defined __GLIBC__ && defined _STRING_H
-# define yystrlen strlen
-# else
-/* Return the length of YYSTR. */
-#if (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
-static YYSIZE_T
-yystrlen (const char *yystr)
-#else
-static YYSIZE_T
-yystrlen (yystr)
- const char *yystr;
-#endif
-{
- YYSIZE_T yylen;
- for (yylen = 0; yystr[yylen]; yylen++)
- continue;
- return yylen;
-}
-# endif
-# endif
-
-# ifndef yystpcpy
-# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
-# define yystpcpy stpcpy
-# else
-/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
- YYDEST. */
-#if (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
-static char *
-yystpcpy (char *yydest, const char *yysrc)
-#else
-static char *
-yystpcpy (yydest, yysrc)
- char *yydest;
- const char *yysrc;
-#endif
-{
- char *yyd = yydest;
- const char *yys = yysrc;
-
- while ((*yyd++ = *yys++) != '\0')
- continue;
-
- return yyd - 1;
-}
-# endif
-# endif
-
-# ifndef yytnamerr
-/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
- quotes and backslashes, so that it's suitable for yyerror. The
- heuristic is that double-quoting is unnecessary unless the string
- contains an apostrophe, a comma, or backslash (other than
- backslash-backslash). YYSTR is taken from yytname. If YYRES is
- null, do not copy; instead, return the length of what the result
- would have been. */
-static YYSIZE_T
-yytnamerr (char *yyres, const char *yystr)
-{
- if (*yystr == '"')
- {
- YYSIZE_T yyn = 0;
- char const *yyp = yystr;
-
- for (;;)
- switch (*++yyp)
- {
- case '\'':
- case ',':
- goto do_not_strip_quotes;
-
- case '\\':
- if (*++yyp != '\\')
- goto do_not_strip_quotes;
- /* Fall through. */
- default:
- if (yyres)
- yyres[yyn] = *yyp;
- yyn++;
- break;
-
- case '"':
- if (yyres)
- yyres[yyn] = '\0';
- return yyn;
- }
- do_not_strip_quotes: ;
- }
-
- if (! yyres)
- return yystrlen (yystr);
-
- return yystpcpy (yyres, yystr) - yyres;
-}
-# endif
-
-/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
- about the unexpected token YYTOKEN for the state stack whose top is
- YYSSP.
-
- Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
- not large enough to hold the message. In that case, also set
- *YYMSG_ALLOC to the required number of bytes. Return 2 if the
- required number of bytes is too large to store. */
-static int
-yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
- yytype_int16 *yyssp, int yytoken)
-{
- YYSIZE_T yysize0 = yytnamerr (YY_NULL, yytname[yytoken]);
- YYSIZE_T yysize = yysize0;
- enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
- /* Internationalized format string. */
- const char *yyformat = YY_NULL;
- /* Arguments of yyformat. */
- char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
- /* Number of reported tokens (one for the "unexpected", one per
- "expected"). */
- int yycount = 0;
-
- /* There are many possibilities here to consider:
- - Assume YYFAIL is not used. It's too flawed to consider. See
- <http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html>
- for details. YYERROR is fine as it does not invoke this
- function.
- - If this state is a consistent state with a default action, then
- the only way this function was invoked is if the default action
- is an error action. In that case, don't check for expected
- tokens because there are none.
- - The only way there can be no lookahead present (in yychar) is if
- this state is a consistent state with a default action. Thus,
- detecting the absence of a lookahead is sufficient to determine
- that there is no unexpected or expected token to report. In that
- case, just report a simple "syntax error".
- - Don't assume there isn't a lookahead just because this state is a
- consistent state with a default action. There might have been a
- previous inconsistent state, consistent state with a non-default
- action, or user semantic action that manipulated yychar.
- - Of course, the expected token list depends on states to have
- correct lookahead information, and it depends on the parser not
- to perform extra reductions after fetching a lookahead from the
- scanner and before detecting a syntax error. Thus, state merging
- (from LALR or IELR) and default reductions corrupt the expected
- token list. However, the list is correct for canonical LR with
- one exception: it will still contain any token that will not be
- accepted due to an error action in a later state.
- */
- if (yytoken != YYEMPTY)
- {
- int yyn = yypact[*yyssp];
- yyarg[yycount++] = yytname[yytoken];
- if (!yypact_value_is_default (yyn))
- {
- /* Start YYX at -YYN if negative to avoid negative indexes in
- YYCHECK. In other words, skip the first -YYN actions for
- this state because they are default actions. */
- int yyxbegin = yyn < 0 ? -yyn : 0;
- /* Stay within bounds of both yycheck and yytname. */
- int yychecklim = YYLAST - yyn + 1;
- int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
- int yyx;
-
- for (yyx = yyxbegin; yyx < yyxend; ++yyx)
- if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
- && !yytable_value_is_error (yytable[yyx + yyn]))
- {
- if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
- {
- yycount = 1;
- yysize = yysize0;
- break;
- }
- yyarg[yycount++] = yytname[yyx];
- {
- YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULL, yytname[yyx]);
- if (! (yysize <= yysize1
- && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
- return 2;
- yysize = yysize1;
- }
- }
- }
- }
-
- switch (yycount)
- {
-# define YYCASE_(N, S) \
- case N: \
- yyformat = S; \
- break
- YYCASE_(0, YY_("syntax error"));
- YYCASE_(1, YY_("syntax error, unexpected %s"));
- YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
- YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
- YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
- YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
-# undef YYCASE_
- }
-
- {
- YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
- if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
- return 2;
- yysize = yysize1;
- }
-
- if (*yymsg_alloc < yysize)
- {
- *yymsg_alloc = 2 * yysize;
- if (! (yysize <= *yymsg_alloc
- && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
- *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
- return 1;
- }
-
- /* Avoid sprintf, as that infringes on the user's name space.
- Don't have undefined behavior even if the translation
- produced a string with the wrong number of "%s"s. */
- {
- char *yyp = *yymsg;
- int yyi = 0;
- while ((*yyp = *yyformat) != '\0')
- if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
- {
- yyp += yytnamerr (yyp, yyarg[yyi++]);
- yyformat += 2;
- }
- else
- {
- yyp++;
- yyformat++;
- }
- }
- return 0;
-}
-#endif /* YYERROR_VERBOSE */
-
-/*-----------------------------------------------.
-| Release the memory associated to this symbol. |
-`-----------------------------------------------*/
-
-/*ARGSUSED*/
-#if (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
-static void
-yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
-#else
-static void
-yydestruct (yymsg, yytype, yyvaluep)
- const char *yymsg;
- int yytype;
- YYSTYPE *yyvaluep;
-#endif
-{
- YYUSE (yyvaluep);
-
- if (!yymsg)
- yymsg = "Deleting";
- YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
-
- YYUSE (yytype);
-}
-
-
-
-
-/*----------.
-| yyparse. |
-`----------*/
-
-#ifdef YYPARSE_PARAM
-#if (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
-int
-yyparse (void *YYPARSE_PARAM)
-#else
-int
-yyparse (YYPARSE_PARAM)
- void *YYPARSE_PARAM;
-#endif
-#else /* ! YYPARSE_PARAM */
-#if (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
-int
-yyparse (void)
-#else
-int
-yyparse ()
-
-#endif
-#endif
-{
-/* The lookahead symbol. */
-int yychar;
-
-
-#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
-/* Suppress an incorrect diagnostic about yylval being uninitialized. */
-# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
- _Pragma ("GCC diagnostic push") \
- _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
- _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
-# define YY_IGNORE_MAYBE_UNINITIALIZED_END \
- _Pragma ("GCC diagnostic pop")
-#else
-/* Default value used for initialization, for pacifying older GCCs
- or non-GCC compilers. */
-static YYSTYPE yyval_default;
-# define YY_INITIAL_VALUE(Value) = Value
-#endif
-#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
-# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
-# define YY_IGNORE_MAYBE_UNINITIALIZED_END
-#endif
-#ifndef YY_INITIAL_VALUE
-# define YY_INITIAL_VALUE(Value) /* Nothing. */
-#endif
-
-/* The semantic value of the lookahead symbol. */
-YYSTYPE yylval YY_INITIAL_VALUE(yyval_default);
-
- /* Number of syntax errors so far. */
- int yynerrs;
-
- int yystate;
- /* Number of tokens to shift before error messages enabled. */
- int yyerrstatus;
-
- /* The stacks and their tools:
- `yyss': related to states.
- `yyvs': related to semantic values.
-
- Refer to the stacks through separate pointers, to allow yyoverflow
- to reallocate them elsewhere. */
-
- /* The state stack. */
- yytype_int16 yyssa[YYINITDEPTH];
- yytype_int16 *yyss;
- yytype_int16 *yyssp;
-
- /* The semantic value stack. */
- YYSTYPE yyvsa[YYINITDEPTH];
- YYSTYPE *yyvs;
- YYSTYPE *yyvsp;
-
- YYSIZE_T yystacksize;
-
- int yyn;
- int yyresult;
- /* Lookahead token as an internal (translated) token number. */
- int yytoken = 0;
- /* The variables used to return semantic value and location from the
- action routines. */
- YYSTYPE yyval;
-
-#if YYERROR_VERBOSE
- /* Buffer for error messages, and its allocated size. */
- char yymsgbuf[128];
- char *yymsg = yymsgbuf;
- YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
-#endif
-
-#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
-
- /* The number of symbols on the RHS of the reduced rule.
- Keep to zero when no symbol should be popped. */
- int yylen = 0;
-
- yyssp = yyss = yyssa;
- yyvsp = yyvs = yyvsa;
- yystacksize = YYINITDEPTH;
-
- YYDPRINTF ((stderr, "Starting parse\n"));
-
- yystate = 0;
- yyerrstatus = 0;
- yynerrs = 0;
- yychar = YYEMPTY; /* Cause a token to be read. */
- goto yysetstate;
-
-/*------------------------------------------------------------.
-| yynewstate -- Push a new state, which is found in yystate. |
-`------------------------------------------------------------*/
- yynewstate:
- /* In all cases, when you get here, the value and location stacks
- have just been pushed. So pushing a state here evens the stacks. */
- yyssp++;
-
- yysetstate:
- *yyssp = yystate;
-
- if (yyss + yystacksize - 1 <= yyssp)
- {
- /* Get the current used size of the three stacks, in elements. */
- YYSIZE_T yysize = yyssp - yyss + 1;
-
-#ifdef yyoverflow
- {
- /* Give user a chance to reallocate the stack. Use copies of
- these so that the &'s don't force the real ones into
- memory. */
- YYSTYPE *yyvs1 = yyvs;
- yytype_int16 *yyss1 = yyss;
-
- /* Each stack pointer address is followed by the size of the
- data in use in that stack, in bytes. This used to be a
- conditional around just the two extra args, but that might
- be undefined if yyoverflow is a macro. */
- yyoverflow (YY_("memory exhausted"),
- &yyss1, yysize * sizeof (*yyssp),
- &yyvs1, yysize * sizeof (*yyvsp),
- &yystacksize);
-
- yyss = yyss1;
- yyvs = yyvs1;
- }
-#else /* no yyoverflow */
-# ifndef YYSTACK_RELOCATE
- goto yyexhaustedlab;
-# else
- /* Extend the stack our own way. */
- if (YYMAXDEPTH <= yystacksize)
- goto yyexhaustedlab;
- yystacksize *= 2;
- if (YYMAXDEPTH < yystacksize)
- yystacksize = YYMAXDEPTH;
-
- {
- yytype_int16 *yyss1 = yyss;
- union yyalloc *yyptr =
- (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
- if (! yyptr)
- goto yyexhaustedlab;
- YYSTACK_RELOCATE (yyss_alloc, yyss);
- YYSTACK_RELOCATE (yyvs_alloc, yyvs);
-# undef YYSTACK_RELOCATE
- if (yyss1 != yyssa)
- YYSTACK_FREE (yyss1);
- }
-# endif
-#endif /* no yyoverflow */
-
- yyssp = yyss + yysize - 1;
- yyvsp = yyvs + yysize - 1;
-
- YYDPRINTF ((stderr, "Stack size increased to %lu\n",
- (unsigned long int) yystacksize));
-
- if (yyss + yystacksize - 1 <= yyssp)
- YYABORT;
- }
-
- YYDPRINTF ((stderr, "Entering state %d\n", yystate));
-
- if (yystate == YYFINAL)
- YYACCEPT;
-
- goto yybackup;
-
-/*-----------.
-| yybackup. |
-`-----------*/
-yybackup:
-
- /* Do appropriate processing given the current state. Read a
- lookahead token if we need one and don't already have one. */
-
- /* First try to decide what to do without reference to lookahead token. */
- yyn = yypact[yystate];
- if (yypact_value_is_default (yyn))
- goto yydefault;
-
- /* Not known => get a lookahead token if don't already have one. */
-
- /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
- if (yychar == YYEMPTY)
- {
- YYDPRINTF ((stderr, "Reading a token: "));
- yychar = YYLEX;
- }
-
- if (yychar <= YYEOF)
- {
- yychar = yytoken = YYEOF;
- YYDPRINTF ((stderr, "Now at end of input.\n"));
- }
- else
- {
- yytoken = YYTRANSLATE (yychar);
- YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
- }
-
- /* If the proper action on seeing token YYTOKEN is to reduce or to
- detect an error, take that action. */
- yyn += yytoken;
- if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
- goto yydefault;
- yyn = yytable[yyn];
- if (yyn <= 0)
- {
- if (yytable_value_is_error (yyn))
- goto yyerrlab;
- yyn = -yyn;
- goto yyreduce;
- }
-
- /* Count tokens shifted since error; after three, turn off error
- status. */
- if (yyerrstatus)
- yyerrstatus--;
-
- /* Shift the lookahead token. */
- YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
-
- /* Discard the shifted token. */
- yychar = YYEMPTY;
-
- yystate = yyn;
- YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
- *++yyvsp = yylval;
- YY_IGNORE_MAYBE_UNINITIALIZED_END
-
- goto yynewstate;
-
-
-/*-----------------------------------------------------------.
-| yydefault -- do the default action for the current state. |
-`-----------------------------------------------------------*/
-yydefault:
- yyn = yydefact[yystate];
- if (yyn == 0)
- goto yyerrlab;
- goto yyreduce;
-
-
-/*-----------------------------.
-| yyreduce -- Do a reduction. |
-`-----------------------------*/
-yyreduce:
- /* yyn is the number of a rule to reduce with. */
- yylen = yyr2[yyn];
-
- /* If YYLEN is nonzero, implement the default value of the action:
- `$$ = $1'.
-
- Otherwise, the following line sets YYVAL to garbage.
- This behavior is undocumented and Bison
- users should not rely upon it. Assigning to YYVAL
- unconditionally makes the parser a bit smaller, and it avoids a
- GCC warning that YYVAL may be used uninitialized. */
- yyval = yyvsp[1-yylen];
-
-
- YY_REDUCE_PRINT (yyn);
- switch (yyn)
- {
- case 2:
-/* Line 1802 of yacc.c */
-#line 71 "sapi/phpdbg/phpdbg_parser.y"
- { (yyval) = (yyvsp[(1) - (1)]); }
- break;
-
- case 3:
-/* Line 1802 of yacc.c */
-#line 72 "sapi/phpdbg/phpdbg_parser.y"
- { phpdbg_stack_separate((yyvsp[(1) - (3)]).top); (yyval) = (yyvsp[(3) - (3)]); }
- break;
-
- case 5:
-/* Line 1802 of yacc.c */
-#line 77 "sapi/phpdbg/phpdbg_parser.y"
- { (yyval).top = PHPDBG_G(parser_stack)->top; }
- break;
-
- case 6:
-/* Line 1802 of yacc.c */
-#line 78 "sapi/phpdbg/phpdbg_parser.y"
- { phpdbg_stack_push(PHPDBG_G(parser_stack), &(yyvsp[(1) - (1)])); (yyval).top = PHPDBG_G(parser_stack)->top; }
- break;
-
- case 7:
-/* Line 1802 of yacc.c */
-#line 82 "sapi/phpdbg/phpdbg_parser.y"
- { phpdbg_stack_push(PHPDBG_G(parser_stack), &(yyvsp[(1) - (1)])); (yyval).top = PHPDBG_G(parser_stack)->top; }
- break;
-
- case 8:
-/* Line 1802 of yacc.c */
-#line 83 "sapi/phpdbg/phpdbg_parser.y"
- { phpdbg_stack_push(PHPDBG_G(parser_stack), &(yyvsp[(2) - (2)])); (yyval).top = PHPDBG_G(parser_stack)->top; }
- break;
-
- case 9:
-/* Line 1802 of yacc.c */
-#line 84 "sapi/phpdbg/phpdbg_parser.y"
- { (yyval) = (yyvsp[(1) - (2)]); }
- break;
-
- case 10:
-/* Line 1802 of yacc.c */
-#line 88 "sapi/phpdbg/phpdbg_parser.y"
- {
- (yyval).type = FILE_PARAM;
- (yyval).file.name = (yyvsp[(2) - (3)]).str;
- (yyval).file.line = (yyvsp[(3) - (3)]).num;
- }
- break;
-
- case 11:
-/* Line 1802 of yacc.c */
-#line 93 "sapi/phpdbg/phpdbg_parser.y"
- {
- (yyval).type = NUMERIC_FILE_PARAM;
- (yyval).file.name = (yyvsp[(1) - (4)]).str;
- (yyval).file.line = (yyvsp[(4) - (4)]).num;
- }
- break;
-
- case 12:
-/* Line 1802 of yacc.c */
-#line 98 "sapi/phpdbg/phpdbg_parser.y"
- {
- (yyval).type = FILE_PARAM;
- (yyval).file.name = malloc((yyvsp[(1) - (4)]).len + (yyvsp[(2) - (4)]).len + 1);
- if ((yyval).file.name) {
- memcpy(&(yyval).file.name[0], (yyvsp[(1) - (4)]).str, (yyvsp[(1) - (4)]).len);
- memcpy(&(yyval).file.name[(yyvsp[(1) - (4)]).len], (yyvsp[(2) - (4)]).str, (yyvsp[(2) - (4)]).len);
- (yyval).file.name[(yyvsp[(1) - (4)]).len + (yyvsp[(2) - (4)]).len] = '\0';
- }
- (yyval).file.line = (yyvsp[(4) - (4)]).num;
- }
- break;
-
- case 13:
-/* Line 1802 of yacc.c */
-#line 108 "sapi/phpdbg/phpdbg_parser.y"
- {
- (yyval).type = NUMERIC_FILE_PARAM;
- (yyval).file.name = malloc((yyvsp[(1) - (5)]).len + (yyvsp[(2) - (5)]).len + 1);
- if ((yyval).file.name) {
- memcpy(&(yyval).file.name[0], (yyvsp[(1) - (5)]).str, (yyvsp[(1) - (5)]).len);
- memcpy(&(yyval).file.name[(yyvsp[(1) - (5)]).len], (yyvsp[(2) - (5)]).str, (yyvsp[(2) - (5)]).len);
- (yyval).file.name[(yyvsp[(1) - (5)]).len + (yyvsp[(2) - (5)]).len] = '\0';
- }
- (yyval).file.line = (yyvsp[(5) - (5)]).num;
- }
- break;
-
- case 14:
-/* Line 1802 of yacc.c */
-#line 118 "sapi/phpdbg/phpdbg_parser.y"
- {
- (yyval).type = METHOD_PARAM;
- (yyval).method.class = (yyvsp[(1) - (3)]).str;
- (yyval).method.name = (yyvsp[(3) - (3)]).str;
- }
- break;
-
- case 15:
-/* Line 1802 of yacc.c */
-#line 123 "sapi/phpdbg/phpdbg_parser.y"
- {
- (yyval).type = NUMERIC_METHOD_PARAM;
- (yyval).method.class = (yyvsp[(1) - (5)]).str;
- (yyval).method.name = (yyvsp[(3) - (5)]).str;
- (yyval).num = (yyvsp[(5) - (5)]).num;
- }
- break;
-
- case 16:
-/* Line 1802 of yacc.c */
-#line 129 "sapi/phpdbg/phpdbg_parser.y"
- {
- (yyval).type = NUMERIC_FUNCTION_PARAM;
- (yyval).str = (yyvsp[(1) - (3)]).str;
- (yyval).len = (yyvsp[(1) - (3)]).len;
- (yyval).num = (yyvsp[(3) - (3)]).num;
- }
- break;
-
- case 17:
-/* Line 1802 of yacc.c */
-#line 135 "sapi/phpdbg/phpdbg_parser.y"
- {
- (yyval).type = COND_PARAM;
- (yyval).str = (yyvsp[(2) - (2)]).str;
- (yyval).len = (yyvsp[(2) - (2)]).len;
- }
- break;
-
- case 18:
-/* Line 1802 of yacc.c */
-#line 140 "sapi/phpdbg/phpdbg_parser.y"
- { (yyval) = (yyvsp[(1) - (1)]); }
- break;
-
- case 19:
-/* Line 1802 of yacc.c */
-#line 141 "sapi/phpdbg/phpdbg_parser.y"
- { (yyval) = (yyvsp[(1) - (1)]); }
- break;
-
- case 20:
-/* Line 1802 of yacc.c */
-#line 142 "sapi/phpdbg/phpdbg_parser.y"
- { (yyval) = (yyvsp[(1) - (1)]); }
- break;
-
- case 21:
-/* Line 1802 of yacc.c */
-#line 143 "sapi/phpdbg/phpdbg_parser.y"
- { (yyval) = (yyvsp[(1) - (1)]); }
- break;
-
- case 22:
-/* Line 1802 of yacc.c */
-#line 144 "sapi/phpdbg/phpdbg_parser.y"
- { (yyval) = (yyvsp[(1) - (1)]); }
- break;
-
- case 23:
-/* Line 1802 of yacc.c */
-#line 145 "sapi/phpdbg/phpdbg_parser.y"
- { (yyval) = (yyvsp[(1) - (1)]); }
- break;
-
- case 24:
-/* Line 1802 of yacc.c */
-#line 146 "sapi/phpdbg/phpdbg_parser.y"
- { (yyval) = (yyvsp[(1) - (1)]); }
- break;
-
- case 25:
-/* Line 1802 of yacc.c */
-#line 150 "sapi/phpdbg/phpdbg_parser.y"
- { PHPDBG_G(req_id) = (yyvsp[(1) - (1)]).num; }
- break;
-
- case 27:
-/* Line 1802 of yacc.c */
-#line 155 "sapi/phpdbg/phpdbg_parser.y"
- {
- (yyval).type = EVAL_PARAM;
- (yyval).str = (yyvsp[(3) - (3)]).str;
- (yyval).len = (yyvsp[(3) - (3)]).len;
- }
- break;
-
- case 28:
-/* Line 1802 of yacc.c */
-#line 160 "sapi/phpdbg/phpdbg_parser.y"
- {
- (yyval).type = SHELL_PARAM;
- (yyval).str = (yyvsp[(3) - (3)]).str;
- (yyval).len = (yyvsp[(3) - (3)]).len;
- }
- break;
-
- case 29:
-/* Line 1802 of yacc.c */
-#line 165 "sapi/phpdbg/phpdbg_parser.y"
- {
- (yyval).type = RUN_PARAM;
- (yyval).len = 0;
- }
- break;
-
- case 30:
-/* Line 1802 of yacc.c */
-#line 169 "sapi/phpdbg/phpdbg_parser.y"
- {
- (yyval).type = RUN_PARAM;
- (yyval).str = (yyvsp[(3) - (3)]).str;
- (yyval).len = (yyvsp[(3) - (3)]).len;
- }
- break;
-
-
-/* Line 1802 of yacc.c */
-#line 1694 "sapi/phpdbg/phpdbg_parser.c"
- default: break;
- }
- /* User semantic actions sometimes alter yychar, and that requires
- that yytoken be updated with the new translation. We take the
- approach of translating immediately before every use of yytoken.
- One alternative is translating here after every semantic action,
- but that translation would be missed if the semantic action invokes
- YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
- if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
- incorrect destructor might then be invoked immediately. In the
- case of YYERROR or YYBACKUP, subsequent parser actions might lead
- to an incorrect destructor call or verbose syntax error message
- before the lookahead is translated. */
- YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
-
- YYPOPSTACK (yylen);
- yylen = 0;
- YY_STACK_PRINT (yyss, yyssp);
-
- *++yyvsp = yyval;
-
- /* Now `shift' the result of the reduction. Determine what state
- that goes to, based on the state we popped back to and the rule
- number reduced by. */
-
- yyn = yyr1[yyn];
-
- yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
- if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
- yystate = yytable[yystate];
- else
- yystate = yydefgoto[yyn - YYNTOKENS];
-
- goto yynewstate;
-
-
-/*------------------------------------.
-| yyerrlab -- here on detecting error |
-`------------------------------------*/
-yyerrlab:
- /* Make sure we have latest lookahead translation. See comments at
- user semantic actions for why this is necessary. */
- yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
-
- /* If not already recovering from an error, report this error. */
- if (!yyerrstatus)
- {
- ++yynerrs;
-#if ! YYERROR_VERBOSE
- yyerror (YY_("syntax error"));
-#else
-# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
- yyssp, yytoken)
- {
- char const *yymsgp = YY_("syntax error");
- int yysyntax_error_status;
- yysyntax_error_status = YYSYNTAX_ERROR;
- if (yysyntax_error_status == 0)
- yymsgp = yymsg;
- else if (yysyntax_error_status == 1)
- {
- if (yymsg != yymsgbuf)
- YYSTACK_FREE (yymsg);
- yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
- if (!yymsg)
- {
- yymsg = yymsgbuf;
- yymsg_alloc = sizeof yymsgbuf;
- yysyntax_error_status = 2;
- }
- else
- {
- yysyntax_error_status = YYSYNTAX_ERROR;
- yymsgp = yymsg;
- }
- }
- yyerror (yymsgp);
- if (yysyntax_error_status == 2)
- goto yyexhaustedlab;
- }
-# undef YYSYNTAX_ERROR
-#endif
- }
-
-
-
- if (yyerrstatus == 3)
- {
- /* If just tried and failed to reuse lookahead token after an
- error, discard it. */
-
- if (yychar <= YYEOF)
- {
- /* Return failure if at end of input. */
- if (yychar == YYEOF)
- YYABORT;
- }
- else
- {
- yydestruct ("Error: discarding",
- yytoken, &yylval);
- yychar = YYEMPTY;
- }
- }
-
- /* Else will try to reuse lookahead token after shifting the error
- token. */
- goto yyerrlab1;
-
-
-/*---------------------------------------------------.
-| yyerrorlab -- error raised explicitly by YYERROR. |
-`---------------------------------------------------*/
-yyerrorlab:
-
- /* Pacify compilers like GCC when the user code never invokes
- YYERROR and the label yyerrorlab therefore never appears in user
- code. */
- if (/*CONSTCOND*/ 0)
- goto yyerrorlab;
-
- /* Do not reclaim the symbols of the rule which action triggered
- this YYERROR. */
- YYPOPSTACK (yylen);
- yylen = 0;
- YY_STACK_PRINT (yyss, yyssp);
- yystate = *yyssp;
- goto yyerrlab1;
-
-
-/*-------------------------------------------------------------.
-| yyerrlab1 -- common code for both syntax error and YYERROR. |
-`-------------------------------------------------------------*/
-yyerrlab1:
- yyerrstatus = 3; /* Each real token shifted decrements this. */
-
- for (;;)
- {
- yyn = yypact[yystate];
- if (!yypact_value_is_default (yyn))
- {
- yyn += YYTERROR;
- if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
- {
- yyn = yytable[yyn];
- if (0 < yyn)
- break;
- }
- }
-
- /* Pop the current state because it cannot handle the error token. */
- if (yyssp == yyss)
- YYABORT;
-
-
- yydestruct ("Error: popping",
- yystos[yystate], yyvsp);
- YYPOPSTACK (1);
- yystate = *yyssp;
- YY_STACK_PRINT (yyss, yyssp);
- }
-
- YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
- *++yyvsp = yylval;
- YY_IGNORE_MAYBE_UNINITIALIZED_END
-
-
- /* Shift the error token. */
- YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
-
- yystate = yyn;
- goto yynewstate;
-
-
-/*-------------------------------------.
-| yyacceptlab -- YYACCEPT comes here. |
-`-------------------------------------*/
-yyacceptlab:
- yyresult = 0;
- goto yyreturn;
-
-/*-----------------------------------.
-| yyabortlab -- YYABORT comes here. |
-`-----------------------------------*/
-yyabortlab:
- yyresult = 1;
- goto yyreturn;
-
-#if !defined yyoverflow || YYERROR_VERBOSE
-/*-------------------------------------------------.
-| yyexhaustedlab -- memory exhaustion comes here. |
-`-------------------------------------------------*/
-yyexhaustedlab:
- yyerror (YY_("memory exhausted"));
- yyresult = 2;
- /* Fall through. */
-#endif
-
-yyreturn:
- if (yychar != YYEMPTY)
- {
- /* Make sure we have latest lookahead translation. See comments at
- user semantic actions for why this is necessary. */
- yytoken = YYTRANSLATE (yychar);
- yydestruct ("Cleanup: discarding lookahead",
- yytoken, &yylval);
- }
- /* Do not reclaim the symbols of the rule which action triggered
- this YYABORT or YYACCEPT. */
- YYPOPSTACK (yylen);
- YY_STACK_PRINT (yyss, yyssp);
- while (yyssp != yyss)
- {
- yydestruct ("Cleanup: popping",
- yystos[*yyssp], yyvsp);
- YYPOPSTACK (1);
- }
-#ifndef yyoverflow
- if (yyss != yyssa)
- YYSTACK_FREE (yyss);
-#endif
-#if YYERROR_VERBOSE
- if (yymsg != yymsgbuf)
- YYSTACK_FREE (yymsg);
-#endif
- /* Make sure YYID is used. */
- return YYID (yyresult);
-}
-
-
-/* Line 2050 of yacc.c */
-#line 176 "sapi/phpdbg/phpdbg_parser.y"
-
-
-static int yyerror(const char *msg) {
- phpdbg_error("command", "type=\"parseerror\" msg=\"%s\"", "Parse Error: %s", msg);
-
- {
- const phpdbg_param_t *top = PHPDBG_G(parser_stack);
-
- while (top) {
- phpdbg_param_debug(top, "--> ");
- top = top->next;
- }
- }
- return 0;
-}
-
-int phpdbg_do_parse(phpdbg_param_t *stack, char *input) {
- if (!*input) {
- return 0;
- }
-
- if (PHPDBG_G(cur_command)) {
- free(PHPDBG_G(cur_command));
- }
- PHPDBG_G(cur_command) = strdup(input);
-
- phpdbg_init_lexer(stack, input);
-
- return yyparse();
-}
diff --git a/sapi/phpdbg/phpdbg_parser.h b/sapi/phpdbg/phpdbg_parser.h
deleted file mode 100644
index 2a27a4e7df..0000000000
--- a/sapi/phpdbg/phpdbg_parser.h
+++ /dev/null
@@ -1,130 +0,0 @@
-/* A Bison parser, made by GNU Bison 2.7.12-4996. */
-
-/* Bison interface for Yacc-like parsers in C
-
- Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc.
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>. */
-
-/* As a special exception, you may create a larger work that contains
- part or all of the Bison parser skeleton and distribute that work
- under terms of your choice, so long as that work isn't itself a
- parser generator using the skeleton or a modified version thereof
- as a parser skeleton. Alternatively, if you modify or redistribute
- the parser skeleton itself, you may (at your option) remove this
- special exception, which will cause the skeleton and the resulting
- Bison output files to be licensed under the GNU General Public
- License without this special exception.
-
- This special exception was added by the Free Software Foundation in
- version 2.2 of Bison. */
-
-#ifndef YY_PHPDBG_SAPI_PHPDBG_PHPDBG_PARSER_H_INCLUDED
-# define YY_PHPDBG_SAPI_PHPDBG_PHPDBG_PARSER_H_INCLUDED
-/* Enabling traces. */
-#ifndef YYDEBUG
-# define YYDEBUG 0
-#endif
-#if YYDEBUG
-extern int phpdbg_debug;
-#endif
-/* "%code requires" blocks. */
-/* Line 2060 of yacc.c */
-#line 36 "sapi/phpdbg/phpdbg_parser.y"
-
-#include "phpdbg.h"
-#ifndef YY_TYPEDEF_YY_SCANNER_T
-#define YY_TYPEDEF_YY_SCANNER_T
-typedef void* yyscan_t;
-#endif
-
-
-/* Line 2060 of yacc.c */
-#line 55 "sapi/phpdbg/phpdbg_parser.h"
-
-/* Tokens. */
-#ifndef YYTOKENTYPE
-# define YYTOKENTYPE
- /* Put the tokens into the symbol table, so that GDB and other debuggers
- know about them. */
- enum yytokentype {
- T_EVAL = 258,
- T_RUN = 259,
- T_SHELL = 260,
- T_IF = 261,
- T_TRUTHY = 262,
- T_FALSY = 263,
- T_STRING = 264,
- T_COLON = 265,
- T_DCOLON = 266,
- T_POUND = 267,
- T_SEPARATOR = 268,
- T_PROTO = 269,
- T_DIGITS = 270,
- T_LITERAL = 271,
- T_ADDR = 272,
- T_OPCODE = 273,
- T_ID = 274,
- T_INPUT = 275,
- T_UNEXPECTED = 276,
- T_REQ_ID = 277
- };
-#endif
-/* Tokens. */
-#define T_EVAL 258
-#define T_RUN 259
-#define T_SHELL 260
-#define T_IF 261
-#define T_TRUTHY 262
-#define T_FALSY 263
-#define T_STRING 264
-#define T_COLON 265
-#define T_DCOLON 266
-#define T_POUND 267
-#define T_SEPARATOR 268
-#define T_PROTO 269
-#define T_DIGITS 270
-#define T_LITERAL 271
-#define T_ADDR 272
-#define T_OPCODE 273
-#define T_ID 274
-#define T_INPUT 275
-#define T_UNEXPECTED 276
-#define T_REQ_ID 277
-
-
-
-#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
-typedef int YYSTYPE;
-# define YYSTYPE_IS_TRIVIAL 1
-# define yystype YYSTYPE /* obsolescent; will be withdrawn */
-# define YYSTYPE_IS_DECLARED 1
-#endif
-
-
-#ifdef YYPARSE_PARAM
-#if defined __STDC__ || defined __cplusplus
-int phpdbg_parse (void *YYPARSE_PARAM);
-#else
-int phpdbg_parse ();
-#endif
-#else /* ! YYPARSE_PARAM */
-#if defined __STDC__ || defined __cplusplus
-int phpdbg_parse (void);
-#else
-int phpdbg_parse ();
-#endif
-#endif /* ! YYPARSE_PARAM */
-
-#endif /* !YY_PHPDBG_SAPI_PHPDBG_PHPDBG_PARSER_H_INCLUDED */
diff --git a/sapi/phpdbg/phpdbg_parser.y b/sapi/phpdbg/phpdbg_parser.y
index b61c9c0a26..3031ce5a80 100644
--- a/sapi/phpdbg/phpdbg_parser.y
+++ b/sapi/phpdbg/phpdbg_parser.y
@@ -28,8 +28,8 @@ ZEND_EXTERN_MODULE_GLOBALS(phpdbg)
%}
-%pure-parser
-%error-verbose
+%define api.pure full
+%define parse.error verbose
%code requires {
#include "phpdbg.h"
@@ -39,9 +39,6 @@ typedef void* yyscan_t;
#endif
}
-%output "sapi/phpdbg/phpdbg_parser.c"
-%defines "sapi/phpdbg/phpdbg_parser.h"
-
%token T_EVAL "eval"
%token T_RUN "run"
%token T_SHELL "shell"
@@ -68,7 +65,7 @@ typedef void* yyscan_t;
input
: command { $$ = $1; }
| input T_SEPARATOR command { phpdbg_stack_separate($1.top); $$ = $3; }
- | /* nothing */
+ | /* empty */
;
command
@@ -79,7 +76,7 @@ command
parameters
: parameter { phpdbg_stack_push(PHPDBG_G(parser_stack), &$1); $$.top = PHPDBG_G(parser_stack)->top; }
| parameters parameter { phpdbg_stack_push(PHPDBG_G(parser_stack), &$2); $$.top = PHPDBG_G(parser_stack)->top; }
- | parameters req_id { $$ = $1; }
+ | parameters T_REQ_ID { $$ = $1; PHPDBG_G(req_id) = $2.num; }
;
parameter
diff --git a/sapi/phpdbg/phpdbg_print.c b/sapi/phpdbg/phpdbg_print.c
index bc1ac22f26..5f48bd6a59 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) 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..66eae7bceb 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) 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 db56476905..e8e813b52e 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) 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 |
@@ -81,7 +81,7 @@ const phpdbg_command_t phpdbg_prompt_commands[] = {
PHPDBG_COMMAND_D(back, "show trace", 't', NULL, "|n", PHPDBG_ASYNC_SAFE),
PHPDBG_COMMAND_D(frame, "switch to a frame", 'f', NULL, "|n", PHPDBG_ASYNC_SAFE),
PHPDBG_COMMAND_D(list, "lists some code", 'l', phpdbg_list_commands, "*", PHPDBG_ASYNC_SAFE),
- PHPDBG_COMMAND_D(info, "displays some informations", 'i', phpdbg_info_commands, "|s", PHPDBG_ASYNC_SAFE),
+ PHPDBG_COMMAND_D(info, "displays some information", 'i', phpdbg_info_commands, "|s", PHPDBG_ASYNC_SAFE),
PHPDBG_COMMAND_D(clean, "clean the execution environment", 'X', NULL, 0, 0),
PHPDBG_COMMAND_D(clear, "clear breakpoints", 'C', NULL, 0, 0),
PHPDBG_COMMAND_D(help, "show help menu", 'h', phpdbg_help_commands, "|s", PHPDBG_ASYNC_SAFE),
@@ -373,6 +373,7 @@ void phpdbg_init(char *init_file, size_t init_file_len, zend_bool use_default) /
ZEND_IGNORE_VALUE(asprintf(&init_file, "%s/%s", scan_dir, PHPDBG_INIT_FILENAME));
phpdbg_try_file_init(init_file, strlen(init_file), 1);
+ free(init_file);
if (i == -1) {
break;
}
@@ -421,7 +422,7 @@ PHPDBG_COMMAND(exec) /* {{{ */
if (PHPDBG_G(exec)) {
phpdbg_notice("exec", "type=\"unset\" context=\"%s\"", "Unsetting old execution context: %s", PHPDBG_G(exec));
- efree(PHPDBG_G(exec));
+ free(PHPDBG_G(exec));
PHPDBG_G(exec) = NULL;
PHPDBG_G(exec_len) = 0L;
}
@@ -436,7 +437,7 @@ PHPDBG_COMMAND(exec) /* {{{ */
VCWD_CHDIR_FILE(res);
- *SG(request_info).argv = PHPDBG_G(exec);
+ *SG(request_info).argv = estrndup(PHPDBG_G(exec), PHPDBG_G(exec_len));
php_build_argv(NULL, &PG(http_globals)[TRACK_VARS_SERVER]);
phpdbg_notice("exec", "type=\"set\" context=\"%s\"", "Set execution context: %s", PHPDBG_G(exec));
@@ -534,9 +535,9 @@ int phpdbg_compile_stdin(zend_string *code) {
}
if (PHPDBG_G(exec)) {
- efree(PHPDBG_G(exec));
+ free(PHPDBG_G(exec));
}
- PHPDBG_G(exec) = estrdup("Standard input code");
+ PHPDBG_G(exec) = strdup("Standard input code");
PHPDBG_G(exec_len) = sizeof("Standard input code") - 1;
{ /* remove leading ?> from source */
int i;
@@ -838,7 +839,7 @@ PHPDBG_COMMAND(run) /* {{{ */
while (*p == ' ') p++;
while (*p) {
char sep = ' ';
- char *buf = emalloc(end - p + 1), *q = buf;
+ char *buf = emalloc(end - p + 2), *q = buf;
if (*p == '<') {
/* use as STDIN */
@@ -1315,7 +1316,7 @@ PHPDBG_API const char *phpdbg_load_module_or_extension(char **path, char **name)
char *err = GET_DL_ERROR();
if (err && err[0]) {
phpdbg_error("dl", "type=\"unknown\"", "%s", err);
- LocalFree(err);
+ php_win32_error_msg_free(err);
} else {
phpdbg_error("dl", "type=\"unknown\"", "Unknown reason");
}
@@ -1632,7 +1633,14 @@ int phpdbg_interactive(zend_bool allow_async_unsafe, char *input) /* {{{ */
sigio_watcher_start();
}
#endif
- switch (ret = phpdbg_stack_execute(&stack, allow_async_unsafe)) {
+ zend_try {
+ ret = phpdbg_stack_execute(&stack, allow_async_unsafe);
+ } zend_catch {
+ phpdbg_stack_free(&stack);
+ zend_bailout();
+ } zend_end_try();
+
+ switch (ret) {
case FAILURE:
if (!(PHPDBG_G(flags) & PHPDBG_IS_STOPPING)) {
if (!allow_async_unsafe || phpdbg_call_register(&stack) == FAILURE) {
@@ -1687,33 +1695,33 @@ int phpdbg_interactive(zend_bool allow_async_unsafe, char *input) /* {{{ */
return ret;
} /* }}} */
+static inline void list_code() {
+ if (!(PHPDBG_G(flags) & PHPDBG_IN_EVAL)) {
+ const char *file_char = zend_get_executed_filename();
+ zend_string *file = zend_string_init(file_char, strlen(file_char), 0);
+ phpdbg_list_file(file, 3, zend_get_executed_lineno()-1, zend_get_executed_lineno());
+ efree(file);
+ }
+}
+
/* code may behave weirdly if EG(exception) is set; thus backup it */
#define DO_INTERACTIVE(allow_async_unsafe) do { \
- const zend_op *backup_opline; \
- const zend_op *before_ex; \
if (exception) { \
+ const zend_op *before_ex = EG(opline_before_exception); \
+ const zend_op *backup_opline = NULL; \
if (EG(current_execute_data) && EG(current_execute_data)->func && ZEND_USER_CODE(EG(current_execute_data)->func->common.type)) { \
backup_opline = EG(current_execute_data)->opline; \
} \
- before_ex = EG(opline_before_exception); \
GC_ADDREF(exception); \
zend_clear_exception(); \
- } \
- if (!(PHPDBG_G(flags) & PHPDBG_IN_EVAL)) { \
- const char *file_char = zend_get_executed_filename(); \
- zend_string *file = zend_string_init(file_char, strlen(file_char), 0); \
- phpdbg_list_file(file, 3, zend_get_executed_lineno()-1, zend_get_executed_lineno()); \
- efree(file); \
- } \
- \
- switch (phpdbg_interactive(allow_async_unsafe, NULL)) { \
- zval zv; \
- case PHPDBG_LEAVE: \
- case PHPDBG_FINISH: \
- case PHPDBG_UNTIL: \
- case PHPDBG_NEXT: \
- if (exception) { \
- if (EG(current_execute_data) && EG(current_execute_data)->func && ZEND_USER_CODE(EG(current_execute_data)->func->common.type) \
+ list_code(); \
+ switch (phpdbg_interactive(allow_async_unsafe, NULL)) { \
+ zval zv; \
+ case PHPDBG_LEAVE: \
+ case PHPDBG_FINISH: \
+ case PHPDBG_UNTIL: \
+ case PHPDBG_NEXT: \
+ if (backup_opline \
&& (backup_opline->opcode == ZEND_HANDLE_EXCEPTION || backup_opline->opcode == ZEND_CATCH)) { \
EG(current_execute_data)->opline = backup_opline; \
EG(exception) = exception; \
@@ -1722,11 +1730,12 @@ int phpdbg_interactive(zend_bool allow_async_unsafe, char *input) /* {{{ */
zend_throw_exception_internal(&zv); \
} \
EG(opline_before_exception) = before_ex; \
- } \
- /* fallthrough */ \
- default: \
- goto next; \
+ } \
+ } else { \
+ list_code(); \
+ phpdbg_interactive(allow_async_unsafe, NULL); \
} \
+ goto next; \
} while (0)
void phpdbg_execute_ex(zend_execute_data *execute_data) /* {{{ */
diff --git a/sapi/phpdbg/phpdbg_prompt.h b/sapi/phpdbg/phpdbg_prompt.h
index cac69c0120..142581783a 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) 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 d923f7c1d2..2bc1c59b90 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) 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.h b/sapi/phpdbg/phpdbg_rinit_hook.h
index adc3f1c681..a350ddec54 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) 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 @@ extern zend_module_entry phpdbg_webhelper_module_entry;
#define phpext_phpdbg_webhelper_ptr &phpdbg_webhelper_module_entry
#ifdef ZTS
-# define PHPDBG_WG(v) TSRMG(phpdbg_webhelper_globals_id, zend_phpdbg_webhelper_globals *, v)
+# define PHPDBG_WG(v) ZEND_TSRMG(phpdbg_webhelper_globals_id, zend_phpdbg_webhelper_globals *, v)
#else
# define PHPDBG_WG(v) (phpdbg_webhelper_globals.v)
#endif
diff --git a/sapi/phpdbg/phpdbg_set.c b/sapi/phpdbg/phpdbg_set.c
index dc69221a50..da3ec4cf19 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) 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..7f89d9182d 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) 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 3ca0ad8d37..f3221d09cb 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) 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..af7b9f10cb 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) 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 e10eb60d4a..857b5e3311 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) 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 |
@@ -154,7 +154,7 @@ PHPDBG_API char *phpdbg_resolve_path(const char *path) /* {{{ */
return NULL;
}
- return estrdup(resolved_name);
+ return strdup(resolved_name);
} /* }}} */
PHPDBG_API const char *phpdbg_current_file(void) /* {{{ */
@@ -430,7 +430,7 @@ PHPDBG_API int phpdbg_parse_variable(char *input, size_t len, HashTable *parent,
PHPDBG_API int phpdbg_parse_variable_with_arg(char *input, size_t len, HashTable *parent, size_t i, phpdbg_parse_var_with_arg_func callback, phpdbg_parse_var_with_arg_func step_cb, zend_bool silent, void *arg) {
int ret = FAILURE;
zend_bool new_index = 1;
- char *last_index;
+ char *last_index = NULL;
size_t index_len = 0;
zval *zv;
@@ -660,8 +660,6 @@ PHPDBG_API void phpdbg_xml_var_dump(zval *zv) {
int (*element_dump_func)(zval *zv, zend_string *key, zend_ulong num);
zend_bool is_ref = 0;
- int is_temp;
-
phpdbg_try_access {
is_ref = Z_ISREF_P(zv) && GC_REFCOUNT(Z_COUNTED_P(zv)) > 1;
ZVAL_DEREF(zv);
@@ -696,10 +694,9 @@ PHPDBG_API void phpdbg_xml_var_dump(zval *zv) {
}
phpdbg_xml("<array refstatus=\"%s\" num=\"%d\">", COMMON, zend_hash_num_elements(myht));
element_dump_func = phpdbg_xml_array_element_dump;
- is_temp = 0;
goto head_done;
case IS_OBJECT:
- myht = Z_OBJDEBUG_P(zv, is_temp);
+ myht = zend_get_properties_for(zv, ZEND_PROP_PURPOSE_DEBUG);
if (myht && GC_IS_RECURSIVE(myht)) {
phpdbg_xml("<recursion />");
break;
@@ -717,9 +714,8 @@ head_done:
} ZEND_HASH_FOREACH_END();
zend_hash_apply_with_arguments(myht, (apply_func_args_t) element_dump_func, 0);
GC_UNPROTECT_RECURSION(myht);
- if (is_temp) {
- zend_hash_destroy(myht);
- efree(myht);
+ if (Z_TYPE_P(zv) == IS_OBJECT) {
+ zend_release_properties(myht);
}
}
if (Z_TYPE_P(zv) == IS_ARRAY) {
@@ -765,7 +761,7 @@ PHPDBG_API zend_bool phpdbg_check_caught_ex(zend_execute_data *execute_data, zen
zend_class_entry *ce;
if (!(ce = CACHED_PTR(cur->extended_value & ~ZEND_LAST_CATCH))) {
- 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);
+ ce = zend_fetch_class_by_name(Z_STR_P(RT_CONSTANT(cur, cur->op1)), Z_STR_P(RT_CONSTANT(cur, cur->op1) + 1), ZEND_FETCH_CLASS_NO_AUTOLOAD);
CACHE_PTR(cur->extended_value & ~ZEND_LAST_CATCH, ce);
}
diff --git a/sapi/phpdbg/phpdbg_utils.h b/sapi/phpdbg/phpdbg_utils.h
index c8a9554d0e..c212056670 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) 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 |
@@ -111,7 +111,7 @@ static zend_always_inline zend_execute_data *phpdbg_user_execute_data(zend_execu
#define PHPDBG_OUTPUT_BACKUP_DEFINES() \
zend_output_globals *output_globals_ptr; \
zend_output_globals original_output_globals; \
- output_globals_ptr = (zend_output_globals *) (*((void ***) tsrm_get_ls_cache()))[TSRM_UNSHUFFLE_RSRC_ID(output_globals_id)];
+ output_globals_ptr = TSRMG_BULK_STATIC(output_globals_id, zend_output_globals *);
#else
#define PHPDBG_OUTPUT_BACKUP_DEFINES() \
zend_output_globals *output_globals_ptr; \
diff --git a/sapi/phpdbg/phpdbg_wait.c b/sapi/phpdbg/phpdbg_wait.c
index 96504c7d7e..69be24a953 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) 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 |
@@ -243,7 +243,7 @@ void phpdbg_webdata_decompress(char *msg, int len) {
zend_extension *extension;
zend_llist_position pos;
zval *name = NULL;
- zend_string *strkey;
+ zend_string *strkey = NULL;
extension = (zend_extension *) zend_llist_get_first_ex(&zend_extensions, &pos);
while (extension) {
@@ -257,6 +257,7 @@ void phpdbg_webdata_decompress(char *msg, int len) {
break;
}
name = NULL;
+ strkey = NULL;
} ZEND_HASH_FOREACH_END();
if (name) {
@@ -283,6 +284,7 @@ void phpdbg_webdata_decompress(char *msg, int len) {
pefree(elm, zend_extensions.persistent);
zend_extensions.count--;
} else {
+ ZEND_ASSERT(strkey);
zend_hash_del(Z_ARRVAL_P(zvp), strkey);
}
}
@@ -377,21 +379,25 @@ PHPDBG_COMMAND(wait) /* {{{ */
return FAILURE;
}
- char msglen[5];
- int recvd = 4;
+ unsigned char msglen_buf[4];
+ int needed = 4;
do {
- recvd -= recv(sr, &(msglen[4 - recvd]), recvd, 0);
- } while (recvd > 0);
+ needed -= recv(sr, &msglen_buf[4 - needed], needed, 0);
+ } while (needed > 0);
- recvd = *(size_t *) msglen;
- char *data = emalloc(recvd);
+ uint32_t msglen = (msglen_buf[3] << 24)
+ | (msglen_buf[2] << 16)
+ | (msglen_buf[1] << 8)
+ | (msglen_buf[0] << 0);
+ char *data = emalloc(msglen);
+ needed = msglen;
do {
- recvd -= recv(sr, &(data[(*(int *) msglen) - recvd]), recvd, 0);
- } while (recvd > 0);
+ needed -= recv(sr, &(data[msglen - needed]), needed, 0);
+ } while (needed > 0);
- phpdbg_webdata_decompress(data, *(int *) msglen);
+ phpdbg_webdata_decompress(data, msglen);
if (PHPDBG_G(socket_fd) != -1) {
close(PHPDBG_G(socket_fd));
diff --git a/sapi/phpdbg/phpdbg_wait.h b/sapi/phpdbg/phpdbg_wait.h
index 71c6ace543..b748e162bb 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) 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 1d7f33ff6f..d9f9f8673f 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) 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 |
@@ -31,7 +31,7 @@
* Watch elements are either simple, recursive or implicit (PHPDBG_WATCH_* flags)
* Simple means that a particular watchpoint was explicitly defined
* Recursive watch elements are created recursively (recursive root flag is to distinguish the root element easily from its children recursive elements)
- * Implicit watch elements are implicitely created on all ancestors of simple or recursive watch elements
+ * Implicit watch elements are implicitly created on all ancestors of simple or recursive watch elements
* Recursive and (simple or implicit) watch elements are mutually exclusive
* Array/Object to distinguish watch elements on arrays
*
@@ -1014,13 +1014,14 @@ void phpdbg_check_watchpoint(phpdbg_watchpoint_t *watch) {
}
if (watch->type == WATCH_ON_BUCKET) {
if (watch->backup.bucket.key != watch->addr.bucket->key || (watch->backup.bucket.key != NULL && watch->backup.bucket.h != watch->addr.bucket->h)) {
- phpdbg_watch_element *element;
+ phpdbg_watch_element *element = NULL;
zval *new;
ZEND_HASH_FOREACH_PTR(&watch->elements, element) {
break;
} ZEND_HASH_FOREACH_END();
+ ZEND_ASSERT(element); /* elements must be non-empty */
new = zend_symtable_find(element->parent_container, element->name_in_parent);
if (!new) {
diff --git a/sapi/phpdbg/phpdbg_watch.h b/sapi/phpdbg/phpdbg_watch.h
index 4d5e2153ae..313df624ea 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) 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 a543f98ba7..36d327f56f 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) 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.h b/sapi/phpdbg/phpdbg_webdata_transfer.h
index aa736a78b9..c08c6e8f93 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) 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.c b/sapi/phpdbg/phpdbg_win.c
index 964aed0194..6bf79981e0 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) 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..ba83062301 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) 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/phpdbg_oplog_001.phpt b/sapi/phpdbg/tests/phpdbg_oplog_001.phpt
index 5a5e9ba61c..9fc112a3f7 100644
--- a/sapi/phpdbg/tests/phpdbg_oplog_001.phpt
+++ b/sapi/phpdbg/tests/phpdbg_oplog_001.phpt
@@ -26,7 +26,7 @@ prompt> halloarray(2) {
[4]=>
int(1)
[5]=>
- int(3)
+ int(2)
[8]=>
int(2)
}
diff --git a/sapi/phpdbg/tests/print_001.phpt b/sapi/phpdbg/tests/print_001.phpt
index 93a000528f..0025d5c071 100644
--- a/sapi/phpdbg/tests/print_001.phpt
+++ b/sapi/phpdbg/tests/print_001.phpt
@@ -30,19 +30,17 @@ L5-7 Foo\Bar::Foo() %s - %s + 5 ops
L9-9 Foo\Bar::baz() %s - %s + 1 ops
L9 #0 RETURN<-1> null
prompt> [Not Executing!]
-prompt> [Context %s (11 ops)]
-L1-21 {main}() %s - %s + 11 ops
- L4 #0 NOP
- L14 #1 NOP
- L18 #2 NEW "Foo\\Bar" @1
- L18 #3 DO_FCALL
- L18 #4 INIT_METHOD_CALL<1> @1 "Foo"
- L18 #5 SEND_VAL_EX "test" 1
- L18 #6 DO_FCALL
- L19 #7 INIT_FCALL%s %d %s "foo"
- L19 #8 SEND_VAL "test" 1
- L19 #9 DO_FCALL
- L21 #10 RETURN<-1> 1
+prompt> [Context %s (9 ops)]
+L1-21 {main}() %s - %s + 9 ops
+ L18 #0 NEW "Foo\\Bar" @0
+ L18 #1 DO_FCALL
+ L18 #2 INIT_METHOD_CALL<1> @0 "Foo"
+ L18 #3 SEND_VAL_EX "test" 1
+ L18 #4 DO_FCALL
+ L19 #5 INIT_FCALL%s %d %s "foo"
+ L19 #6 SEND_VAL "test" 1
+ L19 #7 DO_FCALL
+ L21 #8 RETURN<-1> 1
prompt>
--FILE--
<?php
diff --git a/sapi/phpdbg/tests/stepping_001.phpt b/sapi/phpdbg/tests/stepping_001.phpt
index 90b2e5573a..27084c6ef7 100644
--- a/sapi/phpdbg/tests/stepping_001.phpt
+++ b/sapi/phpdbg/tests/stepping_001.phpt
@@ -34,7 +34,7 @@ prompt> [L10 %s ECHO "ok"
00011: } finally {
00012: echo " ... ok";
prompt> ok
-[L11 %s FAST_CALL J8 ~%d %s]
+[L11 %s FAST_CALL J7 ~%d %s]
>00011: } finally {
00012: echo " ... ok";
00013: }
@@ -44,7 +44,7 @@ prompt> [L12 %s ECHO " ... ok"
00014:
prompt> ... ok
[L12 %s FAST_RET ~%d %s]
-[L11 %s JMP J10 %s]
+[L11 %s JMP J9 %s]
>00011: } finally {
00012: echo " ... ok";
00013: }
diff --git a/sapi/phpdbg/tests/watch_001.phpt b/sapi/phpdbg/tests/watch_001.phpt
index e16681bf7c..86e5786e97 100644
--- a/sapi/phpdbg/tests/watch_001.phpt
+++ b/sapi/phpdbg/tests/watch_001.phpt
@@ -1,5 +1,11 @@
--TEST--
Test simple recursive watchpoint
+--SKIPIF--
+<?php
+if (PHP_INT_SIZE == 4) {
+ die("xfail There may be flaws in the implementation of watchpoints that cause failures");
+}
+?>
--INI--
opcache.optimization_level=0
--PHPDBG--
diff --git a/sapi/phpdbg/tests/watch_002.phpt b/sapi/phpdbg/tests/watch_002.phpt
index b57ca0a1d4..52336c08d0 100644
--- a/sapi/phpdbg/tests/watch_002.phpt
+++ b/sapi/phpdbg/tests/watch_002.phpt
@@ -1,5 +1,11 @@
--TEST--
Test simple array watchpoint with replace
+--SKIPIF--
+<?php
+if (PHP_INT_SIZE == 4) {
+ die("xfail There may be flaws in the implementation of watchpoints that cause failures");
+}
+?>
--PHPDBG--
b 6
r
diff --git a/sapi/phpdbg/tests/watch_003.phpt b/sapi/phpdbg/tests/watch_003.phpt
index 08868aedc3..e054b6f324 100644
--- a/sapi/phpdbg/tests/watch_003.phpt
+++ b/sapi/phpdbg/tests/watch_003.phpt
@@ -1,5 +1,11 @@
--TEST--
Test simple watchpoint with replace
+--SKIPIF--
+<?php
+if (PHP_INT_SIZE == 4) {
+ die("xfail There may be flaws in the implementation of watchpoints that cause failures");
+}
+?>
--PHPDBG--
b 6
r
diff --git a/sapi/phpdbg/tests/watch_004.phpt b/sapi/phpdbg/tests/watch_004.phpt
index 878542937b..dcb37a4959 100644
--- a/sapi/phpdbg/tests/watch_004.phpt
+++ b/sapi/phpdbg/tests/watch_004.phpt
@@ -1,5 +1,11 @@
--TEST--
Test detection of inline string manipulations on zval watch
+--SKIPIF--
+<?php
+if (PHP_INT_SIZE == 4) {
+ die("xfail There may be flaws in the implementation of watchpoints that cause failures");
+}
+?>
--INI--
opcache.optimization_level=0
--PHPDBG--
diff --git a/sapi/phpdbg/tests/watch_005.phpt b/sapi/phpdbg/tests/watch_005.phpt
index d6bae9d3f3..0bd44c9a01 100644
--- a/sapi/phpdbg/tests/watch_005.phpt
+++ b/sapi/phpdbg/tests/watch_005.phpt
@@ -1,5 +1,11 @@
--TEST--
Test proper watch comparisons when having multiple levels of indirection from a zval to its value
+--SKIPIF--
+<?php
+if (PHP_INT_SIZE == 4) {
+ die("xfail There may be flaws in the implementation of watchpoints that cause failures");
+}
+?>
--PHPDBG--
b 3
r
diff --git a/sapi/phpdbg/tests/watch_006.phpt b/sapi/phpdbg/tests/watch_006.phpt
index bf38b8eff1..fa292005a4 100644
--- a/sapi/phpdbg/tests/watch_006.phpt
+++ b/sapi/phpdbg/tests/watch_006.phpt
@@ -1,5 +1,11 @@
--TEST--
Test multiple watch elements pointing to the same watchpoint
+--SKIPIF--
+<?php
+if (PHP_INT_SIZE == 4) {
+ die("xfail There may be flaws in the implementation of watchpoints that cause failures");
+}
+?>
--PHPDBG--
b 4
r
diff --git a/sapi/phpdbg/web-bootstrap.php b/sapi/phpdbg/web-bootstrap.php
index 046062997e..fa634ee8d7 100644
--- a/sapi/phpdbg/web-bootstrap.php
+++ b/sapi/phpdbg/web-bootstrap.php
@@ -30,7 +30,7 @@ $_SERVER = array
'HTTP_ACCEPT_LANGUAGE' => 'en-US,en;q=0.8',
'HTTP_COOKIE' => 'tz=Europe%2FLondon; __utma=1.347100075.1384196523.1384196523.1384196523.1; __utmc=1; __utmz=1.1384196523.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none)',
'PATH' => '/usr/local/bin:/usr/bin:/bin',
- 'SERVER_SIGNATURE' => '<address>Apache/2.4.6 (Ubuntu) Server at phpdbg.com Port 80</address>',
+ 'SERVER_SIGNATURE' => '<address>Apache/2.4.6 (Ubuntu) Server at localhost Port 80</address>',
'SERVER_SOFTWARE' => 'Apache/2.4.6 (Ubuntu)',
'SERVER_NAME' => 'localhost',
'SERVER_ADDR' => '127.0.0.1',
diff --git a/sapi/phpdbg/xml.md b/sapi/phpdbg/xml.md
index c02f80f2ca..3fff8d2bc1 100644
--- a/sapi/phpdbg/xml.md
+++ b/sapi/phpdbg/xml.md
@@ -633,7 +633,7 @@ Other tags
- &lt;watchhit variable="" />: when ever a watched variable is changed, followed by a &lt;watchdata> container
- &lt;watchdata> may contain
- for watchpoints on variables:
- - each of these &lt;watch*> tags conatins a type attribute whose value is either "old" or "new")
+ - each of these &lt;watch*> tags contains a type attribute whose value is either "old" or "new")
- &lt;watchvalue type="" inaccessible="inaccessible" />: old value is inaccessible
- &lt;watchvalue type=""> may contain a &lt;stream> element which indicates the old/new (type attribute) value of the variable
- &lt;watchrefcount type="" refcount="" isref="" />: old/new (type attribute) refcount and isref, both numbers