diff options
Diffstat (limited to 'sapi/phpdbg')
45 files changed, 1317 insertions, 1438 deletions
diff --git a/sapi/phpdbg/phpdbg.c b/sapi/phpdbg/phpdbg.c index c624669785..70b3371341 100644 --- a/sapi/phpdbg/phpdbg.c +++ b/sapi/phpdbg/phpdbg.c @@ -53,7 +53,7 @@ static PHP_INI_MH(OnUpdateEol) return FAILURE; } - return phpdbg_eol_global_update(new_value->val TSRMLS_CC); + return phpdbg_eol_global_update(new_value->val); } PHP_INI_BEGIN() @@ -64,9 +64,9 @@ PHP_INI_END() static zend_bool phpdbg_booted = 0; #if PHP_VERSION_ID >= 50500 -void (*zend_execute_old)(zend_execute_data *execute_data TSRMLS_DC); +void (*zend_execute_old)(zend_execute_data *execute_data); #else -void (*zend_execute_old)(zend_op_array *op_array TSRMLS_DC); +void (*zend_execute_old)(zend_op_array *op_array); #endif static inline void php_phpdbg_globals_ctor(zend_phpdbg_globals *pg) /* {{{ */ @@ -164,9 +164,8 @@ static void php_phpdbg_destroy_bp_condition(zval *data) /* {{{ */ if (brake) { if (brake->ops) { - TSRMLS_FETCH(); - - destroy_op_array(brake->ops TSRMLS_CC); + + destroy_op_array(brake->ops); efree(brake->ops); } efree((char*) brake->code); @@ -177,9 +176,8 @@ static void php_phpdbg_destroy_registered(zval *data) /* {{{ */ { zend_function *function = (zend_function *) Z_PTR_P(data); - TSRMLS_FETCH(); - destroy_zend_function(function TSRMLS_CC); + destroy_zend_function(function); } /* }}} */ @@ -248,7 +246,7 @@ static PHP_RSHUTDOWN_FUNCTION(phpdbg) /* {{{ */ } if (PHPDBG_G(ops)) { - destroy_op_array(PHPDBG_G(ops) TSRMLS_CC); + destroy_op_array(PHPDBG_G(ops)); efree(PHPDBG_G(ops)); PHPDBG_G(ops) = NULL; } @@ -265,7 +263,7 @@ static PHP_FUNCTION(phpdbg_exec) { zend_string *exec; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &exec) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &exec) == FAILURE) { return; } @@ -307,7 +305,7 @@ static PHP_FUNCTION(phpdbg_break_next) return; } - phpdbg_set_breakpoint_opline_ex((phpdbg_opline_ptr_t) EG(current_execute_data)->opline + 1 TSRMLS_CC); + phpdbg_set_breakpoint_opline_ex((phpdbg_opline_ptr_t) EG(current_execute_data)->opline + 1); } /* }}} */ /* {{{ proto void phpdbg_break_file(string file, integer line) */ @@ -317,11 +315,11 @@ static PHP_FUNCTION(phpdbg_break_file) size_t flen = 0; long line; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sl", &file, &flen, &line) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "sl", &file, &flen, &line) == FAILURE) { return; } - phpdbg_set_breakpoint_file(file, line TSRMLS_CC); + phpdbg_set_breakpoint_file(file, line); } /* }}} */ /* {{{ proto void phpdbg_break_method(string class, string method) */ @@ -330,11 +328,11 @@ static PHP_FUNCTION(phpdbg_break_method) char *class = NULL, *method = NULL; size_t clen = 0, mlen = 0; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &class, &clen, &method, &mlen) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss", &class, &clen, &method, &mlen) == FAILURE) { return; } - phpdbg_set_breakpoint_method(class, method TSRMLS_CC); + phpdbg_set_breakpoint_method(class, method); } /* }}} */ /* {{{ proto void phpdbg_break_function(string function) */ @@ -343,11 +341,11 @@ static PHP_FUNCTION(phpdbg_break_function) char *function = NULL; size_t function_len; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &function, &function_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &function, &function_len) == FAILURE) { return; } - phpdbg_set_breakpoint_symbol(function, function_len TSRMLS_CC); + phpdbg_set_breakpoint_symbol(function, function_len); } /* }}} */ /* {{{ proto void phpdbg_clear(void) @@ -372,7 +370,7 @@ static PHP_FUNCTION(phpdbg_color) char *color = NULL; size_t color_len = 0; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ls", &element, &color, &color_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "ls", &element, &color, &color_len) == FAILURE) { return; } @@ -380,7 +378,7 @@ static PHP_FUNCTION(phpdbg_color) case PHPDBG_COLOR_NOTICE: case PHPDBG_COLOR_ERROR: case PHPDBG_COLOR_PROMPT: - phpdbg_set_color_ex(element, color, color_len TSRMLS_CC); + phpdbg_set_color_ex(element, color, color_len); break; default: zend_error(E_ERROR, "phpdbg detected an incorrect color constant"); @@ -393,11 +391,11 @@ static PHP_FUNCTION(phpdbg_prompt) char *prompt = NULL; size_t prompt_len = 0; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &prompt, &prompt_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &prompt, &prompt_len) == FAILURE) { return; } - phpdbg_set_prompt(prompt TSRMLS_CC); + phpdbg_set_prompt(prompt); } /* }}} */ ZEND_BEGIN_ARG_INFO_EX(phpdbg_break_next_arginfo, 0, 0, 0) @@ -473,18 +471,18 @@ static inline int php_sapi_phpdbg_module_startup(sapi_module_struct *module) /* return SUCCESS; } /* }}} */ -static char* php_sapi_phpdbg_read_cookies(TSRMLS_D) /* {{{ */ +static char* php_sapi_phpdbg_read_cookies(void) /* {{{ */ { return NULL; } /* }}} */ -static int php_sapi_phpdbg_header_handler(sapi_header_struct *h, sapi_header_op_enum op, sapi_headers_struct *s TSRMLS_DC) /* {{{ */ +static int php_sapi_phpdbg_header_handler(sapi_header_struct *h, sapi_header_op_enum op, sapi_headers_struct *s) /* {{{ */ { return 0; } /* }}} */ -static int php_sapi_phpdbg_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC) /* {{{ */ +static int php_sapi_phpdbg_send_headers(sapi_headers_struct *sapi_headers) /* {{{ */ { /* We do nothing here, this function is needed to prevent that the fallback * header handling is called. */ @@ -492,12 +490,12 @@ static int php_sapi_phpdbg_send_headers(sapi_headers_struct *sapi_headers TSRMLS } /* }}} */ -static void php_sapi_phpdbg_send_header(sapi_header_struct *sapi_header, void *server_context TSRMLS_DC) /* {{{ */ +static void php_sapi_phpdbg_send_header(sapi_header_struct *sapi_header, void *server_context) /* {{{ */ { } /* }}} */ -static void php_sapi_phpdbg_log_message(char *message TSRMLS_DC) /* {{{ */ +static void php_sapi_phpdbg_log_message(char *message) /* {{{ */ { /* * We must not request TSRM before being boot @@ -517,13 +515,13 @@ static void php_sapi_phpdbg_log_message(char *message TSRMLS_DC) /* {{{ */ case E_USER_ERROR: case E_PARSE: case E_RECOVERABLE_ERROR: { - const char *file_char = zend_get_executed_filename(TSRMLS_C); + 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(TSRMLS_C) - 1, zend_get_executed_lineno(TSRMLS_C) TSRMLS_CC); + phpdbg_list_file(file, 3, zend_get_executed_lineno() - 1, zend_get_executed_lineno()); efree(file); do { - switch (phpdbg_interactive(1 TSRMLS_CC)) { + switch (phpdbg_interactive(1)) { case PHPDBG_LEAVE: case PHPDBG_FINISH: case PHPDBG_UNTIL: @@ -539,7 +537,7 @@ static void php_sapi_phpdbg_log_message(char *message TSRMLS_DC) /* {{{ */ } /* }}} */ -static int php_sapi_phpdbg_deactivate(TSRMLS_D) /* {{{ */ +static int php_sapi_phpdbg_deactivate(void) /* {{{ */ { if ((PHPDBG_G(flags) & PHPDBG_IS_STOPPING) == PHPDBG_IS_CLEANING) { zend_phpdbg_globals *pg = PHPDBG_G(backup) = calloc(1, sizeof(zend_phpdbg_globals)); @@ -566,41 +564,41 @@ static int php_sapi_phpdbg_deactivate(TSRMLS_D) /* {{{ */ } /* }}} */ -static void php_sapi_phpdbg_register_vars(zval *track_vars_array TSRMLS_DC) /* {{{ */ +static void php_sapi_phpdbg_register_vars(zval *track_vars_array) /* {{{ */ { size_t len; char *docroot = ""; /* In phpdbg mode, we consider the environment to be a part of the server variables */ - php_import_environment_variables(track_vars_array TSRMLS_CC); + php_import_environment_variables(track_vars_array); if (PHPDBG_G(exec)) { len = PHPDBG_G(exec_len); - if (sapi_module.input_filter(PARSE_SERVER, "PHP_SELF", &PHPDBG_G(exec), PHPDBG_G(exec_len), &len TSRMLS_CC)) { - php_register_variable("PHP_SELF", PHPDBG_G(exec), track_vars_array TSRMLS_CC); + if (sapi_module.input_filter(PARSE_SERVER, "PHP_SELF", &PHPDBG_G(exec), PHPDBG_G(exec_len), &len)) { + php_register_variable("PHP_SELF", PHPDBG_G(exec), track_vars_array); } - if (sapi_module.input_filter(PARSE_SERVER, "SCRIPT_NAME", &PHPDBG_G(exec), PHPDBG_G(exec_len), &len TSRMLS_CC)) { - php_register_variable("SCRIPT_NAME", PHPDBG_G(exec), track_vars_array TSRMLS_CC); + if (sapi_module.input_filter(PARSE_SERVER, "SCRIPT_NAME", &PHPDBG_G(exec), PHPDBG_G(exec_len), &len)) { + php_register_variable("SCRIPT_NAME", PHPDBG_G(exec), track_vars_array); } - if (sapi_module.input_filter(PARSE_SERVER, "SCRIPT_FILENAME", &PHPDBG_G(exec), PHPDBG_G(exec_len), &len TSRMLS_CC)) { - php_register_variable("SCRIPT_FILENAME", PHPDBG_G(exec), track_vars_array TSRMLS_CC); + if (sapi_module.input_filter(PARSE_SERVER, "SCRIPT_FILENAME", &PHPDBG_G(exec), PHPDBG_G(exec_len), &len)) { + php_register_variable("SCRIPT_FILENAME", PHPDBG_G(exec), track_vars_array); } - if (sapi_module.input_filter(PARSE_SERVER, "PATH_TRANSLATED", &PHPDBG_G(exec), PHPDBG_G(exec_len), &len TSRMLS_CC)) { - php_register_variable("PATH_TRANSLATED", PHPDBG_G(exec), track_vars_array TSRMLS_CC); + if (sapi_module.input_filter(PARSE_SERVER, "PATH_TRANSLATED", &PHPDBG_G(exec), PHPDBG_G(exec_len), &len)) { + php_register_variable("PATH_TRANSLATED", PHPDBG_G(exec), track_vars_array); } } /* any old docroot will do */ len = 0; - if (sapi_module.input_filter(PARSE_SERVER, "DOCUMENT_ROOT", &docroot, len, &len TSRMLS_CC)) { - php_register_variable("DOCUMENT_ROOT", docroot, track_vars_array TSRMLS_CC); + if (sapi_module.input_filter(PARSE_SERVER, "DOCUMENT_ROOT", &docroot, len, &len)) { + php_register_variable("DOCUMENT_ROOT", docroot, track_vars_array); } } /* }}} */ -static inline size_t php_sapi_phpdbg_ub_write(const char *message, size_t length TSRMLS_DC) /* {{{ */ +static inline size_t php_sapi_phpdbg_ub_write(const char *message, size_t length) /* {{{ */ { if (PHPDBG_G(socket_fd) != -1 && !(PHPDBG_G(flags) & PHPDBG_IS_INTERACTIVE)) { send(PHPDBG_G(socket_fd), message, length, 0); @@ -614,7 +612,7 @@ typedef struct { int fd; } php_stdio_stream_data; -static size_t phpdbg_stdiop_write(php_stream *stream, const char *buf, size_t count TSRMLS_DC) { +static size_t phpdbg_stdiop_write(php_stream *stream, const char *buf, size_t count) { php_stdio_stream_data *data = (php_stdio_stream_data*)stream->abstract; while (data->fd >= 0) { @@ -635,25 +633,24 @@ static size_t phpdbg_stdiop_write(php_stream *stream, const char *buf, size_t co break; } - return PHPDBG_G(php_stdiop_write)(stream, buf, count TSRMLS_CC); + return PHPDBG_G(php_stdiop_write)(stream, buf, count); } #if PHP_VERSION_ID >= 50700 -static inline void php_sapi_phpdbg_flush(void *context TSRMLS_DC) /* {{{ */ +static inline void php_sapi_phpdbg_flush(void *context) /* {{{ */ { #else static inline void php_sapi_phpdbg_flush(void *context) /* {{{ */ { - TSRMLS_FETCH(); #endif - if (!phpdbg_active_sigsafe_mem(TSRMLS_C)) { + if (!phpdbg_active_sigsafe_mem()) { fflush(PHPDBG_G(io)[PHPDBG_STDOUT].ptr); } } /* }}} */ /* copied from sapi/cli/php_cli.c cli_register_file_handles */ -static void phpdbg_register_file_handles(TSRMLS_D) /* {{{ */ +static void phpdbg_register_file_handles(void) /* {{{ */ { zval zin, zout, zerr; php_stream *s_in, *s_out, *s_err; @@ -685,19 +682,19 @@ static void phpdbg_register_file_handles(TSRMLS_D) /* {{{ */ ic.flags = CONST_CS; ic.name = zend_string_init(ZEND_STRL("STDIN"), 0); ic.module_number = 0; - zend_register_constant(&ic TSRMLS_CC); + zend_register_constant(&ic); oc.value = zout; oc.flags = CONST_CS; oc.name = zend_string_init(ZEND_STRL("STDOUT"), 0); oc.module_number = 0; - zend_register_constant(&oc TSRMLS_CC); + zend_register_constant(&oc); ec.value = zerr; ec.flags = CONST_CS; ec.name = zend_string_init(ZEND_STRL("STDERR"), 0); ec.module_number = 0; - zend_register_constant(&ec TSRMLS_CC); + zend_register_constant(&ec); } /* }}} */ @@ -783,7 +780,7 @@ void phpdbg_ini_defaults(HashTable *configuration_hash) /* {{{ */ INI_DEFAULT("report_zend_debug", "0"); } /* }}} */ -static void phpdbg_welcome(zend_bool cleaning TSRMLS_DC) /* {{{ */ +static void phpdbg_welcome(zend_bool cleaning) /* {{{ */ { /* print blurb */ if (!cleaning) { @@ -811,7 +808,6 @@ static void phpdbg_welcome(zend_bool cleaning TSRMLS_DC) /* {{{ */ static inline void phpdbg_sigint_handler(int signo) /* {{{ */ { - TSRMLS_FETCH(); if (PHPDBG_G(flags) & PHPDBG_IS_INTERACTIVE) { /* we quit remote consoles on recv SIGINT */ @@ -825,11 +821,11 @@ static inline void phpdbg_sigint_handler(int signo) /* {{{ */ if (PHPDBG_G(flags) & PHPDBG_IS_SIGNALED) { char mem[PHPDBG_SIGSAFE_MEM_SIZE + 1]; - phpdbg_set_sigsafe_mem(mem TSRMLS_CC); + phpdbg_set_sigsafe_mem(mem); zend_try { - phpdbg_force_interruption(TSRMLS_C); + phpdbg_force_interruption(); } zend_end_try() - phpdbg_clear_sigsafe_mem(TSRMLS_C); + phpdbg_clear_sigsafe_mem(); return; } PHPDBG_G(flags) |= PHPDBG_IS_SIGNALED; @@ -848,7 +844,7 @@ static void phpdbg_remote_close(int socket, FILE *stream) { } /* don't inline this, want to debug it easily, will inline when done */ -static int phpdbg_remote_init(const char* address, unsigned short port, int server, int *socket, FILE **stream TSRMLS_DC) { +static int phpdbg_remote_init(const char* address, unsigned short port, int server, int *socket, FILE **stream) { phpdbg_remote_close(*socket, *stream); if (server < 0) { @@ -890,7 +886,6 @@ void phpdbg_sigio_handler(int sig, siginfo_t *info, void *context) /* {{{ */ int flags; size_t newlen; size_t i/*, last_nl*/; - TSRMLS_FETCH(); // if (!(info->si_band & POLLIN)) { // return; /* Not interested in writeablility etc., just interested in incoming data */ @@ -914,11 +909,11 @@ void phpdbg_sigio_handler(int sig, siginfo_t *info, void *context) /* {{{ */ break; /* or quit ??? */ } if (PHPDBG_G(flags) & PHPDBG_IS_SIGNALED) { - phpdbg_set_sigsafe_mem(mem TSRMLS_CC); + phpdbg_set_sigsafe_mem(mem); zend_try { - phpdbg_force_interruption(TSRMLS_C); + phpdbg_force_interruption(); } zend_end_try(); - phpdbg_clear_sigsafe_mem(TSRMLS_C); + phpdbg_clear_sigsafe_mem(); break; } if (!(PHPDBG_G(flags) & PHPDBG_IS_INTERACTIVE)) { @@ -941,7 +936,6 @@ void phpdbg_sigio_handler(int sig, siginfo_t *info, void *context) /* {{{ */ void phpdbg_signal_handler(int sig, siginfo_t *info, void *context) /* {{{ */ { int is_handled = FAILURE; - TSRMLS_FETCH(); switch (sig) { case SIGBUS: @@ -949,10 +943,10 @@ void phpdbg_signal_handler(int sig, siginfo_t *info, void *context) /* {{{ */ if (PHPDBG_G(sigsegv_bailout)) { LONGJMP(*PHPDBG_G(sigsegv_bailout), FAILURE); } - is_handled = phpdbg_watchpoint_segfault_handler(info, context TSRMLS_CC); + is_handled = phpdbg_watchpoint_segfault_handler(info, context); if (is_handled == FAILURE) { #ifdef ZEND_SIGNALS - zend_sigaction(sig, &PHPDBG_G(old_sigsegv_signal), NULL TSRMLS_CC); + zend_sigaction(sig, &PHPDBG_G(old_sigsegv_signal), NULL); #else sigaction(sig, &PHPDBG_G(old_sigsegv_signal), NULL); #endif @@ -967,10 +961,9 @@ static inline zend_mm_heap *phpdbg_mm_get_heap() /* {{{ */ { zend_mm_heap *mm_heap; - TSRMLS_FETCH(); - mm_heap = zend_mm_set_heap(NULL TSRMLS_CC); - zend_mm_set_heap(mm_heap TSRMLS_CC); + mm_heap = zend_mm_set_heap(NULL); + zend_mm_set_heap(mm_heap); return mm_heap; } /* }}} */ @@ -1205,7 +1198,7 @@ phpdbg_main: PHP_VERSION, get_zend_version() ); - sapi_deactivate(TSRMLS_C); + sapi_deactivate(); sapi_shutdown(); return 0; } break; @@ -1295,8 +1288,8 @@ phpdbg_main: /* setup remote server if necessary */ if (cleaning <= 0 && listen > 0) { - server = phpdbg_open_socket(address, listen TSRMLS_CC); - if (-1 > server || phpdbg_remote_init(address, listen, server, &socket, &stream TSRMLS_CC) == FAILURE) { + server = phpdbg_open_socket(address, listen); + if (-1 > server || phpdbg_remote_init(address, listen, server, &socket, &stream) == FAILURE) { exit(0); } @@ -1321,26 +1314,26 @@ phpdbg_main: _free = phpdbg_free_wrapper; } - zend_activate(TSRMLS_C); + zend_activate(); - phpdbg_init_list(TSRMLS_C); + phpdbg_init_list(); PHPDBG_G(original_free_function) = _free; _free = phpdbg_watch_efree; zend_mm_set_custom_handlers(mm_heap, _malloc, _free, _realloc); - phpdbg_setup_watchpoints(TSRMLS_C); + phpdbg_setup_watchpoints(); #if defined(ZEND_SIGNALS) && !defined(_WIN32) zend_try { - zend_signal_activate(TSRMLS_C); + zend_signal_activate(); } zend_end_try(); #endif #if defined(ZEND_SIGNALS) && !defined(_WIN32) - zend_try { zend_sigaction(SIGSEGV, &signal_struct, &PHPDBG_G(old_sigsegv_signal) TSRMLS_CC); } zend_end_try(); - zend_try { zend_sigaction(SIGBUS, &signal_struct, &PHPDBG_G(old_sigsegv_signal) TSRMLS_CC); } zend_end_try(); + zend_try { zend_sigaction(SIGSEGV, &signal_struct, &PHPDBG_G(old_sigsegv_signal)); } zend_end_try(); + zend_try { zend_sigaction(SIGBUS, &signal_struct, &PHPDBG_G(old_sigsegv_signal)); } zend_end_try(); #elif !defined(_WIN32) sigaction(SIGSEGV, &signal_struct, &PHPDBG_G(old_sigsegv_signal)); sigaction(SIGBUS, &signal_struct, &PHPDBG_G(old_sigsegv_signal)); @@ -1348,12 +1341,12 @@ phpdbg_main: PHPDBG_G(sapi_name_ptr) = sapi_name; - php_output_activate(TSRMLS_C); - php_output_deactivate(TSRMLS_C); + php_output_activate(); + php_output_deactivate(); - php_output_activate(TSRMLS_C); + php_output_activate(); - if (php_request_startup(TSRMLS_C) == SUCCESS) { + if (php_request_startup() == SUCCESS) { int i; SG(request_info).argc = argc - php_optind + 1; @@ -1363,7 +1356,7 @@ phpdbg_main: } SG(request_info).argv[i] = exec ? estrdup(exec) : estrdup(""); - php_hash_environment(TSRMLS_C); + php_hash_environment(); } /* do not install sigint handlers for remote consoles */ @@ -1372,7 +1365,7 @@ phpdbg_main: if (listen < 0) { #endif #if defined(ZEND_SIGNALS) && !defined(_WIN32) - zend_try { zend_signal(SIGINT, phpdbg_sigint_handler TSRMLS_CC); } zend_end_try(); + zend_try { zend_signal(SIGINT, phpdbg_sigint_handler); } zend_end_try(); #else signal(SIGINT, phpdbg_sigint_handler); #endif @@ -1423,7 +1416,7 @@ phpdbg_main: #endif if (exec) { /* set execution context */ - PHPDBG_G(exec) = phpdbg_resolve_path(exec TSRMLS_CC); + PHPDBG_G(exec) = phpdbg_resolve_path(exec); PHPDBG_G(exec_len) = PHPDBG_G(exec) ? strlen(PHPDBG_G(exec)) : 0; free(exec); @@ -1439,19 +1432,19 @@ phpdbg_main: } /* set default colors */ - phpdbg_set_color_ex(PHPDBG_COLOR_PROMPT, PHPDBG_STRL("white-bold") TSRMLS_CC); - phpdbg_set_color_ex(PHPDBG_COLOR_ERROR, PHPDBG_STRL("red-bold") TSRMLS_CC); - phpdbg_set_color_ex(PHPDBG_COLOR_NOTICE, PHPDBG_STRL("green") TSRMLS_CC); + phpdbg_set_color_ex(PHPDBG_COLOR_PROMPT, PHPDBG_STRL("white-bold")); + 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 TSRMLS_CC); + phpdbg_set_prompt(PHPDBG_DEFAULT_PROMPT); /* Make stdin, stdout and stderr accessible from PHP scripts */ - phpdbg_register_file_handles(TSRMLS_C); + phpdbg_register_file_handles(); if (show_banner && cleaning < 2) { /* print blurb */ - phpdbg_welcome(cleaning == 1 TSRMLS_CC); + phpdbg_welcome(cleaning == 1); } cleaning = -1; @@ -1459,10 +1452,10 @@ phpdbg_main: /* initialize from file */ PHPDBG_G(flags) |= PHPDBG_IS_INITIALIZING; zend_try { - phpdbg_init(init_file, init_file_len, init_file_default TSRMLS_CC); + phpdbg_init(init_file, init_file_len, init_file_default); if (bp_tmp) { PHPDBG_G(flags) |= PHPDBG_DISCARD_OUTPUT; - phpdbg_string_init(bp_tmp TSRMLS_CC); + phpdbg_string_init(bp_tmp); free(bp_tmp); bp_tmp = NULL; PHPDBG_G(flags) &= ~PHPDBG_DISCARD_OUTPUT; @@ -1480,7 +1473,7 @@ phpdbg_main: if (settings) { PHPDBG_G(flags) |= PHPDBG_DISCARD_OUTPUT; } - phpdbg_compile(TSRMLS_C); + phpdbg_compile(); PHPDBG_G(flags) &= ~PHPDBG_DISCARD_OUTPUT; } @@ -1500,7 +1493,7 @@ phpdbg_interact: if (phpdbg_startup_run) { zend_bool quit_immediately = phpdbg_startup_run > 1; phpdbg_startup_run = 0; - PHPDBG_COMMAND_HANDLER(run)(NULL TSRMLS_CC); + PHPDBG_COMMAND_HANDLER(run)(NULL); if (quit_immediately) { /* if -r is on the command line more than once just quit */ EG(bailout) = __orig_bailout; /* reset zend_try */ @@ -1508,12 +1501,12 @@ phpdbg_interact: } } - phpdbg_interactive(1 TSRMLS_CC); + phpdbg_interactive(1); } zend_catch { if ((PHPDBG_G(flags) & PHPDBG_IS_CLEANING)) { char *bp_tmp_str; PHPDBG_G(flags) |= PHPDBG_DISCARD_OUTPUT; - phpdbg_export_breakpoints_to_string(&bp_tmp_str TSRMLS_CC); + phpdbg_export_breakpoints_to_string(&bp_tmp_str); PHPDBG_G(flags) &= ~PHPDBG_DISCARD_OUTPUT; if (bp_tmp_str) { bp_tmp = strdup(bp_tmp_str); @@ -1531,7 +1524,7 @@ phpdbg_interact: if (PHPDBG_G(flags) & PHPDBG_IS_REMOTE) { /* renegociate connections */ - phpdbg_remote_init(address, listen, server, &socket, &stream TSRMLS_CC); + phpdbg_remote_init(address, listen, server, &socket, &stream); /* set streams */ if (stream) { @@ -1615,8 +1608,8 @@ phpdbg_out: PG(report_memleaks) = 0; if ((PHPDBG_G(flags) & (PHPDBG_IS_CLEANING | PHPDBG_IS_RUNNING)) == PHPDBG_IS_CLEANING) { - php_free_shutdown_functions(TSRMLS_C); - zend_objects_store_mark_destructed(&EG(objects_store) TSRMLS_CC); + php_free_shutdown_functions(); + zend_objects_store_mark_destructed(&EG(objects_store)); } /* sapi_module.deactivate is where to backup things, last chance before mm_shutdown... */ @@ -1634,10 +1627,10 @@ phpdbg_out: settings = PHPDBG_G(backup); } - php_output_deactivate(TSRMLS_C); + php_output_deactivate(); zend_try { - php_module_shutdown(TSRMLS_C); + php_module_shutdown(); } zend_end_try(); sapi_shutdown(); diff --git a/sapi/phpdbg/phpdbg.h b/sapi/phpdbg/phpdbg.h index a6d4935d45..672e75f814 100644 --- a/sapi/phpdbg/phpdbg.h +++ b/sapi/phpdbg/phpdbg.h @@ -134,7 +134,7 @@ # include "phpdbg_sigio_win32.h" #endif -int phpdbg_do_parse(phpdbg_param_t *stack, char *input TSRMLS_DC); +int phpdbg_do_parse(phpdbg_param_t *stack, char *input); #define PHPDBG_NEXT 2 #define PHPDBG_UNTIL 3 @@ -257,7 +257,7 @@ ZEND_BEGIN_MODULE_GLOBALS(phpdbg) int vmret; /* return from last opcode handler execution */ zend_bool in_execution; /* in execution? */ - zend_op_array *(*compile_file)(zend_file_handle *file_handle, int type TSRMLS_DC); + zend_op_array *(*compile_file)(zend_file_handle *file_handle, int type); HashTable file_sources; FILE *oplog; /* opline log */ @@ -266,7 +266,7 @@ ZEND_BEGIN_MODULE_GLOBALS(phpdbg) int fd; } io[PHPDBG_IO_FDS]; /* io */ int eol; /* type of line ending to use */ - size_t (*php_stdiop_write)(php_stream *, const char *, size_t TSRMLS_DC); + size_t (*php_stdiop_write)(php_stream *, const char *, size_t); int in_script_xml; /* in <stream> output mode */ struct { zend_bool active; diff --git a/sapi/phpdbg/phpdbg_bp.c b/sapi/phpdbg/phpdbg_bp.c index cd40510c79..ac5ba34714 100644 --- a/sapi/phpdbg/phpdbg_bp.c +++ b/sapi/phpdbg/phpdbg_bp.c @@ -29,24 +29,24 @@ ZEND_EXTERN_MODULE_GLOBALS(phpdbg); /* {{{ private api functions */ -static inline phpdbg_breakbase_t *phpdbg_find_breakpoint_file(zend_op_array* TSRMLS_DC); -static inline phpdbg_breakbase_t *phpdbg_find_breakpoint_symbol(zend_function* TSRMLS_DC); -static inline phpdbg_breakbase_t *phpdbg_find_breakpoint_method(zend_op_array* TSRMLS_DC); -static inline phpdbg_breakbase_t *phpdbg_find_breakpoint_opline(phpdbg_opline_ptr_t TSRMLS_DC); -static inline phpdbg_breakbase_t *phpdbg_find_breakpoint_opcode(zend_uchar TSRMLS_DC); -static inline phpdbg_breakbase_t *phpdbg_find_conditional_breakpoint(zend_execute_data *execute_data TSRMLS_DC); /* }}} */ +static inline phpdbg_breakbase_t *phpdbg_find_breakpoint_file(zend_op_array*); +static inline phpdbg_breakbase_t *phpdbg_find_breakpoint_symbol(zend_function*); +static inline phpdbg_breakbase_t *phpdbg_find_breakpoint_method(zend_op_array*); +static inline phpdbg_breakbase_t *phpdbg_find_breakpoint_opline(phpdbg_opline_ptr_t); +static inline phpdbg_breakbase_t *phpdbg_find_breakpoint_opcode(zend_uchar); +static inline phpdbg_breakbase_t *phpdbg_find_conditional_breakpoint(zend_execute_data *execute_data); /* }}} */ /* * Note: * A break point must always set the correct id and type * A set breakpoint function must always map new points */ -static inline void _phpdbg_break_mapping(int id, HashTable *table TSRMLS_DC) +static inline void _phpdbg_break_mapping(int id, HashTable *table) { zend_hash_index_update_ptr(&PHPDBG_G(bp)[PHPDBG_BREAK_MAP], id, table); } -#define PHPDBG_BREAK_MAPPING(id, table) _phpdbg_break_mapping(id, table TSRMLS_CC) +#define PHPDBG_BREAK_MAPPING(id, table) _phpdbg_break_mapping(id, table) #define PHPDBG_BREAK_UNMAPPING(id) \ zend_hash_index_del(&PHPDBG_G(bp)[PHPDBG_BREAK_MAP], (id)) @@ -89,7 +89,7 @@ static void phpdbg_opline_breaks_dtor(zval *data) /* {{{ */ } } /* }}} */ -PHPDBG_API void phpdbg_reset_breakpoints(TSRMLS_D) /* {{{ */ +PHPDBG_API void phpdbg_reset_breakpoints(void) /* {{{ */ { HashTable *table; @@ -102,14 +102,14 @@ PHPDBG_API void phpdbg_reset_breakpoints(TSRMLS_D) /* {{{ */ } ZEND_HASH_FOREACH_END(); } /* }}} */ -PHPDBG_API void phpdbg_export_breakpoints(FILE *handle TSRMLS_DC) /* {{{ */ +PHPDBG_API void phpdbg_export_breakpoints(FILE *handle) /* {{{ */ { char *string; - phpdbg_export_breakpoints_to_string(&string TSRMLS_CC); + phpdbg_export_breakpoints_to_string(&string); fputs(string, handle); } -PHPDBG_API void phpdbg_export_breakpoints_to_string(char **str TSRMLS_DC) /* {{{ */ +PHPDBG_API void phpdbg_export_breakpoints_to_string(char **str) /* {{{ */ { HashTable *table; zend_ulong id = 0L; @@ -222,7 +222,7 @@ PHPDBG_API void phpdbg_export_breakpoints_to_string(char **str TSRMLS_DC) /* {{{ } } /* }}} */ -PHPDBG_API void phpdbg_set_breakpoint_file(const char *path, long line_num TSRMLS_DC) /* {{{ */ +PHPDBG_API void phpdbg_set_breakpoint_file(const char *path, long line_num) /* {{{ */ { php_stream_statbuf ssb; char realpath[MAXPATHLEN]; @@ -282,7 +282,7 @@ PHPDBG_API void phpdbg_set_breakpoint_file(const char *path, long line_num TSRML phpdbg_debug("Compare against loaded %s\n", file); - if (!(pending = ((fileht = phpdbg_resolve_pending_file_break_ex(file->val, file->len, path_str, broken TSRMLS_CC)) == NULL))) { + if (!(pending = ((fileht = phpdbg_resolve_pending_file_break_ex(file->val, file->len, path_str, broken)) == NULL))) { new_break = *(phpdbg_breakfile_t *) zend_hash_index_find_ptr(broken, line_num); break; } @@ -304,7 +304,7 @@ PHPDBG_API void phpdbg_set_breakpoint_file(const char *path, long line_num TSRML } } /* }}} */ -PHPDBG_API HashTable *phpdbg_resolve_pending_file_break_ex(const char *file, uint filelen, zend_string *cur, HashTable *fileht TSRMLS_DC) /* {{{ */ +PHPDBG_API HashTable *phpdbg_resolve_pending_file_break_ex(const char *file, uint filelen, zend_string *cur, HashTable *fileht) /* {{{ */ { phpdbg_debug("file: %s, filelen: %u, cur: %s, curlen %u, pos: %c, memcmp: %d\n", file, filelen, cur, curlen, filelen > curlen ? file[filelen - curlen - 1] : '?', filelen > curlen ? memcmp(file + filelen - curlen, cur, curlen) : 0); @@ -345,7 +345,7 @@ PHPDBG_API HashTable *phpdbg_resolve_pending_file_break_ex(const char *file, uin return NULL; } /* }}} */ -PHPDBG_API void phpdbg_resolve_pending_file_break(const char *file TSRMLS_DC) /* {{{ */ +PHPDBG_API void phpdbg_resolve_pending_file_break(const char *file) /* {{{ */ { HashTable *fileht; uint filelen = strlen(file); @@ -356,11 +356,11 @@ PHPDBG_API void phpdbg_resolve_pending_file_break(const char *file TSRMLS_DC) /* ZEND_HASH_FOREACH_STR_KEY_PTR(&PHPDBG_G(bp)[PHPDBG_BREAK_FILE_PENDING], cur, fileht) { phpdbg_debug("check bp: %s\n", cur); - phpdbg_resolve_pending_file_break_ex(file, filelen, cur, fileht TSRMLS_CC); + phpdbg_resolve_pending_file_break_ex(file, filelen, cur, fileht); } ZEND_HASH_FOREACH_END(); } /* }}} */ -PHPDBG_API void phpdbg_set_breakpoint_symbol(const char *name, size_t name_len TSRMLS_DC) /* {{{ */ +PHPDBG_API void phpdbg_set_breakpoint_symbol(const char *name, size_t name_len) /* {{{ */ { if (!zend_hash_str_exists(&PHPDBG_G(bp)[PHPDBG_BREAK_SYM], name, name_len)) { phpdbg_breaksymbol_t new_break; @@ -380,7 +380,7 @@ PHPDBG_API void phpdbg_set_breakpoint_symbol(const char *name, size_t name_len T } } /* }}} */ -PHPDBG_API void phpdbg_set_breakpoint_method(const char *class_name, const char *func_name TSRMLS_DC) /* {{{ */ +PHPDBG_API void phpdbg_set_breakpoint_method(const char *class_name, const char *func_name) /* {{{ */ { HashTable class_breaks, *class_table; size_t class_len = strlen(class_name); @@ -415,7 +415,7 @@ PHPDBG_API void phpdbg_set_breakpoint_method(const char *class_name, const char efree(lcname); } /* }}} */ -PHPDBG_API void phpdbg_set_breakpoint_opline(zend_ulong opline TSRMLS_DC) /* {{{ */ +PHPDBG_API void phpdbg_set_breakpoint_opline(zend_ulong opline) /* {{{ */ { if (!zend_hash_index_exists(&PHPDBG_G(bp)[PHPDBG_BREAK_OPLINE], opline)) { phpdbg_breakline_t new_break; @@ -436,7 +436,7 @@ PHPDBG_API void phpdbg_set_breakpoint_opline(zend_ulong opline TSRMLS_DC) /* {{{ } } /* }}} */ -PHPDBG_API int phpdbg_resolve_op_array_break(phpdbg_breakopline_t *brake, zend_op_array *op_array TSRMLS_DC) /* {{{ */ +PHPDBG_API int phpdbg_resolve_op_array_break(phpdbg_breakopline_t *brake, zend_op_array *op_array) /* {{{ */ { phpdbg_breakline_t opline_break; if (op_array->last <= brake->opline_num) { @@ -472,7 +472,7 @@ PHPDBG_API int phpdbg_resolve_op_array_break(phpdbg_breakopline_t *brake, zend_o return SUCCESS; } /* }}} */ -PHPDBG_API void phpdbg_resolve_op_array_breaks(zend_op_array *op_array TSRMLS_DC) /* {{{ */ +PHPDBG_API void phpdbg_resolve_op_array_breaks(zend_op_array *op_array) /* {{{ */ { HashTable *func_table = &PHPDBG_G(bp)[PHPDBG_BREAK_FUNCTION_OPLINE]; HashTable *oplines_table; @@ -491,7 +491,7 @@ PHPDBG_API void phpdbg_resolve_op_array_breaks(zend_op_array *op_array TSRMLS_DC } ZEND_HASH_FOREACH_PTR(oplines_table, brake) { - if (phpdbg_resolve_op_array_break(brake, op_array TSRMLS_CC) == SUCCESS) { + if (phpdbg_resolve_op_array_break(brake, op_array) == SUCCESS) { phpdbg_breakline_t *opline_break; zend_hash_internal_pointer_end(&PHPDBG_G(bp)[PHPDBG_BREAK_OPLINE]); @@ -508,7 +508,7 @@ PHPDBG_API void phpdbg_resolve_op_array_breaks(zend_op_array *op_array TSRMLS_DC } ZEND_HASH_FOREACH_END(); } /* }}} */ -PHPDBG_API int phpdbg_resolve_opline_break(phpdbg_breakopline_t *new_break TSRMLS_DC) /* {{{ */ +PHPDBG_API int phpdbg_resolve_opline_break(phpdbg_breakopline_t *new_break) /* {{{ */ { HashTable *func_table = EG(function_table); zend_function *func; @@ -516,7 +516,7 @@ PHPDBG_API int phpdbg_resolve_opline_break(phpdbg_breakopline_t *new_break TSRML if (new_break->func_name == NULL) { if (EG(current_execute_data) == NULL) { if (PHPDBG_G(ops) != NULL && !memcmp(PHPDBG_G(ops)->filename, new_break->class_name, new_break->class_len)) { - if (phpdbg_resolve_op_array_break(new_break, PHPDBG_G(ops) TSRMLS_CC) == SUCCESS) { + if (phpdbg_resolve_op_array_break(new_break, PHPDBG_G(ops)) == SUCCESS) { return SUCCESS; } else { return 2; @@ -528,7 +528,7 @@ PHPDBG_API int phpdbg_resolve_opline_break(phpdbg_breakopline_t *new_break TSRML do { zend_op_array *op_array = &execute_data->func->op_array; if (op_array->function_name == NULL && op_array->scope == NULL && new_break->class_len == op_array->filename->len && !memcmp(op_array->filename->val, new_break->class_name, new_break->class_len)) { - if (phpdbg_resolve_op_array_break(new_break, op_array TSRMLS_CC) == SUCCESS) { + if (phpdbg_resolve_op_array_break(new_break, op_array) == SUCCESS) { return SUCCESS; } else { return 2; @@ -564,14 +564,14 @@ PHPDBG_API int phpdbg_resolve_opline_break(phpdbg_breakopline_t *new_break TSRML return 2; } - if (phpdbg_resolve_op_array_break(new_break, &func->op_array TSRMLS_CC) == FAILURE) { + if (phpdbg_resolve_op_array_break(new_break, &func->op_array) == FAILURE) { return 2; } return SUCCESS; } /* }}} */ -PHPDBG_API void phpdbg_set_breakpoint_method_opline(const char *class, const char *method, zend_ulong opline TSRMLS_DC) /* {{{ */ +PHPDBG_API void phpdbg_set_breakpoint_method_opline(const char *class, const char *method, zend_ulong opline) /* {{{ */ { phpdbg_breakopline_t new_break; HashTable class_breaks, *class_table; @@ -585,7 +585,7 @@ PHPDBG_API void phpdbg_set_breakpoint_method_opline(const char *class, const cha new_break.opline_num = opline; new_break.opline = 0; - switch (phpdbg_resolve_opline_break(&new_break TSRMLS_CC)) { + switch (phpdbg_resolve_opline_break(&new_break)) { case FAILURE: phpdbg_notice("breakpoint", "pending=\"pending\" id=\"%d\" method=\"%::%s\" num=\"%ld\"", "Pending breakpoint #%d at %s::%s#%ld", new_break.id, new_break.class_name, new_break.func_name, opline); break; @@ -623,7 +623,7 @@ PHPDBG_API void phpdbg_set_breakpoint_method_opline(const char *class, const cha zend_hash_index_update_mem(method_table, opline, &new_break, sizeof(phpdbg_breakopline_t)); } -PHPDBG_API void phpdbg_set_breakpoint_function_opline(const char *function, zend_ulong opline TSRMLS_DC) /* {{{ */ +PHPDBG_API void phpdbg_set_breakpoint_function_opline(const char *function, zend_ulong opline) /* {{{ */ { phpdbg_breakopline_t new_break; HashTable func_breaks, *func_table; @@ -636,7 +636,7 @@ PHPDBG_API void phpdbg_set_breakpoint_function_opline(const char *function, zend new_break.opline_num = opline; new_break.opline = 0; - switch (phpdbg_resolve_opline_break(&new_break TSRMLS_CC)) { + switch (phpdbg_resolve_opline_break(&new_break)) { case FAILURE: phpdbg_notice("breakpoint", "pending=\"pending\" id=\"%d\" function=\"%s\" num=\"%ld\"", "Pending breakpoint #%d at %s#%ld", new_break.id, new_break.func_name, opline); break; @@ -668,7 +668,7 @@ PHPDBG_API void phpdbg_set_breakpoint_function_opline(const char *function, zend zend_hash_index_update_mem(func_table, opline, &new_break, sizeof(phpdbg_breakopline_t)); } -PHPDBG_API void phpdbg_set_breakpoint_file_opline(const char *file, zend_ulong opline TSRMLS_DC) /* {{{ */ +PHPDBG_API void phpdbg_set_breakpoint_file_opline(const char *file, zend_ulong opline) /* {{{ */ { phpdbg_breakopline_t new_break; HashTable file_breaks, *file_table; @@ -681,7 +681,7 @@ PHPDBG_API void phpdbg_set_breakpoint_file_opline(const char *file, zend_ulong o new_break.opline_num = opline; new_break.opline = 0; - switch (phpdbg_resolve_opline_break(&new_break TSRMLS_CC)) { + switch (phpdbg_resolve_opline_break(&new_break)) { case FAILURE: phpdbg_notice("breakpoint", "pending=\"pending\" id=\"%d\" file=\"%s\" num=\"%ld\"", "Pending breakpoint #%d at %s:%ld", new_break.id, new_break.class_name, opline); break; @@ -713,7 +713,7 @@ PHPDBG_API void phpdbg_set_breakpoint_file_opline(const char *file, zend_ulong o zend_hash_index_update_mem(file_table, opline, &new_break, sizeof(phpdbg_breakopline_t)); } -PHPDBG_API void phpdbg_set_breakpoint_opcode(const char *name, size_t name_len TSRMLS_DC) /* {{{ */ +PHPDBG_API void phpdbg_set_breakpoint_opcode(const char *name, size_t name_len) /* {{{ */ { phpdbg_breakop_t new_break; zend_ulong hash = zend_hash_func(name, name_len); @@ -735,7 +735,7 @@ PHPDBG_API void phpdbg_set_breakpoint_opcode(const char *name, size_t name_len T PHPDBG_BREAK_MAPPING(new_break.id, &PHPDBG_G(bp)[PHPDBG_BREAK_OPCODE]); } /* }}} */ -PHPDBG_API void phpdbg_set_breakpoint_opline_ex(phpdbg_opline_ptr_t opline TSRMLS_DC) /* {{{ */ +PHPDBG_API void phpdbg_set_breakpoint_opline_ex(phpdbg_opline_ptr_t opline) /* {{{ */ { if (!zend_hash_index_exists(&PHPDBG_G(bp)[PHPDBG_BREAK_OPLINE], (zend_ulong) opline)) { phpdbg_breakline_t new_break; @@ -754,7 +754,7 @@ PHPDBG_API void phpdbg_set_breakpoint_opline_ex(phpdbg_opline_ptr_t opline TSRML } } /* }}} */ -static inline void phpdbg_create_conditional_break(phpdbg_breakcond_t *brake, const phpdbg_param_t *param, const char *expr, size_t expr_len, zend_ulong hash TSRMLS_DC) /* {{{ */ +static inline void phpdbg_create_conditional_break(phpdbg_breakcond_t *brake, const phpdbg_param_t *param, const char *expr, size_t expr_len, zend_ulong hash) /* {{{ */ { phpdbg_breakcond_t new_break; uint32_t cops = CG(compiler_options); @@ -766,7 +766,7 @@ static inline void phpdbg_create_conditional_break(phpdbg_breakcond_t *brake, co if (param) { new_break.paramed = 1; phpdbg_copy_param( - param, &new_break.param TSRMLS_CC); + param, &new_break.param); } else { new_break.paramed = 0; } @@ -785,7 +785,7 @@ static inline void phpdbg_create_conditional_break(phpdbg_breakcond_t *brake, co Z_STRVAL(pv)[Z_STRLEN(pv)] = '\0'; Z_TYPE_INFO(pv) = IS_STRING; - new_break.ops = zend_compile_string(&pv, "Conditional Breakpoint Code" TSRMLS_CC); + new_break.ops = zend_compile_string(&pv, "Conditional Breakpoint Code"); zval_dtor(&pv); @@ -805,20 +805,20 @@ static inline void phpdbg_create_conditional_break(phpdbg_breakcond_t *brake, co CG(compiler_options) = cops; } /* }}} */ -PHPDBG_API void phpdbg_set_breakpoint_expression(const char *expr, size_t expr_len TSRMLS_DC) /* {{{ */ +PHPDBG_API void phpdbg_set_breakpoint_expression(const char *expr, size_t expr_len) /* {{{ */ { zend_ulong expr_hash = zend_inline_hash_func(expr, expr_len); phpdbg_breakcond_t new_break; if (!zend_hash_index_exists(&PHPDBG_G(bp)[PHPDBG_BREAK_COND], expr_hash)) { phpdbg_create_conditional_break( - &new_break, NULL, expr, expr_len, expr_hash TSRMLS_CC); + &new_break, NULL, expr, expr_len, expr_hash); } else { phpdbg_error("breakpoint", "type=\"exists\" expression=\"%s\"", "Conditional break %s exists", expr); } } /* }}} */ -PHPDBG_API void phpdbg_set_breakpoint_at(const phpdbg_param_t *param TSRMLS_DC) /* {{{ */ +PHPDBG_API void phpdbg_set_breakpoint_at(const phpdbg_param_t *param) /* {{{ */ { phpdbg_breakcond_t new_break; phpdbg_param_t *condition; @@ -829,7 +829,7 @@ PHPDBG_API void phpdbg_set_breakpoint_at(const phpdbg_param_t *param TSRMLS_DC) hash = zend_inline_hash_func(condition->str, condition->len); if (!zend_hash_index_exists(&PHPDBG_G(bp)[PHPDBG_BREAK_COND], hash)) { - phpdbg_create_conditional_break(&new_break, param, condition->str, condition->len, hash TSRMLS_CC); + phpdbg_create_conditional_break(&new_break, param, condition->str, condition->len, hash); } else { phpdbg_notice("breakpoint", "type=\"exists\" arg=\"%s\"", "Conditional break %s exists at the specified location", condition->str); } @@ -837,7 +837,7 @@ PHPDBG_API void phpdbg_set_breakpoint_at(const phpdbg_param_t *param TSRMLS_DC) } /* }}} */ -static inline phpdbg_breakbase_t *phpdbg_find_breakpoint_file(zend_op_array *op_array TSRMLS_DC) /* {{{ */ +static inline phpdbg_breakbase_t *phpdbg_find_breakpoint_file(zend_op_array *op_array) /* {{{ */ { HashTable *breaks; phpdbg_breakbase_t *brake; @@ -866,7 +866,7 @@ static inline phpdbg_breakbase_t *phpdbg_find_breakpoint_file(zend_op_array *op_ return NULL; } /* }}} */ -static inline phpdbg_breakbase_t *phpdbg_find_breakpoint_symbol(zend_function *fbc TSRMLS_DC) /* {{{ */ +static inline phpdbg_breakbase_t *phpdbg_find_breakpoint_symbol(zend_function *fbc) /* {{{ */ { const char *fname; size_t flen; @@ -880,7 +880,7 @@ static inline phpdbg_breakbase_t *phpdbg_find_breakpoint_symbol(zend_function *f if (ops->scope) { /* find method breaks here */ - return phpdbg_find_breakpoint_method(ops TSRMLS_CC); + return phpdbg_find_breakpoint_method(ops); } if (ops->function_name) { @@ -894,7 +894,7 @@ static inline phpdbg_breakbase_t *phpdbg_find_breakpoint_symbol(zend_function *f return zend_hash_str_find_ptr(&PHPDBG_G(bp)[PHPDBG_BREAK_SYM], fname, flen); } /* }}} */ -static inline phpdbg_breakbase_t *phpdbg_find_breakpoint_method(zend_op_array *ops TSRMLS_DC) /* {{{ */ +static inline phpdbg_breakbase_t *phpdbg_find_breakpoint_method(zend_op_array *ops) /* {{{ */ { HashTable *class_table; phpdbg_breakbase_t *brake = NULL; @@ -911,7 +911,7 @@ static inline phpdbg_breakbase_t *phpdbg_find_breakpoint_method(zend_op_array *o return brake; } /* }}} */ -static inline phpdbg_breakbase_t *phpdbg_find_breakpoint_opline(phpdbg_opline_ptr_t opline TSRMLS_DC) /* {{{ */ +static inline phpdbg_breakbase_t *phpdbg_find_breakpoint_opline(phpdbg_opline_ptr_t opline) /* {{{ */ { phpdbg_breakline_t *brake; @@ -922,7 +922,7 @@ static inline phpdbg_breakbase_t *phpdbg_find_breakpoint_opline(phpdbg_opline_pt return (phpdbg_breakbase_t *) brake; } /* }}} */ -static inline phpdbg_breakbase_t *phpdbg_find_breakpoint_opcode(zend_uchar opcode TSRMLS_DC) /* {{{ */ +static inline phpdbg_breakbase_t *phpdbg_find_breakpoint_opcode(zend_uchar opcode) /* {{{ */ { const char *opname = phpdbg_decode_opcode(opcode); @@ -933,7 +933,7 @@ static inline phpdbg_breakbase_t *phpdbg_find_breakpoint_opcode(zend_uchar opcod return zend_hash_index_find_ptr(&PHPDBG_G(bp)[PHPDBG_BREAK_OPCODE], zend_hash_func(opname, strlen(opname))); } /* }}} */ -static inline zend_bool phpdbg_find_breakpoint_param(phpdbg_param_t *param, zend_execute_data *execute_data TSRMLS_DC) /* {{{ */ +static inline zend_bool phpdbg_find_breakpoint_param(phpdbg_param_t *param, zend_execute_data *execute_data) /* {{{ */ { zend_function *function = execute_data->func; @@ -960,8 +960,8 @@ static inline zend_bool phpdbg_find_breakpoint_param(phpdbg_param_t *param, zend } break; case FILE_PARAM: { - if (param->file.line == zend_get_executed_lineno(TSRMLS_C)) { - const char *str = zend_get_executed_filename(TSRMLS_C); + if (param->file.line == zend_get_executed_lineno()) { + const char *str = zend_get_executed_filename(); size_t lengths[2] = {strlen(param->file.name), strlen(str)}; if (lengths[0] == lengths[1]) { @@ -1005,7 +1005,7 @@ static inline zend_bool phpdbg_find_breakpoint_param(phpdbg_param_t *param, zend return 0; } /* }}} */ -static inline phpdbg_breakbase_t *phpdbg_find_conditional_breakpoint(zend_execute_data *execute_data TSRMLS_DC) /* {{{ */ +static inline phpdbg_breakbase_t *phpdbg_find_conditional_breakpoint(zend_execute_data *execute_data) /* {{{ */ { phpdbg_breakcond_t *bp; int breakpoint = FAILURE; @@ -1021,20 +1021,20 @@ static inline phpdbg_breakbase_t *phpdbg_find_conditional_breakpoint(zend_execut } if (bp->paramed) { - if (!phpdbg_find_breakpoint_param(&bp->param, execute_data TSRMLS_CC)) { + if (!phpdbg_find_breakpoint_param(&bp->param, execute_data)) { continue; } } EG(no_extensions) = 1; - zend_rebuild_symbol_table(TSRMLS_C); + zend_rebuild_symbol_table(); zend_try { PHPDBG_G(flags) |= PHPDBG_IN_COND_BP; - zend_execute(bp->ops, &retval TSRMLS_CC); + zend_execute(bp->ops, &retval); #if PHP_VERSION_ID >= 50700 - if (zend_is_true(&retval TSRMLS_CC)) { + if (zend_is_true(&retval)) { #else if (zend_is_true(&retval)) { #endif @@ -1056,7 +1056,7 @@ static inline phpdbg_breakbase_t *phpdbg_find_conditional_breakpoint(zend_execut return (breakpoint == SUCCESS) ? ((phpdbg_breakbase_t *) bp) : NULL; } /* }}} */ -PHPDBG_API phpdbg_breakbase_t *phpdbg_find_breakpoint(zend_execute_data *execute_data TSRMLS_DC) /* {{{ */ +PHPDBG_API phpdbg_breakbase_t *phpdbg_find_breakpoint(zend_execute_data *execute_data) /* {{{ */ { phpdbg_breakbase_t *base = NULL; @@ -1067,28 +1067,28 @@ PHPDBG_API phpdbg_breakbase_t *phpdbg_find_breakpoint(zend_execute_data *execute /* conditions cannot be executed by eval()'d code */ if (!(PHPDBG_G(flags) & PHPDBG_IN_EVAL) && (PHPDBG_G(flags) & PHPDBG_HAS_COND_BP) && - (base = phpdbg_find_conditional_breakpoint(execute_data TSRMLS_CC))) { + (base = phpdbg_find_conditional_breakpoint(execute_data))) { goto result; } - if ((PHPDBG_G(flags) & PHPDBG_HAS_FILE_BP) && (base = phpdbg_find_breakpoint_file(&execute_data->func->op_array TSRMLS_CC))) { + if ((PHPDBG_G(flags) & PHPDBG_HAS_FILE_BP) && (base = phpdbg_find_breakpoint_file(&execute_data->func->op_array))) { goto result; } if (PHPDBG_G(flags) & (PHPDBG_HAS_METHOD_BP|PHPDBG_HAS_SYM_BP)) { /* check we are at the beginning of the stack */ if (execute_data->opline == execute_data->func->op_array.opcodes) { - if ((base = phpdbg_find_breakpoint_symbol(execute_data->func TSRMLS_CC))) { + if ((base = phpdbg_find_breakpoint_symbol(execute_data->func))) { goto result; } } } - if ((PHPDBG_G(flags) & PHPDBG_HAS_OPLINE_BP) && (base = phpdbg_find_breakpoint_opline((phpdbg_opline_ptr_t) execute_data->opline TSRMLS_CC))) { + if ((PHPDBG_G(flags) & PHPDBG_HAS_OPLINE_BP) && (base = phpdbg_find_breakpoint_opline((phpdbg_opline_ptr_t) execute_data->opline))) { goto result; } - if ((PHPDBG_G(flags) & PHPDBG_HAS_OPCODE_BP) && (base = phpdbg_find_breakpoint_opcode(execute_data->opline->opcode TSRMLS_CC))) { + if ((PHPDBG_G(flags) & PHPDBG_HAS_OPCODE_BP) && (base = phpdbg_find_breakpoint_opcode(execute_data->opline->opcode))) { goto result; } @@ -1103,14 +1103,14 @@ result: return base; } /* }}} */ -PHPDBG_API void phpdbg_delete_breakpoint(zend_ulong num TSRMLS_DC) /* {{{ */ +PHPDBG_API void phpdbg_delete_breakpoint(zend_ulong num) /* {{{ */ { HashTable *table; phpdbg_breakbase_t *brake; zend_string *strkey; zend_ulong numkey; - if ((brake = phpdbg_find_breakbase_ex(num, &table, &numkey, &strkey TSRMLS_CC))) { + if ((brake = phpdbg_find_breakbase_ex(num, &table, &numkey, &strkey))) { int type = brake->type; char *name = NULL; size_t name_len = 0L; @@ -1167,7 +1167,7 @@ PHPDBG_API void phpdbg_delete_breakpoint(zend_ulong num TSRMLS_DC) /* {{{ */ } } /* }}} */ -PHPDBG_API void phpdbg_clear_breakpoints(TSRMLS_D) /* {{{ */ +PHPDBG_API void phpdbg_clear_breakpoints(void) /* {{{ */ { zend_hash_clean(&PHPDBG_G(bp)[PHPDBG_BREAK_FILE]); zend_hash_clean(&PHPDBG_G(bp)[PHPDBG_BREAK_FILE_PENDING]); @@ -1186,16 +1186,16 @@ PHPDBG_API void phpdbg_clear_breakpoints(TSRMLS_D) /* {{{ */ PHPDBG_G(bp_count) = 0; } /* }}} */ -PHPDBG_API void phpdbg_hit_breakpoint(phpdbg_breakbase_t *brake, zend_bool output TSRMLS_DC) /* {{{ */ +PHPDBG_API void phpdbg_hit_breakpoint(phpdbg_breakbase_t *brake, zend_bool output) /* {{{ */ { brake->hits++; if (output) { - phpdbg_print_breakpoint(brake TSRMLS_CC); + phpdbg_print_breakpoint(brake); } } /* }}} */ -PHPDBG_API void phpdbg_print_breakpoint(phpdbg_breakbase_t *brake TSRMLS_DC) /* {{{ */ +PHPDBG_API void phpdbg_print_breakpoint(phpdbg_breakbase_t *brake) /* {{{ */ { if (!brake) goto unknown; @@ -1213,8 +1213,8 @@ PHPDBG_API void phpdbg_print_breakpoint(phpdbg_breakbase_t *brake TSRMLS_DC) /* phpdbg_notice("breakpoint", "id=\"%d\" function=\"%s\" file=\"%s\" line=\"%ld\" hits=\"%lu\"", "Breakpoint #%d in %s() at %s:%u, hits: %lu", ((phpdbg_breaksymbol_t*)brake)->id, ((phpdbg_breaksymbol_t*)brake)->symbol, - zend_get_executed_filename(TSRMLS_C), - zend_get_executed_lineno(TSRMLS_C), + zend_get_executed_filename(), + zend_get_executed_lineno(), ((phpdbg_breakfile_t*)brake)->hits); } break; @@ -1222,8 +1222,8 @@ PHPDBG_API void phpdbg_print_breakpoint(phpdbg_breakbase_t *brake TSRMLS_DC) /* phpdbg_notice("breakpoint", "id=\"%d\" opline=\"%#lx\" file=\"%s\" line=\"%ld\" hits=\"%lu\"", "Breakpoint #%d in %#lx at %s:%u, hits: %lu", ((phpdbg_breakline_t*)brake)->id, ((phpdbg_breakline_t*)brake)->opline, - zend_get_executed_filename(TSRMLS_C), - zend_get_executed_lineno(TSRMLS_C), + zend_get_executed_filename(), + zend_get_executed_lineno(), ((phpdbg_breakline_t*)brake)->hits); } break; @@ -1233,8 +1233,8 @@ PHPDBG_API void phpdbg_print_breakpoint(phpdbg_breakbase_t *brake TSRMLS_DC) /* ((phpdbg_breakopline_t*)brake)->class_name, ((phpdbg_breakopline_t*)brake)->func_name, ((phpdbg_breakopline_t*)brake)->opline_num, - zend_get_executed_filename(TSRMLS_C), - zend_get_executed_lineno(TSRMLS_C), + zend_get_executed_filename(), + zend_get_executed_lineno(), ((phpdbg_breakopline_t*)brake)->hits); } break; @@ -1243,8 +1243,8 @@ PHPDBG_API void phpdbg_print_breakpoint(phpdbg_breakbase_t *brake TSRMLS_DC) /* ((phpdbg_breakopline_t*)brake)->id, ((phpdbg_breakopline_t*)brake)->func_name, ((phpdbg_breakopline_t*)brake)->opline_num, - zend_get_executed_filename(TSRMLS_C), - zend_get_executed_lineno(TSRMLS_C), + zend_get_executed_filename(), + zend_get_executed_lineno(), ((phpdbg_breakopline_t*)brake)->hits); } break; @@ -1252,8 +1252,8 @@ PHPDBG_API void phpdbg_print_breakpoint(phpdbg_breakbase_t *brake TSRMLS_DC) /* phpdbg_notice("breakpoint", "id=\"%d\" num=\"%lu\" file=\"%s\" line=\"%ld\" hits=\"%lu\"", "Breakpoint #%d in #%lu at %s:%u, hits: %lu", ((phpdbg_breakopline_t*)brake)->id, ((phpdbg_breakopline_t*)brake)->opline_num, - zend_get_executed_filename(TSRMLS_C), - zend_get_executed_lineno(TSRMLS_C), + zend_get_executed_filename(), + zend_get_executed_lineno(), ((phpdbg_breakopline_t*)brake)->hits); } break; @@ -1261,8 +1261,8 @@ PHPDBG_API void phpdbg_print_breakpoint(phpdbg_breakbase_t *brake TSRMLS_DC) /* phpdbg_notice("breakpoint", "id=\"%d\" opcode=\"%s\" file=\"%s\" line=\"%ld\" hits=\"%lu\"", "Breakpoint #%d in %s at %s:%u, hits: %lu", ((phpdbg_breakop_t*)brake)->id, ((phpdbg_breakop_t*)brake)->name, - zend_get_executed_filename(TSRMLS_C), - zend_get_executed_lineno(TSRMLS_C), + zend_get_executed_filename(), + zend_get_executed_lineno(), ((phpdbg_breakop_t*)brake)->hits); } break; @@ -1271,8 +1271,8 @@ PHPDBG_API void phpdbg_print_breakpoint(phpdbg_breakbase_t *brake TSRMLS_DC) /* ((phpdbg_breakmethod_t*)brake)->id, ((phpdbg_breakmethod_t*)brake)->class_name, ((phpdbg_breakmethod_t*)brake)->func_name, - zend_get_executed_filename(TSRMLS_C), - zend_get_executed_lineno(TSRMLS_C), + zend_get_executed_filename(), + zend_get_executed_lineno(), ((phpdbg_breakmethod_t*)brake)->hits); } break; @@ -1281,10 +1281,10 @@ PHPDBG_API void phpdbg_print_breakpoint(phpdbg_breakbase_t *brake TSRMLS_DC) /* char *param; phpdbg_notice("breakpoint", "id=\"%d\" location=\"%s\" eval=\"%s\" file=\"%s\" line=\"%ld\" hits=\"%lu\"", "Conditional breakpoint #%d: at %s if %s at %s:%u, hits: %lu", ((phpdbg_breakcond_t*)brake)->id, - phpdbg_param_tostring(&((phpdbg_breakcond_t*)brake)->param, ¶m TSRMLS_CC), + phpdbg_param_tostring(&((phpdbg_breakcond_t*)brake)->param, ¶m), ((phpdbg_breakcond_t*)brake)->code, - zend_get_executed_filename(TSRMLS_C), - zend_get_executed_lineno(TSRMLS_C), + zend_get_executed_filename(), + zend_get_executed_lineno(), ((phpdbg_breakcond_t*)brake)->hits); if (param) free(param); @@ -1292,8 +1292,8 @@ PHPDBG_API void phpdbg_print_breakpoint(phpdbg_breakbase_t *brake TSRMLS_DC) /* phpdbg_notice("breakpoint", "id=\"%d\" eval=\"%s\" file=\"%s\" line=\"%ld\" hits=\"%lu\"", "Conditional breakpoint #%d: on %s == true at %s:%u, hits: %lu", ((phpdbg_breakcond_t*)brake)->id, ((phpdbg_breakcond_t*)brake)->code, - zend_get_executed_filename(TSRMLS_C), - zend_get_executed_lineno(TSRMLS_C), + zend_get_executed_filename(), + zend_get_executed_lineno(), ((phpdbg_breakcond_t*)brake)->hits); } @@ -1302,49 +1302,49 @@ PHPDBG_API void phpdbg_print_breakpoint(phpdbg_breakbase_t *brake TSRMLS_DC) /* default: { unknown: phpdbg_notice("breakpoint", "id=\"\" file=\"%s\" line=\"%ld\" hits=\"%lu\"", "Unknown breakpoint at %s:%u", - zend_get_executed_filename(TSRMLS_C), - zend_get_executed_lineno(TSRMLS_C)); + zend_get_executed_filename(), + zend_get_executed_lineno()); } } } /* }}} */ -PHPDBG_API void phpdbg_enable_breakpoint(zend_ulong id TSRMLS_DC) /* {{{ */ +PHPDBG_API void phpdbg_enable_breakpoint(zend_ulong id) /* {{{ */ { - phpdbg_breakbase_t *brake = phpdbg_find_breakbase(id TSRMLS_CC); + phpdbg_breakbase_t *brake = phpdbg_find_breakbase(id); if (brake) { brake->disabled = 0; } } /* }}} */ -PHPDBG_API void phpdbg_disable_breakpoint(zend_ulong id TSRMLS_DC) /* {{{ */ +PHPDBG_API void phpdbg_disable_breakpoint(zend_ulong id) /* {{{ */ { - phpdbg_breakbase_t *brake = phpdbg_find_breakbase(id TSRMLS_CC); + phpdbg_breakbase_t *brake = phpdbg_find_breakbase(id); if (brake) { brake->disabled = 1; } } /* }}} */ -PHPDBG_API void phpdbg_enable_breakpoints(TSRMLS_D) /* {{{ */ +PHPDBG_API void phpdbg_enable_breakpoints(void) /* {{{ */ { PHPDBG_G(flags) |= PHPDBG_IS_BP_ENABLED; } /* }}} */ -PHPDBG_API void phpdbg_disable_breakpoints(TSRMLS_D) { /* {{{ */ +PHPDBG_API void phpdbg_disable_breakpoints(void) { /* {{{ */ PHPDBG_G(flags) &= ~PHPDBG_IS_BP_ENABLED; } /* }}} */ -PHPDBG_API phpdbg_breakbase_t *phpdbg_find_breakbase(zend_ulong id TSRMLS_DC) /* {{{ */ +PHPDBG_API phpdbg_breakbase_t *phpdbg_find_breakbase(zend_ulong id) /* {{{ */ { HashTable *table; zend_string *strkey; zend_ulong numkey; - return phpdbg_find_breakbase_ex(id, &table, &numkey, &strkey TSRMLS_CC); + return phpdbg_find_breakbase_ex(id, &table, &numkey, &strkey); } /* }}} */ -PHPDBG_API phpdbg_breakbase_t *phpdbg_find_breakbase_ex(zend_ulong id, HashTable **table, zend_ulong *numkey, zend_string **strkey TSRMLS_DC) /* {{{ */ +PHPDBG_API phpdbg_breakbase_t *phpdbg_find_breakbase_ex(zend_ulong id, HashTable **table, zend_ulong *numkey, zend_string **strkey) /* {{{ */ { if ((*table = zend_hash_index_find_ptr(&PHPDBG_G(bp)[PHPDBG_BREAK_MAP], id))) { phpdbg_breakbase_t *brake; @@ -1359,7 +1359,7 @@ PHPDBG_API phpdbg_breakbase_t *phpdbg_find_breakbase_ex(zend_ulong id, HashTable return NULL; } /* }}} */ -PHPDBG_API void phpdbg_print_breakpoints(zend_ulong type TSRMLS_DC) /* {{{ */ +PHPDBG_API void phpdbg_print_breakpoints(zend_ulong type) /* {{{ */ { phpdbg_xml("<breakpoints %r>"); diff --git a/sapi/phpdbg/phpdbg_bp.h b/sapi/phpdbg/phpdbg_bp.h index 99c4eb6011..a1fafbab7b 100644 --- a/sapi/phpdbg/phpdbg_bp.h +++ b/sapi/phpdbg/phpdbg_bp.h @@ -118,46 +118,46 @@ typedef struct _phpdbg_breakcond_t { } phpdbg_breakcond_t; /* {{{ Resolving breaks API */ -PHPDBG_API void phpdbg_resolve_op_array_breaks(zend_op_array *op_array TSRMLS_DC); -PHPDBG_API int phpdbg_resolve_op_array_break(phpdbg_breakopline_t *brake, zend_op_array *op_array TSRMLS_DC); -PHPDBG_API int phpdbg_resolve_opline_break(phpdbg_breakopline_t *new_break TSRMLS_DC); -PHPDBG_API HashTable *phpdbg_resolve_pending_file_break_ex(const char *file, uint filelen, zend_string *cur, HashTable *fileht TSRMLS_DC); -PHPDBG_API void phpdbg_resolve_pending_file_break(const char *file TSRMLS_DC); /* }}} */ +PHPDBG_API void phpdbg_resolve_op_array_breaks(zend_op_array *op_array); +PHPDBG_API int phpdbg_resolve_op_array_break(phpdbg_breakopline_t *brake, zend_op_array *op_array); +PHPDBG_API int phpdbg_resolve_opline_break(phpdbg_breakopline_t *new_break); +PHPDBG_API HashTable *phpdbg_resolve_pending_file_break_ex(const char *file, uint filelen, zend_string *cur, HashTable *fileht); +PHPDBG_API void phpdbg_resolve_pending_file_break(const char *file); /* }}} */ /* {{{ Breakpoint Creation API */ -PHPDBG_API void phpdbg_set_breakpoint_file(const char* filename, long lineno TSRMLS_DC); -PHPDBG_API void phpdbg_set_breakpoint_symbol(const char* func_name, size_t func_name_len TSRMLS_DC); -PHPDBG_API void phpdbg_set_breakpoint_method(const char* class_name, const char* func_name TSRMLS_DC); -PHPDBG_API void phpdbg_set_breakpoint_opcode(const char* opname, size_t opname_len TSRMLS_DC); -PHPDBG_API void phpdbg_set_breakpoint_opline(zend_ulong opline TSRMLS_DC); -PHPDBG_API void phpdbg_set_breakpoint_opline_ex(phpdbg_opline_ptr_t opline TSRMLS_DC); -PHPDBG_API void phpdbg_set_breakpoint_method_opline(const char *class, const char *method, zend_ulong opline TSRMLS_DC); -PHPDBG_API void phpdbg_set_breakpoint_function_opline(const char *function, zend_ulong opline TSRMLS_DC); -PHPDBG_API void phpdbg_set_breakpoint_file_opline(const char *file, zend_ulong opline TSRMLS_DC); -PHPDBG_API void phpdbg_set_breakpoint_expression(const char* expression, size_t expression_len TSRMLS_DC); -PHPDBG_API void phpdbg_set_breakpoint_at(const phpdbg_param_t *param TSRMLS_DC); /* }}} */ +PHPDBG_API void phpdbg_set_breakpoint_file(const char* filename, long lineno); +PHPDBG_API void phpdbg_set_breakpoint_symbol(const char* func_name, size_t func_name_len); +PHPDBG_API void phpdbg_set_breakpoint_method(const char* class_name, const char* func_name); +PHPDBG_API void phpdbg_set_breakpoint_opcode(const char* opname, size_t opname_len); +PHPDBG_API void phpdbg_set_breakpoint_opline(zend_ulong opline); +PHPDBG_API void phpdbg_set_breakpoint_opline_ex(phpdbg_opline_ptr_t opline); +PHPDBG_API void phpdbg_set_breakpoint_method_opline(const char *class, const char *method, zend_ulong opline); +PHPDBG_API void phpdbg_set_breakpoint_function_opline(const char *function, zend_ulong opline); +PHPDBG_API void phpdbg_set_breakpoint_file_opline(const char *file, zend_ulong opline); +PHPDBG_API void phpdbg_set_breakpoint_expression(const char* expression, size_t expression_len); +PHPDBG_API void phpdbg_set_breakpoint_at(const phpdbg_param_t *param); /* }}} */ /* {{{ Breakpoint Detection API */ -PHPDBG_API phpdbg_breakbase_t* phpdbg_find_breakpoint(zend_execute_data* TSRMLS_DC); /* }}} */ +PHPDBG_API phpdbg_breakbase_t* phpdbg_find_breakpoint(zend_execute_data*); /* }}} */ /* {{{ Misc Breakpoint API */ -PHPDBG_API void phpdbg_hit_breakpoint(phpdbg_breakbase_t* brake, zend_bool output TSRMLS_DC); -PHPDBG_API void phpdbg_print_breakpoints(zend_ulong type TSRMLS_DC); -PHPDBG_API void phpdbg_print_breakpoint(phpdbg_breakbase_t* brake TSRMLS_DC); -PHPDBG_API void phpdbg_reset_breakpoints(TSRMLS_D); -PHPDBG_API void phpdbg_clear_breakpoints(TSRMLS_D); -PHPDBG_API void phpdbg_delete_breakpoint(zend_ulong num TSRMLS_DC); -PHPDBG_API void phpdbg_enable_breakpoints(TSRMLS_D); -PHPDBG_API void phpdbg_enable_breakpoint(zend_ulong id TSRMLS_DC); -PHPDBG_API void phpdbg_disable_breakpoint(zend_ulong id TSRMLS_DC); -PHPDBG_API void phpdbg_disable_breakpoints(TSRMLS_D); /* }}} */ +PHPDBG_API void phpdbg_hit_breakpoint(phpdbg_breakbase_t* brake, zend_bool output); +PHPDBG_API void phpdbg_print_breakpoints(zend_ulong type); +PHPDBG_API void phpdbg_print_breakpoint(phpdbg_breakbase_t* brake); +PHPDBG_API void phpdbg_reset_breakpoints(void); +PHPDBG_API void phpdbg_clear_breakpoints(void); +PHPDBG_API void phpdbg_delete_breakpoint(zend_ulong num); +PHPDBG_API void phpdbg_enable_breakpoints(void); +PHPDBG_API void phpdbg_enable_breakpoint(zend_ulong id); +PHPDBG_API void phpdbg_disable_breakpoint(zend_ulong id); +PHPDBG_API void phpdbg_disable_breakpoints(void); /* }}} */ /* {{{ Breakbase API */ -PHPDBG_API phpdbg_breakbase_t *phpdbg_find_breakbase(zend_ulong id TSRMLS_DC); -PHPDBG_API phpdbg_breakbase_t *phpdbg_find_breakbase_ex(zend_ulong id, HashTable **table, zend_ulong *numkey, zend_string **strkey TSRMLS_DC); /* }}} */ +PHPDBG_API phpdbg_breakbase_t *phpdbg_find_breakbase(zend_ulong id); +PHPDBG_API phpdbg_breakbase_t *phpdbg_find_breakbase_ex(zend_ulong id, HashTable **table, zend_ulong *numkey, zend_string **strkey); /* }}} */ /* {{{ Breakpoint Exportation API */ -PHPDBG_API void phpdbg_export_breakpoints(FILE *handle TSRMLS_DC); -PHPDBG_API void phpdbg_export_breakpoints_to_string(char **str TSRMLS_DC); /* }}} */ +PHPDBG_API void phpdbg_export_breakpoints(FILE *handle); +PHPDBG_API void phpdbg_export_breakpoints_to_string(char **str); /* }}} */ #endif /* PHPDBG_BP_H */ diff --git a/sapi/phpdbg/phpdbg_break.c b/sapi/phpdbg/phpdbg_break.c index 386d4d9562..258c492155 100644 --- a/sapi/phpdbg/phpdbg_break.c +++ b/sapi/phpdbg/phpdbg_break.c @@ -42,14 +42,14 @@ const phpdbg_command_t phpdbg_break_commands[] = { PHPDBG_BREAK(at) /* {{{ */ { - phpdbg_set_breakpoint_at(param TSRMLS_CC); + phpdbg_set_breakpoint_at(param); return SUCCESS; } /* }}} */ PHPDBG_BREAK(del) /* {{{ */ { - phpdbg_delete_breakpoint(param->num TSRMLS_CC); + phpdbg_delete_breakpoint(param->num); return SUCCESS; } /* }}} */ diff --git a/sapi/phpdbg/phpdbg_cmd.c b/sapi/phpdbg/phpdbg_cmd.c index 5c74adfdcd..d2196040db 100644 --- a/sapi/phpdbg/phpdbg_cmd.c +++ b/sapi/phpdbg/phpdbg_cmd.c @@ -44,7 +44,7 @@ static inline const char *phpdbg_command_name(const phpdbg_command_t *command, c return buffer; } -PHPDBG_API const char *phpdbg_get_param_type(const phpdbg_param_t *param TSRMLS_DC) /* {{{ */ +PHPDBG_API const char *phpdbg_get_param_type(const phpdbg_param_t *param) /* {{{ */ { switch (param->type) { case STACK_PARAM: @@ -70,7 +70,7 @@ PHPDBG_API const char *phpdbg_get_param_type(const phpdbg_param_t *param TSRMLS_ } } -PHPDBG_API void phpdbg_clear_param(phpdbg_param_t *param TSRMLS_DC) /* {{{ */ +PHPDBG_API void phpdbg_clear_param(phpdbg_param_t *param) /* {{{ */ { if (param) { switch (param->type) { @@ -91,7 +91,7 @@ PHPDBG_API void phpdbg_clear_param(phpdbg_param_t *param TSRMLS_DC) /* {{{ */ } /* }}} */ -PHPDBG_API char* phpdbg_param_tostring(const phpdbg_param_t *param, char **pointer TSRMLS_DC) /* {{{ */ +PHPDBG_API char* phpdbg_param_tostring(const phpdbg_param_t *param, char **pointer) /* {{{ */ { switch (param->type) { case STR_PARAM: @@ -133,7 +133,7 @@ PHPDBG_API char* phpdbg_param_tostring(const phpdbg_param_t *param, char **point return *pointer; } /* }}} */ -PHPDBG_API void phpdbg_copy_param(const phpdbg_param_t* src, phpdbg_param_t* dest TSRMLS_DC) /* {{{ */ +PHPDBG_API void phpdbg_copy_param(const phpdbg_param_t* src, phpdbg_param_t* dest) /* {{{ */ { switch ((dest->type = src->type)) { case STACK_PARAM: @@ -191,7 +191,7 @@ PHPDBG_API void phpdbg_copy_param(const phpdbg_param_t* src, phpdbg_param_t* des } } /* }}} */ -PHPDBG_API zend_ulong phpdbg_hash_param(const phpdbg_param_t *param TSRMLS_DC) /* {{{ */ +PHPDBG_API zend_ulong phpdbg_hash_param(const phpdbg_param_t *param) /* {{{ */ { zend_ulong hash = param->type; @@ -246,7 +246,7 @@ PHPDBG_API zend_ulong phpdbg_hash_param(const phpdbg_param_t *param TSRMLS_DC) / return hash; } /* }}} */ -PHPDBG_API zend_bool phpdbg_match_param(const phpdbg_param_t *l, const phpdbg_param_t *r TSRMLS_DC) /* {{{ */ +PHPDBG_API zend_bool phpdbg_match_param(const phpdbg_param_t *l, const phpdbg_param_t *r) /* {{{ */ { if (l && r) { if (l->type == r->type) { @@ -446,7 +446,7 @@ PHPDBG_API void phpdbg_stack_push(phpdbg_param_t *stack, phpdbg_param_t *param) stack->len++; } /* }}} */ -PHPDBG_API int phpdbg_stack_verify(const phpdbg_command_t *command, phpdbg_param_t **stack TSRMLS_DC) { +PHPDBG_API int phpdbg_stack_verify(const phpdbg_command_t *command, phpdbg_param_t **stack) { if (command) { char buffer[128] = {0,}; const phpdbg_param_t *top = (stack != NULL) ? *stack : NULL; @@ -492,7 +492,7 @@ PHPDBG_API int phpdbg_stack_verify(const phpdbg_command_t *command, phpdbg_param phpdbg_error("command", "type=\"wrongarg\" command=\"%s\" expected=\"%s\" got=\"%s\" num=\"%lu\"", "The command \"%s\" expected %s and got %s at parameter %lu", \ phpdbg_command_name(command, buffer), \ (e),\ - phpdbg_get_param_type((a) TSRMLS_CC), \ + phpdbg_get_param_type((a)), \ current); \ return FAILURE; \ } @@ -544,7 +544,7 @@ PHPDBG_API int phpdbg_stack_verify(const phpdbg_command_t *command, phpdbg_param } /* {{{ */ -PHPDBG_API const phpdbg_command_t *phpdbg_stack_resolve(const phpdbg_command_t *commands, const phpdbg_command_t *parent, phpdbg_param_t **top TSRMLS_DC) { +PHPDBG_API const phpdbg_command_t *phpdbg_stack_resolve(const phpdbg_command_t *commands, const phpdbg_command_t *parent, phpdbg_param_t **top) { const phpdbg_command_t *command = commands; phpdbg_param_t *name = *top; const phpdbg_command_t *matched[3] = {NULL, NULL, NULL}; @@ -628,7 +628,7 @@ PHPDBG_API const phpdbg_command_t *phpdbg_stack_resolve(const phpdbg_command_t * } if (command->subs && (*top) && ((*top)->type == STR_PARAM)) { - return phpdbg_stack_resolve(command->subs, command, top TSRMLS_CC); + return phpdbg_stack_resolve(command->subs, command, top); } else { return command; } @@ -637,7 +637,7 @@ PHPDBG_API const phpdbg_command_t *phpdbg_stack_resolve(const phpdbg_command_t * } /* }}} */ /* {{{ */ -PHPDBG_API int phpdbg_stack_execute(phpdbg_param_t *stack, zend_bool allow_async_unsafe TSRMLS_DC) { +PHPDBG_API int phpdbg_stack_execute(phpdbg_param_t *stack, zend_bool allow_async_unsafe) { phpdbg_param_t *top = NULL; const phpdbg_command_t *handler = NULL; @@ -655,29 +655,29 @@ PHPDBG_API int phpdbg_stack_execute(phpdbg_param_t *stack, zend_bool allow_async switch (top->type) { case EVAL_PARAM: - phpdbg_activate_err_buf(0 TSRMLS_CC); - phpdbg_free_err_buf(TSRMLS_C); - return PHPDBG_COMMAND_HANDLER(ev)(top TSRMLS_CC); + phpdbg_activate_err_buf(0); + phpdbg_free_err_buf(); + return PHPDBG_COMMAND_HANDLER(ev)(top); case RUN_PARAM: if (!allow_async_unsafe) { phpdbg_error("signalsegv", "command=\"run\"", "run command is disallowed during hard interrupt"); } - phpdbg_activate_err_buf(0 TSRMLS_CC); - phpdbg_free_err_buf(TSRMLS_C); - return PHPDBG_COMMAND_HANDLER(run)(top TSRMLS_CC); + phpdbg_activate_err_buf(0); + phpdbg_free_err_buf(); + return PHPDBG_COMMAND_HANDLER(run)(top); case SHELL_PARAM: if (!allow_async_unsafe) { phpdbg_error("signalsegv", "command=\"sh\"", "sh command is disallowed during hard interrupt"); return FAILURE; } - phpdbg_activate_err_buf(0 TSRMLS_CC); - phpdbg_free_err_buf(TSRMLS_C); - return PHPDBG_COMMAND_HANDLER(sh)(top TSRMLS_CC); + phpdbg_activate_err_buf(0); + phpdbg_free_err_buf(); + return PHPDBG_COMMAND_HANDLER(sh)(top); case STR_PARAM: { - handler = phpdbg_stack_resolve(phpdbg_prompt_commands, NULL, &top TSRMLS_CC); + handler = phpdbg_stack_resolve(phpdbg_prompt_commands, NULL, &top); if (handler) { if (!allow_async_unsafe && !(handler->flags & PHPDBG_ASYNC_SAFE)) { @@ -685,10 +685,10 @@ PHPDBG_API int phpdbg_stack_execute(phpdbg_param_t *stack, zend_bool allow_async return FAILURE; } - if (phpdbg_stack_verify(handler, &top TSRMLS_CC) == SUCCESS) { - phpdbg_activate_err_buf(0 TSRMLS_CC); - phpdbg_free_err_buf(TSRMLS_C); - return handler->handler(top TSRMLS_CC); + if (phpdbg_stack_verify(handler, &top) == SUCCESS) { + phpdbg_activate_err_buf(0); + phpdbg_free_err_buf(); + return handler->handler(top); } } } return FAILURE; @@ -701,14 +701,14 @@ PHPDBG_API int phpdbg_stack_execute(phpdbg_param_t *stack, zend_bool allow_async return SUCCESS; } /* }}} */ -PHPDBG_API char *phpdbg_read_input(char *buffered TSRMLS_DC) /* {{{ */ +PHPDBG_API char *phpdbg_read_input(char *buffered) /* {{{ */ { char buf[PHPDBG_MAX_CMD]; char *cmd = NULL; char *buffer = NULL; if ((PHPDBG_G(flags) & (PHPDBG_IS_STOPPING | PHPDBG_IS_RUNNING)) != PHPDBG_IS_STOPPING) { - if ((PHPDBG_G(flags) & PHPDBG_IS_REMOTE) && (buffered == NULL) && !phpdbg_active_sigsafe_mem(TSRMLS_C)) { + if ((PHPDBG_G(flags) & PHPDBG_IS_REMOTE) && (buffered == NULL) && !phpdbg_active_sigsafe_mem()) { fflush(PHPDBG_G(io)[PHPDBG_STDOUT].ptr); } @@ -720,12 +720,12 @@ readline: if (PHPDBG_G(flags) & PHPDBG_IS_REMOTE) #endif { - phpdbg_write("prompt", "", "%s", phpdbg_get_prompt(TSRMLS_C)); - phpdbg_consume_stdin_line(cmd = buf TSRMLS_CC); + phpdbg_write("prompt", "", "%s", phpdbg_get_prompt()); + phpdbg_consume_stdin_line(cmd = buf); } #if USE_LIB_STAR else { - cmd = readline(phpdbg_get_prompt(TSRMLS_C)); + cmd = readline(phpdbg_get_prompt()); PHPDBG_G(last_was_newline) = 1; } @@ -774,19 +774,19 @@ readline: return buffer; } /* }}} */ -PHPDBG_API void phpdbg_destroy_input(char **input TSRMLS_DC) /*{{{ */ +PHPDBG_API void phpdbg_destroy_input(char **input) /*{{{ */ { efree(*input); } /* }}} */ -PHPDBG_API int phpdbg_ask_user_permission(const char *question TSRMLS_DC) { +PHPDBG_API int phpdbg_ask_user_permission(const char *question) { if (!(PHPDBG_G(flags) & PHPDBG_WRITE_XML)) { char buf[PHPDBG_MAX_CMD]; phpdbg_out("%s", question); phpdbg_out(" (type y or n): "); while (1) { - phpdbg_consume_stdin_line(buf TSRMLS_CC); + phpdbg_consume_stdin_line(buf); if (buf[1] == '\n' && (buf[0] == 'y' || buf[0] == 'n')) { if (buf[0] == 'y') { return SUCCESS; diff --git a/sapi/phpdbg/phpdbg_cmd.h b/sapi/phpdbg/phpdbg_cmd.h index a79641c080..41b0c671d1 100644 --- a/sapi/phpdbg/phpdbg_cmd.h +++ b/sapi/phpdbg/phpdbg_cmd.h @@ -88,7 +88,7 @@ struct _phpdbg_param { #define PHPDBG_ASYNC_SAFE 1 -typedef int (*phpdbg_command_handler_t)(const phpdbg_param_t* TSRMLS_DC); +typedef int (*phpdbg_command_handler_t)(const phpdbg_param_t*); typedef struct _phpdbg_command_t phpdbg_command_t; struct _phpdbg_command_t { @@ -129,28 +129,28 @@ typedef struct { /* * Input Management */ -PHPDBG_API char* phpdbg_read_input(char *buffered TSRMLS_DC); -PHPDBG_API void phpdbg_destroy_input(char** TSRMLS_DC); -PHPDBG_API int phpdbg_ask_user_permission(const char *question TSRMLS_DC); +PHPDBG_API char* phpdbg_read_input(char *buffered); +PHPDBG_API void phpdbg_destroy_input(char**); +PHPDBG_API int phpdbg_ask_user_permission(const char *question); /** * Stack Management */ PHPDBG_API void phpdbg_stack_push(phpdbg_param_t *stack, phpdbg_param_t *param); -PHPDBG_API const phpdbg_command_t *phpdbg_stack_resolve(const phpdbg_command_t *commands, const phpdbg_command_t *parent, phpdbg_param_t **top TSRMLS_DC); -PHPDBG_API int phpdbg_stack_verify(const phpdbg_command_t *command, phpdbg_param_t **stack TSRMLS_DC); -PHPDBG_API int phpdbg_stack_execute(phpdbg_param_t *stack, zend_bool allow_async_unsafe TSRMLS_DC); +PHPDBG_API const phpdbg_command_t *phpdbg_stack_resolve(const phpdbg_command_t *commands, const phpdbg_command_t *parent, phpdbg_param_t **top); +PHPDBG_API int phpdbg_stack_verify(const phpdbg_command_t *command, phpdbg_param_t **stack); +PHPDBG_API int phpdbg_stack_execute(phpdbg_param_t *stack, zend_bool allow_async_unsafe); PHPDBG_API void phpdbg_stack_free(phpdbg_param_t *stack); /* * Parameter Management */ -PHPDBG_API void phpdbg_clear_param(phpdbg_param_t* TSRMLS_DC); -PHPDBG_API void phpdbg_copy_param(const phpdbg_param_t*, phpdbg_param_t* TSRMLS_DC); -PHPDBG_API zend_bool phpdbg_match_param(const phpdbg_param_t *, const phpdbg_param_t * TSRMLS_DC); -PHPDBG_API zend_ulong phpdbg_hash_param(const phpdbg_param_t * TSRMLS_DC); -PHPDBG_API const char* phpdbg_get_param_type(const phpdbg_param_t* TSRMLS_DC); -PHPDBG_API char* phpdbg_param_tostring(const phpdbg_param_t *param, char **pointer TSRMLS_DC); +PHPDBG_API void phpdbg_clear_param(phpdbg_param_t*); +PHPDBG_API void phpdbg_copy_param(const phpdbg_param_t*, phpdbg_param_t*); +PHPDBG_API zend_bool phpdbg_match_param(const phpdbg_param_t *, const phpdbg_param_t *); +PHPDBG_API zend_ulong phpdbg_hash_param(const phpdbg_param_t *); +PHPDBG_API const char* phpdbg_get_param_type(const phpdbg_param_t*); +PHPDBG_API char* phpdbg_param_tostring(const phpdbg_param_t *param, char **pointer); PHPDBG_API void phpdbg_param_debug(const phpdbg_param_t *param, const char *msg); /** @@ -167,9 +167,9 @@ PHPDBG_API void phpdbg_param_debug(const phpdbg_param_t *param, const char *msg) #define PHPDBG_COMMAND_D(name, tip, alias, children, args, flags) \ {PHPDBG_STRL(#name), tip, sizeof(tip)-1, alias, phpdbg_do_##name, children, args, NULL, flags} -#define PHPDBG_COMMAND(name) int phpdbg_do_##name(const phpdbg_param_t *param TSRMLS_DC) +#define PHPDBG_COMMAND(name) int phpdbg_do_##name(const phpdbg_param_t *param) -#define PHPDBG_COMMAND_ARGS param TSRMLS_CC +#define PHPDBG_COMMAND_ARGS param #define PHPDBG_END_COMMAND {NULL, 0, NULL, 0, '\0', NULL, NULL, NULL, NULL, 0} @@ -178,7 +178,7 @@ PHPDBG_API void phpdbg_param_debug(const phpdbg_param_t *param, const char *msg) */ #define phpdbg_default_switch_case() \ default: \ - phpdbg_error("command", "type=\"wrongarg\" got=\"%s\"", "Unsupported parameter type (%s) for command", phpdbg_get_param_type(param TSRMLS_CC)); \ + phpdbg_error("command", "type=\"wrongarg\" got=\"%s\"", "Unsupported parameter type (%s) for command", phpdbg_get_param_type(param)); \ break #endif /* PHPDBG_CMD_H */ diff --git a/sapi/phpdbg/phpdbg_eol.c b/sapi/phpdbg/phpdbg_eol.c index fc20d567bc..47643aae8d 100644 --- a/sapi/phpdbg/phpdbg_eol.c +++ b/sapi/phpdbg/phpdbg_eol.c @@ -33,7 +33,7 @@ struct phpdbg_eol_rep phpdbg_eol_list[EOL_LIST_LEN] = { {"CR", "\r", PHPDBG_EOL_CR}, }; -int phpdbg_eol_global_update(char *name TSRMLS_DC) +int phpdbg_eol_global_update(char *name) { if (0 == memcmp(name, "CRLF", 4) || 0 == memcmp(name, "crlf", 4) || 0 == memcmp(name, "DOS", 3) || 0 == memcmp(name, "dos", 3)) { @@ -83,7 +83,7 @@ char *phpdbg_eol_rep(int id) /* Inspired by https://ccrma.stanford.edu/~craig/utility/flip/flip.cpp */ -void phpdbg_eol_convert(char **str, int *len TSRMLS_DC) +void phpdbg_eol_convert(char **str, int *len) { char *in = *str, *out ; int in_len = *len, out_len, cursor, i; diff --git a/sapi/phpdbg/phpdbg_eol.h b/sapi/phpdbg/phpdbg_eol.h index 68b54cbe34..0b041b3fdf 100644 --- a/sapi/phpdbg/phpdbg_eol.h +++ b/sapi/phpdbg/phpdbg_eol.h @@ -34,13 +34,13 @@ enum { PHPDBG_EOL_CR /* MAC */ }; -int phpdbg_eol_global_update(char *name TSRMLS_DC); +int phpdbg_eol_global_update(char *name); char *phpdbg_eol_name(int id); char *phpdbg_eol_rep(int id); -void phpdbg_eol_convert(char **str, int *len TSRMLS_DC); +void phpdbg_eol_convert(char **str, int *len); #endif /* PHPDBG_EOL_H */ diff --git a/sapi/phpdbg/phpdbg_frame.c b/sapi/phpdbg/phpdbg_frame.c index c9ba377d95..08e5874eb8 100644 --- a/sapi/phpdbg/phpdbg_frame.c +++ b/sapi/phpdbg/phpdbg_frame.c @@ -26,7 +26,7 @@ ZEND_EXTERN_MODULE_GLOBALS(phpdbg); -void phpdbg_restore_frame(TSRMLS_D) /* {{{ */ +void phpdbg_restore_frame(void) /* {{{ */ { if (PHPDBG_FRAME(num) == 0) { return; @@ -40,7 +40,7 @@ void phpdbg_restore_frame(TSRMLS_D) /* {{{ */ EG(scope) = PHPDBG_EX(func)->op_array.scope; } /* }}} */ -void phpdbg_switch_frame(int frame TSRMLS_DC) /* {{{ */ +void phpdbg_switch_frame(int frame) /* {{{ */ { zend_execute_data *execute_data = PHPDBG_FRAME(num)?PHPDBG_FRAME(execute_data):EG(current_execute_data); int i = 0; @@ -70,7 +70,7 @@ void phpdbg_switch_frame(int frame TSRMLS_DC) /* {{{ */ return; } - phpdbg_restore_frame(TSRMLS_C); + phpdbg_restore_frame(); if (frame > 0) { PHPDBG_FRAME(num) = frame; @@ -85,14 +85,14 @@ void phpdbg_switch_frame(int frame TSRMLS_DC) /* {{{ */ phpdbg_notice("frame", "id=\"%d\"", "Switched to frame #%d", frame); { - const char *file_chr = zend_get_executed_filename(TSRMLS_C); + const char *file_chr = zend_get_executed_filename(); zend_string *file = zend_string_init(file_chr, strlen(file_chr), 0); - phpdbg_list_file(file, 3, zend_get_executed_lineno(TSRMLS_C) - 1, zend_get_executed_lineno(TSRMLS_C) TSRMLS_CC); + phpdbg_list_file(file, 3, zend_get_executed_lineno() - 1, zend_get_executed_lineno()); efree(file); } } /* }}} */ -static void phpdbg_dump_prototype(zval *tmp TSRMLS_DC) /* {{{ */ +static void phpdbg_dump_prototype(zval *tmp) /* {{{ */ { zval *funcname, *class, class_zv, *type, *args, *argstmp; @@ -129,7 +129,7 @@ static void phpdbg_dump_prototype(zval *tmp TSRMLS_DC) /* {{{ */ phpdbg_try_access { /* assuming no autoloader call is necessary, class should have been loaded if it's in backtrace ... */ - if ((func = phpdbg_get_function(Z_STRVAL_P(funcname), class ? Z_STRVAL_P(class) : NULL TSRMLS_CC))) { + if ((func = phpdbg_get_function(Z_STRVAL_P(funcname), class ? Z_STRVAL_P(class) : NULL))) { arginfo = func->common.arg_info; } } phpdbg_end_try_access(); @@ -153,7 +153,7 @@ static void phpdbg_dump_prototype(zval *tmp TSRMLS_DC) /* {{{ */ } ++j; - zend_print_flat_zval_r(argstmp TSRMLS_CC); + zend_print_flat_zval_r(argstmp); phpdbg_xml("</arg>"); } ZEND_HASH_FOREACH_END(); @@ -166,7 +166,7 @@ static void phpdbg_dump_prototype(zval *tmp TSRMLS_DC) /* {{{ */ phpdbg_out(")"); } -void phpdbg_dump_backtrace(size_t num TSRMLS_DC) /* {{{ */ +void phpdbg_dump_backtrace(size_t num) /* {{{ */ { HashPosition position; zval zbacktrace; @@ -184,7 +184,7 @@ void phpdbg_dump_backtrace(size_t num TSRMLS_DC) /* {{{ */ } phpdbg_try_access { - zend_fetch_debug_backtrace(&zbacktrace, 0, 0, limit TSRMLS_CC); + zend_fetch_debug_backtrace(&zbacktrace, 0, 0, limit); } phpdbg_catch_access { phpdbg_error("signalsegv", "", "Couldn't fetch backtrace, invalid data source"); return; @@ -207,13 +207,13 @@ void phpdbg_dump_backtrace(size_t num TSRMLS_DC) /* {{{ */ if (file) { /* userland */ phpdbg_out("frame #%d: ", i); phpdbg_xml("<frame %r id=\"%d\" file=\"%s\" line=\"%d\"", i, Z_STRVAL_P(file), Z_LVAL_P(line)); - phpdbg_dump_prototype(tmp TSRMLS_CC); + phpdbg_dump_prototype(tmp); phpdbg_out(" at %s:%ld\n", Z_STRVAL_P(file), Z_LVAL_P(line)); i++; } else { phpdbg_out(" => "); phpdbg_xml("<frame %r id=\"%d\" internal=\"internal\"", i); - phpdbg_dump_prototype(tmp TSRMLS_CC); + phpdbg_dump_prototype(tmp); phpdbg_out(" (internal function)\n"); } } diff --git a/sapi/phpdbg/phpdbg_frame.h b/sapi/phpdbg/phpdbg_frame.h index 7c4574ed28..63c838fb91 100644 --- a/sapi/phpdbg/phpdbg_frame.h +++ b/sapi/phpdbg/phpdbg_frame.h @@ -23,8 +23,8 @@ #include "TSRM.h" -void phpdbg_restore_frame(TSRMLS_D); -void phpdbg_switch_frame(int TSRMLS_DC); -void phpdbg_dump_backtrace(size_t TSRMLS_DC); +void phpdbg_restore_frame(void); +void phpdbg_switch_frame(int); +void phpdbg_dump_backtrace(size_t); #endif /* PHPDBG_FRAME_H */ diff --git a/sapi/phpdbg/phpdbg_help.c b/sapi/phpdbg/phpdbg_help.c index 652e170694..fefde149e3 100644 --- a/sapi/phpdbg/phpdbg_help.c +++ b/sapi/phpdbg/phpdbg_help.c @@ -41,11 +41,11 @@ const phpdbg_command_t phpdbg_help_commands[] = { }; /* }}} */ /* {{{ pretty_print. Formatting escapes and wrapping text in a string before printing it. */ -void pretty_print(char *text TSRMLS_DC) +void pretty_print(char *text) { char *new, *p, *q; - const char *prompt_escape = phpdbg_get_prompt(TSRMLS_C); + const char *prompt_escape = phpdbg_get_prompt(); unsigned int prompt_escape_len = strlen(prompt_escape); unsigned int prompt_len = strlen(PHPDBG_G(prompt)[0]); @@ -53,7 +53,7 @@ void pretty_print(char *text TSRMLS_DC) const char *bold_off_escape = PHPDBG_G(flags) & PHPDBG_IS_COLOURED ? "\033[0m" : ""; unsigned int bold_escape_len = strlen(bold_on_escape); - unsigned int term_width = phpdbg_get_terminal_width(TSRMLS_C); + unsigned int term_width = phpdbg_get_terminal_width(); unsigned int size = 0; int in_bold = 0; @@ -142,16 +142,16 @@ void pretty_print(char *text TSRMLS_DC) } /* }}} */ /* {{{ summary_print. Print a summary line giving, the command, its alias and tip */ -void summary_print(phpdbg_command_t const * const cmd TSRMLS_DC) +void summary_print(phpdbg_command_t const * const cmd) { char *summary; spprintf(&summary, 0, "Command: **%s** Alias: **%c** **%s**\n", cmd->name, cmd->alias, cmd->tip); - pretty_print(summary TSRMLS_CC); + pretty_print(summary); efree(summary); } /* {{{ get_help. Retries and formats text from the phpdbg help text table */ -static char *get_help(const char * const key TSRMLS_DC) +static char *get_help(const char * const key) { phpdbg_help_text_t *p; @@ -180,7 +180,7 @@ static int get_command( const char *key, size_t len, /* pointer and length of key */ phpdbg_command_t const **command, /* address of first matching command */ phpdbg_command_t const * commands /* command table to be scanned */ - TSRMLS_DC) + ) { const phpdbg_command_t *c; unsigned int num_matches = 0; @@ -215,26 +215,26 @@ PHPDBG_COMMAND(help) /* {{{ */ int n; if (!param || param->type == EMPTY_PARAM) { - pretty_print(get_help("overview!" TSRMLS_CC) TSRMLS_CC); + pretty_print(get_help("overview!")); return SUCCESS; } if (param && param->type == STR_PARAM) { - n = get_command(param->str, param->len, &cmd, phpdbg_prompt_commands TSRMLS_CC); + n = get_command(param->str, param->len, &cmd, phpdbg_prompt_commands); if (n==1) { - summary_print(cmd TSRMLS_CC); - pretty_print(get_help(cmd->name TSRMLS_CC) TSRMLS_CC); + summary_print(cmd); + pretty_print(get_help(cmd->name)); return SUCCESS; } else if (n>1) { if (param->len > 1) { for (cmd=phpdbg_prompt_commands; cmd->name; cmd++) { if (!strncmp(cmd->name, param->str, param->len)) { - summary_print(cmd TSRMLS_CC); + summary_print(cmd); } } - pretty_print(get_help("duplicate!" TSRMLS_CC) TSRMLS_CC); + pretty_print(get_help("duplicate!")); return SUCCESS; } else { phpdbg_error("help", "type=\"ambiguousalias\" alias=\"%s\"", "Internal help error, non-unique alias \"%c\"", param->str[0]); @@ -242,13 +242,13 @@ PHPDBG_COMMAND(help) /* {{{ */ } } else { /* no prompt command found so try help topic */ - n = get_command( param->str, param->len, &cmd, phpdbg_help_commands TSRMLS_CC); + n = get_command( param->str, param->len, &cmd, phpdbg_help_commands); if (n>0) { if (cmd->alias == 'a') { /* help aliases executes a canned routine */ - return cmd->handler(param TSRMLS_CC); + return cmd->handler(param); } else { - pretty_print(get_help(cmd->name TSRMLS_CC) TSRMLS_CC); + pretty_print(get_help(cmd->name)); return SUCCESS; } } @@ -285,7 +285,7 @@ PHPDBG_HELP(aliases) /* {{{ */ phpdbg_xml("</helpcommands>"); /* Print out aliases for help as this one comes last, with the added text on how aliases are used */ - get_command("h", 1, &c, phpdbg_prompt_commands TSRMLS_CC); + get_command("h", 1, &c, phpdbg_prompt_commands); phpdbg_writeln("aliasinfo", "alias=\"%c\" name=\"%s\" tip=\"%s\"", " %c %-20s %s\n", c->alias, c->name, c->tip); phpdbg_xml("<helpaliases>"); @@ -300,7 +300,7 @@ PHPDBG_HELP(aliases) /* {{{ */ phpdbg_xml("</helpaliases>"); - pretty_print(get_help("aliases!" TSRMLS_CC) TSRMLS_CC); + pretty_print(get_help("aliases!")); return SUCCESS; } /* }}} */ diff --git a/sapi/phpdbg/phpdbg_info.c b/sapi/phpdbg/phpdbg_info.c index 7963ff35e2..2c52b45686 100644 --- a/sapi/phpdbg/phpdbg_info.c +++ b/sapi/phpdbg/phpdbg_info.c @@ -46,15 +46,15 @@ const phpdbg_command_t phpdbg_info_commands[] = { PHPDBG_INFO(break) /* {{{ */ { - phpdbg_print_breakpoints(PHPDBG_BREAK_FILE TSRMLS_CC); - phpdbg_print_breakpoints(PHPDBG_BREAK_SYM TSRMLS_CC); - phpdbg_print_breakpoints(PHPDBG_BREAK_METHOD TSRMLS_CC); - phpdbg_print_breakpoints(PHPDBG_BREAK_OPLINE TSRMLS_CC); - phpdbg_print_breakpoints(PHPDBG_BREAK_FILE_OPLINE TSRMLS_CC); - phpdbg_print_breakpoints(PHPDBG_BREAK_FUNCTION_OPLINE TSRMLS_CC); - phpdbg_print_breakpoints(PHPDBG_BREAK_METHOD_OPLINE TSRMLS_CC); - phpdbg_print_breakpoints(PHPDBG_BREAK_COND TSRMLS_CC); - phpdbg_print_breakpoints(PHPDBG_BREAK_OPCODE TSRMLS_CC); + phpdbg_print_breakpoints(PHPDBG_BREAK_FILE); + phpdbg_print_breakpoints(PHPDBG_BREAK_SYM); + phpdbg_print_breakpoints(PHPDBG_BREAK_METHOD); + phpdbg_print_breakpoints(PHPDBG_BREAK_OPLINE); + phpdbg_print_breakpoints(PHPDBG_BREAK_FILE_OPLINE); + phpdbg_print_breakpoints(PHPDBG_BREAK_FUNCTION_OPLINE); + phpdbg_print_breakpoints(PHPDBG_BREAK_METHOD_OPLINE); + phpdbg_print_breakpoints(PHPDBG_BREAK_COND); + phpdbg_print_breakpoints(PHPDBG_BREAK_OPCODE); return SUCCESS; } /* }}} */ @@ -153,19 +153,19 @@ PHPDBG_INFO(constants) /* {{{ */ return SUCCESS; } /* }}} */ -static int phpdbg_arm_auto_global(zend_auto_global *auto_global TSRMLS_DC) { +static int phpdbg_arm_auto_global(zend_auto_global *auto_global) { if (auto_global->armed) { if (PHPDBG_G(flags) & PHPDBG_IN_SIGNAL_HANDLER) { phpdbg_notice("variableinfo", "unreachable=\"%.*s\"", "Cannot show information about superglobal variable %.*s", auto_global->name->len, auto_global->name->val); } else { - auto_global->armed = auto_global->auto_global_callback(auto_global->name TSRMLS_CC); + auto_global->armed = auto_global->auto_global_callback(auto_global->name); } } return 0; } -static int phpdbg_print_symbols(zend_bool show_globals TSRMLS_DC) { +static int phpdbg_print_symbols(zend_bool show_globals) { HashTable vars; zend_array *symtable; zend_string *var; @@ -178,9 +178,9 @@ static int phpdbg_print_symbols(zend_bool show_globals TSRMLS_DC) { if (show_globals) { /* that array should only be manipulated during init, so safe for async access during execution */ - zend_hash_apply(CG(auto_globals), (apply_func_t) phpdbg_arm_auto_global TSRMLS_CC); + zend_hash_apply(CG(auto_globals), (apply_func_t) phpdbg_arm_auto_global); symtable = &EG(symbol_table); - } else if (!(symtable = zend_rebuild_symbol_table(TSRMLS_C))) { + } else if (!(symtable = zend_rebuild_symbol_table())) { phpdbg_error("inactive", "type=\"symbol_table\"", "No active symbol table!"); return SUCCESS; } @@ -189,7 +189,7 @@ static int phpdbg_print_symbols(zend_bool show_globals TSRMLS_DC) { phpdbg_try_access { ZEND_HASH_FOREACH_STR_KEY_VAL(&symtable->ht, var, data) { - if (zend_is_auto_global(var TSRMLS_CC) ^ !show_globals) { + if (zend_is_auto_global(var) ^ !show_globals) { zend_hash_update(&vars, var, data); } } ZEND_HASH_FOREACH_END(); @@ -226,7 +226,7 @@ static int phpdbg_print_symbols(zend_bool show_globals TSRMLS_DC) { switch (Z_TYPE_P(data)) { case IS_RESOURCE: phpdbg_try_access { - const char *type = zend_rsrc_list_get_rsrc_type(Z_RES_P(data) TSRMLS_CC); + const char *type = zend_rsrc_list_get_rsrc_type(Z_RES_P(data)); VARIABLEINFO("type=\"%s\"", "\n|-------(typeof)------> (%s)\n", type ? type : "unknown"); } phpdbg_catch_access { VARIABLEINFO("type=\"unknown\"", "\n|-------(typeof)------> (unknown)\n"); @@ -276,12 +276,12 @@ static int phpdbg_print_symbols(zend_bool show_globals TSRMLS_DC) { PHPDBG_INFO(vars) /* {{{ */ { - return phpdbg_print_symbols(0 TSRMLS_CC); + return phpdbg_print_symbols(0); } PHPDBG_INFO(globals) /* {{{ */ { - return phpdbg_print_symbols(1 TSRMLS_CC); + return phpdbg_print_symbols(1); } PHPDBG_INFO(literal) /* {{{ */ @@ -309,7 +309,7 @@ PHPDBG_INFO(literal) /* {{{ */ while (literal < ops->last_literal) { if (Z_TYPE(ops->literals[literal]) != IS_NULL) { phpdbg_write("literal", "id=\"%u\"", "|-------- C%u -------> [", literal); - zend_print_zval(&ops->literals[literal], 0 TSRMLS_CC); + zend_print_zval(&ops->literals[literal], 0); phpdbg_out("]\n"); } literal++; @@ -328,16 +328,16 @@ PHPDBG_INFO(memory) /* {{{ */ zend_bool is_mm; if (PHPDBG_G(flags) & PHPDBG_IN_SIGNAL_HANDLER) { - heap = zend_mm_set_heap(phpdbg_original_heap_sigsafe_mem(TSRMLS_C) TSRMLS_CC); + heap = zend_mm_set_heap(phpdbg_original_heap_sigsafe_mem()); } - if ((is_mm = is_zend_mm(TSRMLS_C))) { - used = zend_memory_usage(0 TSRMLS_CC); - real = zend_memory_usage(1 TSRMLS_CC); - peak_used = zend_memory_peak_usage(0 TSRMLS_CC); - peak_real = zend_memory_peak_usage(1 TSRMLS_CC); + if ((is_mm = is_zend_mm())) { + used = zend_memory_usage(0); + real = zend_memory_usage(1); + 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 TSRMLS_CC); + zend_mm_set_heap(heap); } if (is_mm) { @@ -354,7 +354,7 @@ PHPDBG_INFO(memory) /* {{{ */ return SUCCESS; } /* }}} */ -static inline void phpdbg_print_class_name(zend_class_entry *ce TSRMLS_DC) /* {{{ */ +static inline void phpdbg_print_class_name(zend_class_entry *ce) /* {{{ */ { const char *visibility = ce->type == ZEND_USER_CLASS ? "User" : "Internal"; const char *type = (ce->ce_flags & ZEND_ACC_INTERFACE) ? "Interface" : (ce->ce_flags & ZEND_ACC_ABSTRACT) ? "Abstract Class" : "Class"; @@ -383,7 +383,7 @@ PHPDBG_INFO(classes) /* {{{ */ /* once added, assume that classes are stable... until shutdown. */ ZEND_HASH_FOREACH_PTR(&classes, ce) { - phpdbg_print_class_name(ce TSRMLS_CC); + phpdbg_print_class_name(ce); if (ce->parent) { zend_class_entry *pce; @@ -391,7 +391,7 @@ PHPDBG_INFO(classes) /* {{{ */ pce = ce->parent; do { phpdbg_out("|-------- "); - phpdbg_print_class_name(pce TSRMLS_CC); + phpdbg_print_class_name(pce); } while ((pce = pce->parent)); phpdbg_xml("</parents>"); } diff --git a/sapi/phpdbg/phpdbg_io.c b/sapi/phpdbg/phpdbg_io.c index a2a5c5969f..6d74230d20 100644 --- a/sapi/phpdbg/phpdbg_io.c +++ b/sapi/phpdbg/phpdbg_io.c @@ -48,7 +48,7 @@ ZEND_EXTERN_MODULE_GLOBALS(phpdbg); /* is easy to generalize ... but not needed for now */ -PHPDBG_API int phpdbg_consume_stdin_line(char *buf TSRMLS_DC) { +PHPDBG_API int phpdbg_consume_stdin_line(char *buf) { int bytes = PHPDBG_G(input_buflen), len = 0; if (PHPDBG_G(input_buflen)) { @@ -85,7 +85,7 @@ PHPDBG_API int phpdbg_consume_stdin_line(char *buf TSRMLS_DC) { } len += bytes; - } while ((bytes = phpdbg_mixed_read(PHPDBG_G(io)[PHPDBG_STDIN].fd, buf + len, PHPDBG_MAX_CMD - len, -1 TSRMLS_CC)) > 0); + } while ((bytes = phpdbg_mixed_read(PHPDBG_G(io)[PHPDBG_STDIN].fd, buf + len, PHPDBG_MAX_CMD - len, -1)) > 0); if (bytes <= 0) { PHPDBG_G(flags) |= PHPDBG_IS_QUITTING | PHPDBG_IS_DISCONNECTED; @@ -96,7 +96,7 @@ PHPDBG_API int phpdbg_consume_stdin_line(char *buf TSRMLS_DC) { return bytes; } -PHPDBG_API int phpdbg_consume_bytes(int sock, char *ptr, int len, int tmo TSRMLS_DC) { +PHPDBG_API int phpdbg_consume_bytes(int sock, char *ptr, int len, int tmo) { int got_now, i = len, j; char *p = ptr; #ifndef PHP_WIN32 @@ -177,16 +177,16 @@ PHPDBG_API int phpdbg_send_bytes(int sock, const char *ptr, int len) { } -PHPDBG_API int phpdbg_mixed_read(int sock, char *ptr, int len, int tmo TSRMLS_DC) { +PHPDBG_API int phpdbg_mixed_read(int sock, char *ptr, int len, int tmo) { if (PHPDBG_G(flags) & PHPDBG_IS_REMOTE) { - return phpdbg_consume_bytes(sock, ptr, len, tmo TSRMLS_CC); + return phpdbg_consume_bytes(sock, ptr, len, tmo); } return read(sock, ptr, len); } -PHPDBG_API int phpdbg_mixed_write(int sock, const char *ptr, int len TSRMLS_DC) { +PHPDBG_API int phpdbg_mixed_write(int sock, const char *ptr, int len) { if (PHPDBG_G(flags) & PHPDBG_IS_REMOTE) { return phpdbg_send_bytes(sock, ptr, len); } @@ -195,9 +195,9 @@ PHPDBG_API int phpdbg_mixed_write(int sock, const char *ptr, int len TSRMLS_DC) } -PHPDBG_API int phpdbg_open_socket(const char *interface, unsigned short port TSRMLS_DC) { +PHPDBG_API int phpdbg_open_socket(const char *interface, unsigned short port) { struct addrinfo res; - int fd = phpdbg_create_listenable_socket(interface, port, &res TSRMLS_CC); + int fd = phpdbg_create_listenable_socket(interface, port, &res); if (fd == -1) { return -1; @@ -214,7 +214,7 @@ PHPDBG_API int phpdbg_open_socket(const char *interface, unsigned short port TSR } -PHPDBG_API int phpdbg_create_listenable_socket(const char *addr, unsigned short port, struct addrinfo *addr_res TSRMLS_DC) { +PHPDBG_API int phpdbg_create_listenable_socket(const char *addr, unsigned short port, struct addrinfo *addr_res) { int sock = -1, rc; int reuse = 1; struct in6_addr serveraddr; diff --git a/sapi/phpdbg/phpdbg_io.h b/sapi/phpdbg/phpdbg_io.h index a5659e88c6..631b16beb1 100644 --- a/sapi/phpdbg/phpdbg_io.h +++ b/sapi/phpdbg/phpdbg_io.h @@ -21,15 +21,15 @@ #include "phpdbg.h" -PHPDBG_API int phpdbg_consume_stdin_line(char *buf TSRMLS_DC); +PHPDBG_API int phpdbg_consume_stdin_line(char *buf); -PHPDBG_API int phpdbg_consume_bytes(int sock, char *ptr, int len, int tmo TSRMLS_DC); +PHPDBG_API int phpdbg_consume_bytes(int sock, char *ptr, int len, int tmo); PHPDBG_API int phpdbg_send_bytes(int sock, const char *ptr, int len); -PHPDBG_API int phpdbg_mixed_read(int sock, char *ptr, int len, int tmo TSRMLS_DC); -PHPDBG_API int phpdbg_mixed_write(int sock, const char *ptr, int len TSRMLS_DC); +PHPDBG_API int phpdbg_mixed_read(int sock, char *ptr, int len, int tmo); +PHPDBG_API int phpdbg_mixed_write(int sock, const char *ptr, int len); -PHPDBG_API int phpdbg_create_listenable_socket(const char *addr, unsigned short port, struct addrinfo *res TSRMLS_DC); -PHPDBG_API int phpdbg_open_socket(const char *interface, unsigned short port TSRMLS_DC); +PHPDBG_API int phpdbg_create_listenable_socket(const char *addr, unsigned short port, struct addrinfo *res); +PHPDBG_API int phpdbg_open_socket(const char *interface, unsigned short port); PHPDBG_API void phpdbg_close_socket(int sock); #endif /* PHPDBG_IO_H */ diff --git a/sapi/phpdbg/phpdbg_lexer.c b/sapi/phpdbg/phpdbg_lexer.c index 90f3a449da..76dfc393b8 100644 --- a/sapi/phpdbg/phpdbg_lexer.c +++ b/sapi/phpdbg/phpdbg_lexer.c @@ -29,7 +29,7 @@ ZEND_EXTERN_MODULE_GLOBALS(phpdbg); -void phpdbg_init_lexer (phpdbg_param_t *stack, char *input TSRMLS_DC) { +void phpdbg_init_lexer (phpdbg_param_t *stack, char *input) { PHPDBG_G(parser_stack) = stack; YYSETCONDITION(INITIAL); @@ -39,7 +39,6 @@ void phpdbg_init_lexer (phpdbg_param_t *stack, char *input TSRMLS_DC) { } int phpdbg_lex (phpdbg_param_t* yylval) { - TSRMLS_FETCH(); /* Slow, but this is not a major problem here. TODO: Use TSRMLS_DC */ restart: LEX(text) = YYCURSOR; diff --git a/sapi/phpdbg/phpdbg_lexer.h b/sapi/phpdbg/phpdbg_lexer.h index ab51e7daa8..d9ec56d489 100644 --- a/sapi/phpdbg/phpdbg_lexer.h +++ b/sapi/phpdbg/phpdbg_lexer.h @@ -34,7 +34,7 @@ typedef struct { #define yyparse phpdbg_parse #define yylex phpdbg_lex -void phpdbg_init_lexer (phpdbg_param_t *stack, char *input TSRMLS_DC); +void phpdbg_init_lexer (phpdbg_param_t *stack, char *input); int phpdbg_lex (phpdbg_param_t* yylval); diff --git a/sapi/phpdbg/phpdbg_lexer.l b/sapi/phpdbg/phpdbg_lexer.l index 0c27fc22ac..45d7c27fa5 100644 --- a/sapi/phpdbg/phpdbg_lexer.l +++ b/sapi/phpdbg/phpdbg_lexer.l @@ -27,7 +27,7 @@ ZEND_EXTERN_MODULE_GLOBALS(phpdbg); -void phpdbg_init_lexer (phpdbg_param_t *stack, char *input TSRMLS_DC) { +void phpdbg_init_lexer (phpdbg_param_t *stack, char *input) { PHPDBG_G(parser_stack) = stack; YYSETCONDITION(INITIAL); @@ -37,7 +37,6 @@ void phpdbg_init_lexer (phpdbg_param_t *stack, char *input TSRMLS_DC) { } int phpdbg_lex (phpdbg_param_t* yylval) { - TSRMLS_FETCH(); /* Slow, but this is not a major problem here. TODO: Use TSRMLS_DC */ restart: LEX(text) = YYCURSOR; diff --git a/sapi/phpdbg/phpdbg_list.c b/sapi/phpdbg/phpdbg_list.c index f201be9850..7404cd139b 100644 --- a/sapi/phpdbg/phpdbg_list.c +++ b/sapi/phpdbg/phpdbg_list.c @@ -47,22 +47,22 @@ const phpdbg_command_t phpdbg_list_commands[] = { PHPDBG_LIST(lines) /* {{{ */ { - if (!PHPDBG_G(exec) && !zend_is_executing(TSRMLS_C)) { + if (!PHPDBG_G(exec) && !zend_is_executing()) { phpdbg_error("inactive", "type=\"execution\"", "Not executing, and execution context not set"); return SUCCESS; } switch (param->type) { case NUMERIC_PARAM: { - const char *char_file = phpdbg_current_file(TSRMLS_C); + const char *char_file = phpdbg_current_file(); zend_string *file = zend_string_init(char_file, strlen(char_file), 0); - phpdbg_list_file(file, param->num < 0 ? 1 - param->num : param->num, (param->num < 0 ? param->num : 0) + zend_get_executed_lineno(TSRMLS_C), 0 TSRMLS_CC); + phpdbg_list_file(file, param->num < 0 ? 1 - param->num : param->num, (param->num < 0 ? param->num : 0) + zend_get_executed_lineno(), 0); efree(file); } break; case FILE_PARAM: { zend_string *file = zend_string_init(param->file.name, strlen(param->file.name), 0); - phpdbg_list_file(file, param->file.line, 0, 0 TSRMLS_CC); + phpdbg_list_file(file, param->file.line, 0, 0); efree(file); } break; @@ -74,7 +74,7 @@ PHPDBG_LIST(lines) /* {{{ */ PHPDBG_LIST(func) /* {{{ */ { - phpdbg_list_function_byname(param->str, param->len TSRMLS_CC); + phpdbg_list_function_byname(param->str, param->len); return SUCCESS; } /* }}} */ @@ -83,12 +83,12 @@ PHPDBG_LIST(method) /* {{{ */ { zend_class_entry *ce; - if (phpdbg_safe_class_lookup(param->method.class, strlen(param->method.class), &ce TSRMLS_CC) == SUCCESS) { + if (phpdbg_safe_class_lookup(param->method.class, strlen(param->method.class), &ce) == SUCCESS) { zend_function *function; char *lcname = zend_str_tolower_dup(param->method.name, strlen(param->method.name)); if ((function = zend_hash_str_find_ptr(&ce->function_table, lcname, strlen(lcname)))) { - phpdbg_list_function(function TSRMLS_CC); + phpdbg_list_function(function); } else { phpdbg_error("list", "type=\"notfound\" method=\"%s::%s\"", "Could not find %s::%s", param->method.class, param->method.name); } @@ -105,10 +105,10 @@ PHPDBG_LIST(class) /* {{{ */ { zend_class_entry *ce; - if (phpdbg_safe_class_lookup(param->str, param->len, &ce TSRMLS_CC) == SUCCESS) { + if (phpdbg_safe_class_lookup(param->str, param->len, &ce) == SUCCESS) { if (ce->type == ZEND_USER_CLASS) { if (ce->info.user.filename) { - phpdbg_list_file(ce->info.user.filename, ce->info.user.line_end - ce->info.user.line_start + 1, ce->info.user.line_start, 0 TSRMLS_CC); + phpdbg_list_file(ce->info.user.filename, ce->info.user.line_end - ce->info.user.line_start + 1, ce->info.user.line_start, 0); } else { phpdbg_error("list", "type=\"nosource\" class=\"%s\"", "The source of the requested class (%s) cannot be found", ce->name); } @@ -122,7 +122,7 @@ PHPDBG_LIST(class) /* {{{ */ return SUCCESS; } /* }}} */ -void phpdbg_list_file(zend_string *filename, uint count, int offset, uint highlight TSRMLS_DC) /* {{{ */ +void phpdbg_list_file(zend_string *filename, uint count, int offset, uint highlight) /* {{{ */ { uint line, lastline; phpdbg_file_source *data; @@ -176,7 +176,7 @@ void phpdbg_list_file(zend_string *filename, uint count, int offset, uint highli phpdbg_xml("</list>"); } /* }}} */ -void phpdbg_list_function(const zend_function *fbc TSRMLS_DC) /* {{{ */ +void phpdbg_list_function(const zend_function *fbc) /* {{{ */ { const zend_op_array *ops; @@ -187,10 +187,10 @@ void phpdbg_list_function(const zend_function *fbc TSRMLS_DC) /* {{{ */ ops = (zend_op_array *) fbc; - phpdbg_list_file(ops->filename, ops->line_end - ops->line_start + 1, ops->line_start, 0 TSRMLS_CC); + phpdbg_list_file(ops->filename, ops->line_end - ops->line_start + 1, ops->line_start, 0); } /* }}} */ -void phpdbg_list_function_byname(const char *str, size_t len TSRMLS_DC) /* {{{ */ +void phpdbg_list_function_byname(const char *str, size_t len) /* {{{ */ { HashTable *func_table = EG(function_table); zend_function* fbc; @@ -220,7 +220,7 @@ void phpdbg_list_function_byname(const char *str, size_t len TSRMLS_DC) /* {{{ * phpdbg_try_access { if ((fbc = zend_hash_str_find_ptr(func_table, func_name, func_name_len))) { - phpdbg_list_function(fbc TSRMLS_CC); + phpdbg_list_function(fbc); } else { phpdbg_error("list", "type=\"nofunction\" function=\"%s\"", "Function %s not found", func_name); } @@ -231,7 +231,7 @@ void phpdbg_list_function_byname(const char *str, size_t len TSRMLS_DC) /* {{{ * efree(func_name); } /* }}} */ -zend_op_array *phpdbg_compile_file(zend_file_handle *file, int type TSRMLS_DC) { +zend_op_array *phpdbg_compile_file(zend_file_handle *file, int type) { phpdbg_file_source data, *dataptr; zend_file_handle fake = {{0}}; zend_op_array *ret; @@ -240,7 +240,7 @@ zend_op_array *phpdbg_compile_file(zend_file_handle *file, int type TSRMLS_DC) { char *bufptr, *endptr; char resolved_path_buf[MAXPATHLEN]; - zend_stream_fixup(file, &data.buf, &data.len TSRMLS_CC); + zend_stream_fixup(file, &data.buf, &data.len); data.filename = filename; data.line[0] = 0; @@ -279,12 +279,12 @@ zend_op_array *phpdbg_compile_file(zend_file_handle *file, int type TSRMLS_DC) { dataptr = erealloc(dataptr, sizeof(phpdbg_file_source) + sizeof(uint) * line); zend_hash_str_add_ptr(&PHPDBG_G(file_sources), filename, strlen(filename), dataptr); - phpdbg_resolve_pending_file_break(filename TSRMLS_CC); + phpdbg_resolve_pending_file_break(filename); - ret = PHPDBG_G(compile_file)(&fake, type TSRMLS_CC); + ret = PHPDBG_G(compile_file)(&fake, type); fake.opened_path = NULL; - zend_file_handle_dtor(&fake TSRMLS_CC); + zend_file_handle_dtor(&fake); return ret; } @@ -302,7 +302,7 @@ void phpdbg_free_file_source(phpdbg_file_source *data) { efree(data); } -void phpdbg_init_list(TSRMLS_D) { +void phpdbg_init_list(void) { PHPDBG_G(compile_file) = zend_compile_file; zend_hash_init(&PHPDBG_G(file_sources), 1, NULL, (dtor_func_t) phpdbg_free_file_source, 0); zend_compile_file = phpdbg_compile_file; diff --git a/sapi/phpdbg/phpdbg_list.h b/sapi/phpdbg/phpdbg_list.h index 43a2d474d5..03d8754769 100644 --- a/sapi/phpdbg/phpdbg_list.h +++ b/sapi/phpdbg/phpdbg_list.h @@ -32,13 +32,13 @@ PHPDBG_LIST(class); PHPDBG_LIST(method); PHPDBG_LIST(func); -void phpdbg_list_function_byname(const char *, size_t TSRMLS_DC); -void phpdbg_list_function(const zend_function * TSRMLS_DC); -void phpdbg_list_file(zend_string *, uint, int, uint TSRMLS_DC); +void phpdbg_list_function_byname(const char *, size_t); +void phpdbg_list_function(const zend_function *); +void phpdbg_list_file(zend_string *, uint, int, uint); extern const phpdbg_command_t phpdbg_list_commands[]; -void phpdbg_init_list(TSRMLS_D); +void phpdbg_init_list(void); typedef struct { char *filename; diff --git a/sapi/phpdbg/phpdbg_opcode.c b/sapi/phpdbg/phpdbg_opcode.c index 20841cbc42..daf6453b4c 100644 --- a/sapi/phpdbg/phpdbg_opcode.c +++ b/sapi/phpdbg/phpdbg_opcode.c @@ -26,7 +26,7 @@ ZEND_EXTERN_MODULE_GLOBALS(phpdbg); -static inline uint32_t phpdbg_decode_literal(zend_op_array *ops, zval *literal TSRMLS_DC) /* {{{ */ +static inline uint32_t phpdbg_decode_literal(zend_op_array *ops, zval *literal) /* {{{ */ { int iter = 0; @@ -40,7 +40,7 @@ static inline uint32_t phpdbg_decode_literal(zend_op_array *ops, zval *literal T return 0; } /* }}} */ -static inline char *phpdbg_decode_op(zend_op_array *ops, znode_op *op, uint32_t type, HashTable *vars TSRMLS_DC) /* {{{ */ +static inline char *phpdbg_decode_op(zend_op_array *ops, znode_op *op, uint32_t type, HashTable *vars) /* {{{ */ { char *decode = NULL; @@ -64,7 +64,7 @@ static inline char *phpdbg_decode_op(zend_op_array *ops, znode_op *op, uint32_t } break; case IS_CONST: - asprintf(&decode, "C%u", phpdbg_decode_literal(ops, RT_CONSTANT(ops, *op) TSRMLS_CC)); + asprintf(&decode, "C%u", phpdbg_decode_literal(ops, RT_CONSTANT(ops, *op))); break; case IS_UNUSED: @@ -74,7 +74,7 @@ static inline char *phpdbg_decode_op(zend_op_array *ops, znode_op *op, uint32_t return decode; } /* }}} */ -char *phpdbg_decode_opline(zend_op_array *ops, zend_op *op, HashTable *vars TSRMLS_DC) /*{{{ */ +char *phpdbg_decode_opline(zend_op_array *ops, zend_op *op, HashTable *vars) /*{{{ */ { char *decode[4] = {NULL, NULL, NULL, NULL}; @@ -90,7 +90,7 @@ char *phpdbg_decode_opline(zend_op_array *ops, zend_op *op, HashTable *vars TSRM goto format; case ZEND_JMPZNZ: - decode[1] = phpdbg_decode_op(ops, &op->op1, op->op1_type, vars TSRMLS_CC); + decode[1] = phpdbg_decode_op(ops, &op->op1, op->op1_type, vars); asprintf(&decode[2], "J%u or J%llu", op->op2.opline_num, op->extended_value); goto result; @@ -102,7 +102,7 @@ char *phpdbg_decode_opline(zend_op_array *ops, zend_op *op, HashTable *vars TSRM #ifdef ZEND_JMP_SET case ZEND_JMP_SET: #endif - decode[1] = phpdbg_decode_op(ops, &op->op1, op->op1_type, vars TSRMLS_CC); + decode[1] = phpdbg_decode_op(ops, &op->op1, op->op1_type, vars); asprintf(&decode[2], "J%ld", OP_JMP_ADDR(op, op->op2) - ops->opcodes); goto result; @@ -110,10 +110,10 @@ char *phpdbg_decode_opline(zend_op_array *ops, zend_op *op, HashTable *vars TSRM goto result; default: { - decode[1] = phpdbg_decode_op(ops, &op->op1, op->op1_type, vars TSRMLS_CC); - decode[2] = phpdbg_decode_op(ops, &op->op2, op->op2_type, vars TSRMLS_CC); + decode[1] = phpdbg_decode_op(ops, &op->op1, op->op1_type, vars); + decode[2] = phpdbg_decode_op(ops, &op->op2, op->op2_type, vars); result: - decode[3] = phpdbg_decode_op(ops, &op->result, op->result_type, vars TSRMLS_CC); + decode[3] = phpdbg_decode_op(ops, &op->result, op->result_type, vars); format: asprintf(&decode[0], "%-20s %-20s %-20s", @@ -133,7 +133,7 @@ format: return decode[0]; } /* }}} */ -void phpdbg_print_opline_ex(zend_execute_data *execute_data, HashTable *vars, zend_bool ignore_flags TSRMLS_DC) /* {{{ */ +void phpdbg_print_opline_ex(zend_execute_data *execute_data, HashTable *vars, zend_bool ignore_flags) /* {{{ */ { /* force out a line while stepping so the user knows what is happening */ if (ignore_flags || @@ -142,7 +142,7 @@ void phpdbg_print_opline_ex(zend_execute_data *execute_data, HashTable *vars, ze (PHPDBG_G(oplog)))) { zend_op *opline = (zend_op *) execute_data->opline; - char *decode = phpdbg_decode_opline(&execute_data->func->op_array, opline, vars TSRMLS_CC); + char *decode = phpdbg_decode_opline(&execute_data->func->op_array, opline, vars); if (ignore_flags || (!(PHPDBG_G(flags) & PHPDBG_IS_QUIET) || (PHPDBG_G(flags) & PHPDBG_IS_STEPPING))) { /* output line info */ @@ -169,9 +169,9 @@ void phpdbg_print_opline_ex(zend_execute_data *execute_data, HashTable *vars, ze } } /* }}} */ -void phpdbg_print_opline(zend_execute_data *execute_data, zend_bool ignore_flags TSRMLS_DC) /* {{{ */ +void phpdbg_print_opline(zend_execute_data *execute_data, zend_bool ignore_flags) /* {{{ */ { - phpdbg_print_opline_ex(execute_data, NULL, ignore_flags TSRMLS_CC); + phpdbg_print_opline_ex(execute_data, NULL, ignore_flags); } /* }}} */ const char *phpdbg_decode_opcode(zend_uchar opcode) /* {{{ */ diff --git a/sapi/phpdbg/phpdbg_opcode.h b/sapi/phpdbg/phpdbg_opcode.h index 144442981d..abcfda360f 100644 --- a/sapi/phpdbg/phpdbg_opcode.h +++ b/sapi/phpdbg/phpdbg_opcode.h @@ -24,8 +24,8 @@ #include "zend_types.h" const char *phpdbg_decode_opcode(zend_uchar); -char *phpdbg_decode_opline(zend_op_array *ops, zend_op *op, HashTable *vars TSRMLS_DC); -void phpdbg_print_opline(zend_execute_data *execute_data, zend_bool ignore_flags TSRMLS_DC); -void phpdbg_print_opline_ex(zend_execute_data *execute_data, HashTable *vars, zend_bool ignore_flags TSRMLS_DC); +char *phpdbg_decode_opline(zend_op_array *ops, zend_op *op, HashTable *vars); +void phpdbg_print_opline(zend_execute_data *execute_data, zend_bool ignore_flags); +void phpdbg_print_opline_ex(zend_execute_data *execute_data, HashTable *vars, zend_bool ignore_flags); #endif /* PHPDBG_OPCODE_H */ diff --git a/sapi/phpdbg/phpdbg_out.c b/sapi/phpdbg/phpdbg_out.c index a9edd19ad9..d32d252e1a 100644 --- a/sapi/phpdbg/phpdbg_out.c +++ b/sapi/phpdbg/phpdbg_out.c @@ -129,7 +129,7 @@ typedef struct buf_area buffy; /* * Do format conversion placing the output in buffer */ -static int format_converter(register buffy *odp, const char *fmt, zend_bool escape_xml, va_list ap TSRMLS_DC) { +static int format_converter(register buffy *odp, const char *fmt, zend_bool escape_xml, va_list ap) { char *sp; char *bep; int cc = 0; @@ -333,7 +333,7 @@ static int format_converter(register buffy *odp, const char *fmt, zend_bool esca switch (*fmt) { case 'Z': zvp = (zval *) va_arg(ap, zval *); - free_zcopy = zend_make_printable_zval(zvp, &zcopy TSRMLS_CC); + free_zcopy = zend_make_printable_zval(zvp, &zcopy); if (free_zcopy) { zvp = &zcopy; } @@ -814,7 +814,7 @@ skip_output: return (cc); } -static void strx_printv(int *ccp, char *buf, size_t len, const char *format, zend_bool escape_xml, va_list ap TSRMLS_DC) { +static void strx_printv(int *ccp, char *buf, size_t len, const char *format, zend_bool escape_xml, va_list ap) { buffy od; int cc; @@ -834,7 +834,7 @@ static void strx_printv(int *ccp, char *buf, size_t len, const char *format, zen /* * Do the conversion */ - cc = format_converter(&od, format, escape_xml, ap TSRMLS_CC); + cc = format_converter(&od, format, escape_xml, ap); if (len != 0 && od.nextb <= od.buf_end) { *(od.nextb) = '\0'; } @@ -843,26 +843,26 @@ static void strx_printv(int *ccp, char *buf, size_t len, const char *format, zen } } -static int phpdbg_xml_vsnprintf(char *buf, size_t len, const char *format, zend_bool escape_xml, va_list ap TSRMLS_DC) { +static int phpdbg_xml_vsnprintf(char *buf, size_t len, const char *format, zend_bool escape_xml, va_list ap) { int cc; - strx_printv(&cc, buf, len, format, escape_xml, ap TSRMLS_CC); + strx_printv(&cc, buf, len, format, escape_xml, ap); return (cc); } -PHPDBG_API int phpdbg_xml_vasprintf(char **buf, const char *format, zend_bool escape_xml, va_list ap TSRMLS_DC) { +PHPDBG_API int phpdbg_xml_vasprintf(char **buf, const char *format, zend_bool escape_xml, va_list ap) { va_list ap2; int cc; va_copy(ap2, ap); - cc = phpdbg_xml_vsnprintf(NULL, 0, format, escape_xml, ap2 TSRMLS_CC); + cc = phpdbg_xml_vsnprintf(NULL, 0, format, escape_xml, ap2); va_end(ap2); *buf = NULL; if (cc >= 0) { if ((*buf = emalloc(++cc)) != NULL) { - if ((cc = phpdbg_xml_vsnprintf(*buf, cc, format, escape_xml, ap TSRMLS_CC)) < 0) { + if ((cc = phpdbg_xml_vsnprintf(*buf, cc, format, escape_xml, ap)) < 0) { efree(*buf); *buf = NULL; } @@ -873,23 +873,23 @@ PHPDBG_API int phpdbg_xml_vasprintf(char **buf, const char *format, zend_bool es } /* copy end */ -PHPDBG_API int _phpdbg_xml_asprintf(char **buf TSRMLS_DC, const char *format, zend_bool escape_xml, ...) { +PHPDBG_API int _phpdbg_xml_asprintf(char **buf, const char *format, zend_bool escape_xml, ...) { int ret; va_list va; va_start(va, escape_xml); - ret = phpdbg_xml_vasprintf(buf, format, escape_xml, va TSRMLS_CC); + ret = phpdbg_xml_vasprintf(buf, format, escape_xml, va); va_end(va); return ret; } -PHPDBG_API int _phpdbg_asprintf(char **buf TSRMLS_DC, const char *format, ...) { +PHPDBG_API int _phpdbg_asprintf(char **buf, const char *format, ...) { int ret; va_list va; va_start(va, format); - ret = phpdbg_xml_vasprintf(buf, format, 0, va TSRMLS_CC); + ret = phpdbg_xml_vasprintf(buf, format, 0, va); va_end(va); return ret; @@ -949,13 +949,13 @@ static void phpdbg_encode_ctrl_chars(char **buf, int *buflen) { *buflen = len; } -static int phpdbg_process_print(int fd, int type, const char *tag, const char *msg, int msglen, const char *xml, int xmllen TSRMLS_DC) { +static int phpdbg_process_print(int fd, int type, const char *tag, const char *msg, int msglen, const char *xml, int xmllen) { char *msgout = NULL, *buf; int msgoutlen, xmloutlen, buflen; const char *severity; if ((PHPDBG_G(flags) & PHPDBG_WRITE_XML) && PHPDBG_G(in_script_xml) && PHPDBG_G(in_script_xml) != type) { - phpdbg_mixed_write(fd, ZEND_STRL("</stream>") TSRMLS_CC); + phpdbg_mixed_write(fd, ZEND_STRL("</stream>")); PHPDBG_G(in_script_xml) = 0; } @@ -964,9 +964,9 @@ static int phpdbg_process_print(int fd, int type, const char *tag, const char *m severity = "error"; if (!PHPDBG_G(last_was_newline)) { if (PHPDBG_G(flags) & PHPDBG_WRITE_XML) { - phpdbg_mixed_write(fd, ZEND_STRL("<phpdbg>\n" "</phpdbg>") TSRMLS_CC); + phpdbg_mixed_write(fd, ZEND_STRL("<phpdbg>\n" "</phpdbg>")); } else { - phpdbg_mixed_write(fd, ZEND_STRL("\n") TSRMLS_CC); + phpdbg_mixed_write(fd, ZEND_STRL("\n")); } PHPDBG_G(last_was_newline) = 1; } @@ -981,9 +981,9 @@ static int phpdbg_process_print(int fd, int type, const char *tag, const char *m severity = "notice"; if (!PHPDBG_G(last_was_newline)) { if (PHPDBG_G(flags) & PHPDBG_WRITE_XML) { - phpdbg_mixed_write(fd, ZEND_STRL("<phpdbg>\n" "</phpdbg>") TSRMLS_CC); + phpdbg_mixed_write(fd, ZEND_STRL("<phpdbg>\n" "</phpdbg>")); } else { - phpdbg_mixed_write(fd, ZEND_STRL("\n") TSRMLS_CC); + phpdbg_mixed_write(fd, ZEND_STRL("\n")); } PHPDBG_G(last_was_newline) = 1; } @@ -1027,18 +1027,18 @@ static int phpdbg_process_print(int fd, int type, const char *tag, const char *m if (PHPDBG_G(in_script_xml) != type) { char *stream_buf; int stream_buflen = phpdbg_asprintf(&stream_buf, "<stream type=\"%s\">", type == P_STDERR ? "stderr" : "stdout"); - phpdbg_mixed_write(fd, stream_buf, stream_buflen TSRMLS_CC); + phpdbg_mixed_write(fd, stream_buf, stream_buflen); efree(stream_buf); PHPDBG_G(in_script_xml) = type; } - encoded = php_escape_html_entities((unsigned char *) msg, msglen, 0, ENT_NOQUOTES, PG(internal_encoding) && PG(internal_encoding)[0] ? PG(internal_encoding) : (SG(default_charset) ? SG(default_charset) : "UTF-8") TSRMLS_CC); + encoded = php_escape_html_entities((unsigned char *) msg, msglen, 0, ENT_NOQUOTES, PG(internal_encoding) && PG(internal_encoding)[0] ? PG(internal_encoding) : (SG(default_charset) ? SG(default_charset) : "UTF-8")); buflen = encoded->len; memcpy(buf = emalloc(buflen + 1), encoded->val, buflen); phpdbg_encode_ctrl_chars(&buf, &buflen); - phpdbg_mixed_write(fd, buf, buflen TSRMLS_CC); + phpdbg_mixed_write(fd, buf, buflen); efree(buf); } else { - phpdbg_mixed_write(fd, msg, msglen TSRMLS_CC); + phpdbg_mixed_write(fd, msg, msglen); } return msglen; } @@ -1076,12 +1076,12 @@ static int phpdbg_process_print(int fd, int type, const char *tag, const char *m } phpdbg_encode_ctrl_chars(&xmlout, &xmloutlen); - phpdbg_eol_convert(&xmlout, &xmloutlen TSRMLS_CC); - phpdbg_mixed_write(fd, xmlout, xmloutlen TSRMLS_CC); + phpdbg_eol_convert(&xmlout, &xmloutlen); + phpdbg_mixed_write(fd, xmlout, xmloutlen); efree(xmlout); } else if (msgout) { - phpdbg_eol_convert(&msgout, &msgoutlen TSRMLS_CC); - phpdbg_mixed_write(fd, msgout, msgoutlen TSRMLS_CC); + phpdbg_eol_convert(&msgout, &msgoutlen); + phpdbg_mixed_write(fd, msgout, msgoutlen); } if (PHPDBG_G(req_id) && (PHPDBG_G(flags) & PHPDBG_WRITE_XML)) { @@ -1095,7 +1095,7 @@ static int phpdbg_process_print(int fd, int type, const char *tag, const char *m return msgout ? msgoutlen : xmloutlen; } /* }}} */ -PHPDBG_API int phpdbg_vprint(int type TSRMLS_DC, int fd, const char *tag, const char *xmlfmt, const char *strfmt, va_list args) { +PHPDBG_API int phpdbg_vprint(int type, int fd, const char *tag, const char *xmlfmt, const char *strfmt, va_list args) { char *msg = NULL, *xml = NULL; int msglen = 0, xmllen = 0; int len; @@ -1103,14 +1103,14 @@ PHPDBG_API int phpdbg_vprint(int type TSRMLS_DC, int fd, const char *tag, const if (strfmt != NULL && strlen(strfmt) > 0L) { va_copy(argcpy, args); - msglen = phpdbg_xml_vasprintf(&msg, strfmt, 0, argcpy TSRMLS_CC); + msglen = phpdbg_xml_vasprintf(&msg, strfmt, 0, argcpy); va_end(argcpy); } if (PHPDBG_G(flags) & PHPDBG_WRITE_XML) { if (xmlfmt != NULL && strlen(xmlfmt) > 0L) { va_copy(argcpy, args); - xmllen = phpdbg_xml_vasprintf(&xml, xmlfmt, 1, argcpy TSRMLS_CC); + xmllen = phpdbg_xml_vasprintf(&xml, xmlfmt, 1, argcpy); va_end(argcpy); } else { xml = estrdup(""); @@ -1118,7 +1118,7 @@ PHPDBG_API int phpdbg_vprint(int type TSRMLS_DC, int fd, const char *tag, const } if (PHPDBG_G(err_buf).active && type != P_STDOUT && type != P_STDERR) { - phpdbg_free_err_buf(TSRMLS_C); + phpdbg_free_err_buf(); PHPDBG_G(err_buf).type = type; PHPDBG_G(err_buf).fd = fd; @@ -1133,7 +1133,7 @@ PHPDBG_API int phpdbg_vprint(int type TSRMLS_DC, int fd, const char *tag, const return msglen; } - len = phpdbg_process_print(fd, type, tag, msg, msglen, xml, xmllen TSRMLS_CC); + len = phpdbg_process_print(fd, type, tag, msg, msglen, xml, xmllen); if (msg) { efree(msg); @@ -1146,7 +1146,7 @@ PHPDBG_API int phpdbg_vprint(int type TSRMLS_DC, int fd, const char *tag, const return len; } -PHPDBG_API void phpdbg_free_err_buf(TSRMLS_D) { +PHPDBG_API void phpdbg_free_err_buf(void) { if (PHPDBG_G(err_buf).type == 0) { return; } @@ -1160,11 +1160,11 @@ PHPDBG_API void phpdbg_free_err_buf(TSRMLS_D) { } } -PHPDBG_API void phpdbg_activate_err_buf(zend_bool active TSRMLS_DC) { +PHPDBG_API void phpdbg_activate_err_buf(zend_bool active) { PHPDBG_G(err_buf).active = active; } -PHPDBG_API int phpdbg_output_err_buf(const char *tag, const char *xmlfmt, const char *strfmt TSRMLS_DC, ...) { +PHPDBG_API int phpdbg_output_err_buf(const char *tag, const char *xmlfmt, const char *strfmt, ...) { int len; va_list args; int errbuf_active = PHPDBG_G(err_buf).active; @@ -1175,21 +1175,17 @@ PHPDBG_API int phpdbg_output_err_buf(const char *tag, const char *xmlfmt, const PHPDBG_G(err_buf).active = 0; -#ifdef ZTS - va_start(args, tsrm_ls); -#else va_start(args, strfmt); -#endif - len = phpdbg_vprint(PHPDBG_G(err_buf).type TSRMLS_CC, PHPDBG_G(err_buf).fd, tag ? tag : PHPDBG_G(err_buf).tag, xmlfmt, strfmt, args); + len = phpdbg_vprint(PHPDBG_G(err_buf).type, PHPDBG_G(err_buf).fd, tag ? tag : PHPDBG_G(err_buf).tag, xmlfmt, strfmt, args); va_end(args); PHPDBG_G(err_buf).active = errbuf_active; - phpdbg_free_err_buf(TSRMLS_C); + phpdbg_free_err_buf(); return len; } -PHPDBG_API int phpdbg_print(int type TSRMLS_DC, int fd, const char *tag, const char *xmlfmt, const char *strfmt, ...) { +PHPDBG_API int phpdbg_print(int type, int fd, const char *tag, const char *xmlfmt, const char *strfmt, ...) { va_list args; int len; @@ -1198,13 +1194,13 @@ PHPDBG_API int phpdbg_print(int type TSRMLS_DC, int fd, const char *tag, const c } va_start(args, strfmt); - len = phpdbg_vprint(type TSRMLS_CC, fd, tag, xmlfmt, strfmt, args); + len = phpdbg_vprint(type, fd, tag, xmlfmt, strfmt, args); va_end(args); return len; } -PHPDBG_API int phpdbg_xml_internal(int fd TSRMLS_DC, const char *fmt, ...) { +PHPDBG_API int phpdbg_xml_internal(int fd, const char *fmt, ...) { int len = 0; if (PHPDBG_G(flags) & PHPDBG_DISCARD_OUTPUT) { @@ -1217,40 +1213,40 @@ PHPDBG_API int phpdbg_xml_internal(int fd TSRMLS_DC, const char *fmt, ...) { int buflen; va_start(args, fmt); - buflen = phpdbg_xml_vasprintf(&buffer, fmt, 1, args TSRMLS_CC); + buflen = phpdbg_xml_vasprintf(&buffer, fmt, 1, args); va_end(args); phpdbg_encode_ctrl_chars(&buffer, &buflen); if (PHPDBG_G(in_script_xml)) { - phpdbg_mixed_write(fd, ZEND_STRL("</stream>") TSRMLS_CC); + phpdbg_mixed_write(fd, ZEND_STRL("</stream>")); PHPDBG_G(in_script_xml) = 0; } - len = phpdbg_mixed_write(fd, buffer, buflen TSRMLS_CC); + len = phpdbg_mixed_write(fd, buffer, buflen); efree(buffer); } return len; } -PHPDBG_API int phpdbg_log_internal(int fd TSRMLS_DC, const char *fmt, ...) { +PHPDBG_API int phpdbg_log_internal(int fd, const char *fmt, ...) { va_list args; char *buffer; int buflen; int len = 0; va_start(args, fmt); - buflen = phpdbg_xml_vasprintf(&buffer, fmt, 0, args TSRMLS_CC); + buflen = phpdbg_xml_vasprintf(&buffer, fmt, 0, args); va_end(args); - len = phpdbg_mixed_write(fd, buffer, buflen TSRMLS_CC); + len = phpdbg_mixed_write(fd, buffer, buflen); efree(buffer); return len; } -PHPDBG_API int phpdbg_out_internal(int fd TSRMLS_DC, const char *fmt, ...) { +PHPDBG_API int phpdbg_out_internal(int fd, const char *fmt, ...) { va_list args; char *buffer; int buflen; @@ -1261,7 +1257,7 @@ PHPDBG_API int phpdbg_out_internal(int fd TSRMLS_DC, const char *fmt, ...) { } va_start(args, fmt); - buflen = phpdbg_xml_vasprintf(&buffer, fmt, 0, args TSRMLS_CC); + buflen = phpdbg_xml_vasprintf(&buffer, fmt, 0, args); va_end(args); if (PHPDBG_G(flags) & PHPDBG_WRITE_XML) { @@ -1270,26 +1266,26 @@ PHPDBG_API int phpdbg_out_internal(int fd TSRMLS_DC, const char *fmt, ...) { msglen = phpdbg_encode_xml(&msg, buffer, buflen, 256, NULL); phpdbg_encode_ctrl_chars(&msg, &msglen); - phpdbg_eol_convert(&msg, &msglen TSRMLS_CC); + phpdbg_eol_convert(&msg, &msglen); if (PHPDBG_G(in_script_xml)) { - phpdbg_mixed_write(fd, ZEND_STRL("</stream>") TSRMLS_CC); + phpdbg_mixed_write(fd, ZEND_STRL("</stream>")); PHPDBG_G(in_script_xml) = 0; } - phpdbg_mixed_write(fd, ZEND_STRL("<phpdbg>") TSRMLS_CC); - len = phpdbg_mixed_write(fd, msg, msglen TSRMLS_CC); - phpdbg_mixed_write(fd, ZEND_STRL("</phpdbg>") TSRMLS_CC); + phpdbg_mixed_write(fd, ZEND_STRL("<phpdbg>")); + len = phpdbg_mixed_write(fd, msg, msglen); + phpdbg_mixed_write(fd, ZEND_STRL("</phpdbg>")); } else { - phpdbg_eol_convert(&buffer, &buflen TSRMLS_CC); - len = phpdbg_mixed_write(fd, buffer, buflen TSRMLS_CC); + phpdbg_eol_convert(&buffer, &buflen); + len = phpdbg_mixed_write(fd, buffer, buflen); } return len; } -PHPDBG_API int phpdbg_rlog_internal(int fd TSRMLS_DC, const char *fmt, ...) { /* {{{ */ +PHPDBG_API int phpdbg_rlog_internal(int fd, const char *fmt, ...) { /* {{{ */ int rc = 0; va_list args; @@ -1308,10 +1304,10 @@ PHPDBG_API int phpdbg_rlog_internal(int fd TSRMLS_DC, const char *fmt, ...) { /* #endif phpdbg_asprintf(&buffer, friendly, tp.tv_usec/1000); phpdbg_asprintf(&format, "[%s]: %s\n", buffer, fmt); - rc = phpdbg_xml_vasprintf(&outbuf, format, 0, args TSRMLS_CC); + rc = phpdbg_xml_vasprintf(&outbuf, format, 0, args); if (outbuf) { - rc = phpdbg_mixed_write(fd, outbuf, rc TSRMLS_CC); + rc = phpdbg_mixed_write(fd, outbuf, rc); efree(outbuf); } diff --git a/sapi/phpdbg/phpdbg_out.h b/sapi/phpdbg/phpdbg_out.h index ea25b04279..871ea4dfeb 100644 --- a/sapi/phpdbg/phpdbg_out.h +++ b/sapi/phpdbg/phpdbg_out.h @@ -35,11 +35,11 @@ enum { }; #ifdef ZTS -PHPDBG_API int phpdbg_print(int severity TSRMLS_DC, int fd, const char *tag, const char *xmlfmt, const char *strfmt, ...) PHP_ATTRIBUTE_FORMAT(printf, 6, 7); -PHPDBG_API int phpdbg_xml_internal(int fd TSRMLS_DC, const char *fmt, ...) PHP_ATTRIBUTE_FORMAT(printf, 3, 4); -PHPDBG_API int phpdbg_log_internal(int fd TSRMLS_DC, const char *fmt, ...) PHP_ATTRIBUTE_FORMAT(printf, 3, 4); -PHPDBG_API int phpdbg_out_internal(int fd TSRMLS_DC, const char *fmt, ...) PHP_ATTRIBUTE_FORMAT(printf, 3, 4); -PHPDBG_API int phpdbg_rlog_internal(int fd TSRMLS_DC, const char *fmt, ...) PHP_ATTRIBUTE_FORMAT(printf, 3, 4); +PHPDBG_API int phpdbg_print(int severity, int fd, const char *tag, const char *xmlfmt, const char *strfmt, ...) PHP_ATTRIBUTE_FORMAT(printf, 6, 7); +PHPDBG_API int phpdbg_xml_internal(int fd, const char *fmt, ...) PHP_ATTRIBUTE_FORMAT(printf, 3, 4); +PHPDBG_API int phpdbg_log_internal(int fd, const char *fmt, ...) PHP_ATTRIBUTE_FORMAT(printf, 3, 4); +PHPDBG_API int phpdbg_out_internal(int fd, const char *fmt, ...) PHP_ATTRIBUTE_FORMAT(printf, 3, 4); +PHPDBG_API int phpdbg_rlog_internal(int fd, const char *fmt, ...) PHP_ATTRIBUTE_FORMAT(printf, 3, 4); #else PHPDBG_API int phpdbg_print(int severity, int fd, const char *tag, const char *xmlfmt, const char *strfmt, ...) PHP_ATTRIBUTE_FORMAT(printf, 5, 6); PHPDBG_API int phpdbg_xml_internal(int fd, const char *fmt, ...) PHP_ATTRIBUTE_FORMAT(printf, 2, 3); @@ -49,42 +49,42 @@ PHPDBG_API int phpdbg_rlog_internal(int fd, const char *fmt, ...) PHP_ATTRIBUTE_ #endif -#define phpdbg_error(tag, xmlfmt, strfmt, ...) phpdbg_print(P_ERROR TSRMLS_CC, PHPDBG_G(io)[PHPDBG_STDOUT].fd, tag, xmlfmt, strfmt, ##__VA_ARGS__) -#define phpdbg_notice(tag, xmlfmt, strfmt, ...) phpdbg_print(P_NOTICE TSRMLS_CC, PHPDBG_G(io)[PHPDBG_STDOUT].fd, tag, xmlfmt, strfmt, ##__VA_ARGS__) -#define phpdbg_writeln(tag, xmlfmt, strfmt, ...) phpdbg_print(P_WRITELN TSRMLS_CC, PHPDBG_G(io)[PHPDBG_STDOUT].fd, tag, xmlfmt, strfmt, ##__VA_ARGS__) -#define phpdbg_write(tag, xmlfmt, strfmt, ...) phpdbg_print(P_WRITE TSRMLS_CC, PHPDBG_G(io)[PHPDBG_STDOUT].fd, tag, xmlfmt, strfmt, ##__VA_ARGS__) -#define phpdbg_script(type, fmt, ...) phpdbg_print(type TSRMLS_CC, PHPDBG_G(io)[PHPDBG_STDOUT].fd, NULL, NULL, fmt, ##__VA_ARGS__) -#define phpdbg_log(fmt, ...) phpdbg_log_internal(PHPDBG_G(io)[PHPDBG_STDOUT].fd TSRMLS_CC, fmt, ##__VA_ARGS__) -#define phpdbg_xml(fmt, ...) phpdbg_xml_internal(PHPDBG_G(io)[PHPDBG_STDOUT].fd TSRMLS_CC, fmt, ##__VA_ARGS__) -#define phpdbg_out(fmt, ...) phpdbg_out_internal(PHPDBG_G(io)[PHPDBG_STDOUT].fd TSRMLS_CC, fmt, ##__VA_ARGS__) +#define phpdbg_error(tag, xmlfmt, strfmt, ...) phpdbg_print(P_ERROR , PHPDBG_G(io)[PHPDBG_STDOUT].fd, tag, xmlfmt, strfmt, ##__VA_ARGS__) +#define phpdbg_notice(tag, xmlfmt, strfmt, ...) phpdbg_print(P_NOTICE , PHPDBG_G(io)[PHPDBG_STDOUT].fd, tag, xmlfmt, strfmt, ##__VA_ARGS__) +#define phpdbg_writeln(tag, xmlfmt, strfmt, ...) phpdbg_print(P_WRITELN, PHPDBG_G(io)[PHPDBG_STDOUT].fd, tag, xmlfmt, strfmt, ##__VA_ARGS__) +#define phpdbg_write(tag, xmlfmt, strfmt, ...) phpdbg_print(P_WRITE , PHPDBG_G(io)[PHPDBG_STDOUT].fd, tag, xmlfmt, strfmt, ##__VA_ARGS__) +#define phpdbg_script(type, fmt, ...) phpdbg_print(type , PHPDBG_G(io)[PHPDBG_STDOUT].fd, NULL, NULL, fmt, ##__VA_ARGS__) +#define phpdbg_log(fmt, ...) phpdbg_log_internal(PHPDBG_G(io)[PHPDBG_STDOUT].fd, fmt, ##__VA_ARGS__) +#define phpdbg_xml(fmt, ...) phpdbg_xml_internal(PHPDBG_G(io)[PHPDBG_STDOUT].fd, fmt, ##__VA_ARGS__) +#define phpdbg_out(fmt, ...) phpdbg_out_internal(PHPDBG_G(io)[PHPDBG_STDOUT].fd, fmt, ##__VA_ARGS__) -#define phpdbg_error_ex(out, tag, xmlfmt, strfmt, ...) phpdbg_print(P_ERROR TSRMLS_CC, out, tag, xmlfmt, strfmt, ##__VA_ARGS__) -#define phpdbg_notice_ex(out, tag, xmlfmt, strfmt, ...) phpdbg_print(P_NOTICE TSRMLS_CC, out, tag, xmlfmt, strfmt, ##__VA_ARGS__) -#define phpdbg_writeln_ex(out, tag, xmlfmt, strfmt, ...) phpdbg_print(P_WRITELN TSRMLS_CC, out, tag, xmlfmt, strfmt, ##__VA_ARGS__) -#define phpdbg_write_ex(out, tag, xmlfmt, strfmt, ...) phpdbg_print(P_WRITE TSRMLS_CC, out, tag, xmlfmt, strfmt, ##__VA_ARGS__) -#define phpdbg_script_ex(out, type, fmt, ...) phpdbg_print(type TSRMLS_CC, out, NULL, NULL, fmt, ##__VA_ARGS__) -#define phpdbg_log_ex(out, fmt, ...) phpdbg_log_internal(PHPDBG_G(io)[PHPDBG_STDOUT].fd TSRMLS_CC, fmt, ##__VA_ARGS__) -#define phpdbg_xml_ex(out, fmt, ...) phpdbg_xml_internal(PHPDBG_G(io)[PHPDBG_STDOUT].fd TSRMLS_CC, fmt, ##__VA_ARGS__) -#define phpdbg_out_ex(out, fmt, ...) phpdbg_out_internal(PHPDBG_G(io)[PHPDBG_STDOUT].fd TSRMLS_CC, fmt, ##__VA_ARGS__) +#define phpdbg_error_ex(out, tag, xmlfmt, strfmt, ...) phpdbg_print(P_ERROR , out, tag, xmlfmt, strfmt, ##__VA_ARGS__) +#define phpdbg_notice_ex(out, tag, xmlfmt, strfmt, ...) phpdbg_print(P_NOTICE , out, tag, xmlfmt, strfmt, ##__VA_ARGS__) +#define phpdbg_writeln_ex(out, tag, xmlfmt, strfmt, ...) phpdbg_print(P_WRITELN, out, tag, xmlfmt, strfmt, ##__VA_ARGS__) +#define phpdbg_write_ex(out, tag, xmlfmt, strfmt, ...) phpdbg_print(P_WRITE , out, tag, xmlfmt, strfmt, ##__VA_ARGS__) +#define phpdbg_script_ex(out, type, fmt, ...) phpdbg_print(type , out, NULL, NULL, fmt, ##__VA_ARGS__) +#define phpdbg_log_ex(out, fmt, ...) phpdbg_log_internal(PHPDBG_G(io)[PHPDBG_STDOUT].fd, fmt, ##__VA_ARGS__) +#define phpdbg_xml_ex(out, fmt, ...) phpdbg_xml_internal(PHPDBG_G(io)[PHPDBG_STDOUT].fd, fmt, ##__VA_ARGS__) +#define phpdbg_out_ex(out, fmt, ...) phpdbg_out_internal(PHPDBG_G(io)[PHPDBG_STDOUT].fd, fmt, ##__VA_ARGS__) -#define phpdbg_rlog(fd, fmt, ...) phpdbg_rlog_internal(fd TSRMLS_CC, fmt, ##__VA_ARGS__) +#define phpdbg_rlog(fd, fmt, ...) phpdbg_rlog_internal(fd, fmt, ##__VA_ARGS__) -#define phpdbg_xml_asprintf(buf, ...) _phpdbg_xml_asprintf(buf TSRMLS_CC, ##__VA_ARGS__) -PHPDBG_API int _phpdbg_xml_asprintf(char **buf TSRMLS_DC, const char *format, zend_bool escape_xml, ...); +#define phpdbg_xml_asprintf(buf, ...) _phpdbg_xml_asprintf(buf, ##__VA_ARGS__) +PHPDBG_API int _phpdbg_xml_asprintf(char **buf, const char *format, zend_bool escape_xml, ...); -#define phpdbg_asprintf(buf, ...) _phpdbg_asprintf(buf TSRMLS_CC, ##__VA_ARGS__) -PHPDBG_API int _phpdbg_asprintf(char **buf TSRMLS_DC, const char *format, ...); +#define phpdbg_asprintf(buf, ...) _phpdbg_asprintf(buf, ##__VA_ARGS__) +PHPDBG_API int _phpdbg_asprintf(char **buf, const char *format, ...); #if PHPDBG_DEBUG -# define phpdbg_debug(fmt, ...) phpdbg_log_ex(PHPDBG_G(io)[PHPDBG_STDERR].fd TSRMLS_CC, fmt, ##__VA_ARGS__) +# define phpdbg_debug(fmt, ...) phpdbg_log_ex(PHPDBG_G(io)[PHPDBG_STDERR].fd, fmt, ##__VA_ARGS__) #else # define phpdbg_debug(fmt, ...) #endif -PHPDBG_API void phpdbg_free_err_buf(TSRMLS_D); -PHPDBG_API void phpdbg_activate_err_buf(zend_bool active TSRMLS_DC); -PHPDBG_API int phpdbg_output_err_buf(const char *tag, const char *xmlfmt, const char *strfmt TSRMLS_DC, ...); +PHPDBG_API void phpdbg_free_err_buf(void); +PHPDBG_API void phpdbg_activate_err_buf(zend_bool active); +PHPDBG_API int phpdbg_output_err_buf(const char *tag, const char *xmlfmt, const char *strfmt, ...); /* {{{ For separation */ diff --git a/sapi/phpdbg/phpdbg_parser.c b/sapi/phpdbg/phpdbg_parser.c index b4da3ed593..61f98b0cb6 100644 --- a/sapi/phpdbg/phpdbg_parser.c +++ b/sapi/phpdbg/phpdbg_parser.c @@ -1,8 +1,10 @@ -/* A Bison parser, made by GNU Bison 2.7.12-4996. */ -/* Bison implementation for Yacc-like parsers in C +/* A Bison parser, made by GNU Bison 2.4.1. */ + +/* Skeleton implementation for Bison's Yacc-like parsers in C - Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc. + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 + 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 @@ -44,7 +46,7 @@ #define YYBISON 1 /* Bison version. */ -#define YYBISON_VERSION "2.7.12-4996" +#define YYBISON_VERSION "2.4.1" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" @@ -58,6 +60,8 @@ /* Pull parsers. */ #define YYPULL 1 +/* Using locations. */ +#define YYLSP_NEEDED 0 /* Substitute the variable and function names. */ #define yyparse phpdbg_parse @@ -68,9 +72,11 @@ #define yydebug phpdbg_debug #define yynerrs phpdbg_nerrs + /* Copy the first part of user declarations. */ -/* Line 371 of yacc.c */ -#line 1 "/Users/Bob/php-src-X/sapi/phpdbg/phpdbg_parser.y" + +/* Line 189 of yacc.c */ +#line 1 "sapi/phpdbg/phpdbg_parser.y" /* @@ -92,21 +98,19 @@ #include "phpdbg_lexer.h" #undef yyerror -static int yyerror(void ***tsrm_ls, const char *msg); +static int yyerror(const char *msg); ZEND_EXTERN_MODULE_GLOBALS(phpdbg); -/* Line 371 of yacc.c */ -#line 102 "sapi/phpdbg/phpdbg_parser.c" -# ifndef YY_NULL -# if defined __cplusplus && 201103L <= __cplusplus -# define YY_NULL nullptr -# else -# define YY_NULL 0 -# endif -# endif +/* Line 189 of yacc.c */ +#line 109 "sapi/phpdbg/phpdbg_parser.c" + +/* Enabling traces. */ +#ifndef YYDEBUG +# define YYDEBUG 0 +#endif /* Enabling verbose error messages. */ #ifdef YYERROR_VERBOSE @@ -116,20 +120,15 @@ ZEND_EXTERN_MODULE_GLOBALS(phpdbg); # 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; +/* Enabling the token table. */ +#ifndef YYTOKEN_TABLE +# define YYTOKEN_TABLE 0 #endif + /* "%code requires" blocks. */ -/* Line 387 of yacc.c */ -#line 31 "/Users/Bob/php-src-X/sapi/phpdbg/phpdbg_parser.y" + +/* Line 209 of yacc.c */ +#line 31 "sapi/phpdbg/phpdbg_parser.y" #include "phpdbg.h" #ifndef YY_TYPEDEF_YY_SCANNER_T @@ -138,7 +137,8 @@ typedef void* yyscan_t; #endif -/* Line 387 of yacc.c */ + +/* Line 209 of yacc.c */ #line 143 "sapi/phpdbg/phpdbg_parser.c" /* Tokens. */ @@ -168,26 +168,6 @@ typedef void* yyscan_t; T_REQ_ID = 276 }; #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_PROTO 268 -#define T_DIGITS 269 -#define T_LITERAL 270 -#define T_ADDR 271 -#define T_OPCODE 272 -#define T_ID 273 -#define T_INPUT 274 -#define T_UNEXPECTED 275 -#define T_REQ_ID 276 @@ -199,26 +179,11 @@ typedef int YYSTYPE; #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 *tsrm_ls); -#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 222 "sapi/phpdbg/phpdbg_parser.c" + +/* Line 264 of yacc.c */ +#line 187 "sapi/phpdbg/phpdbg_parser.c" #ifdef short # undef short @@ -268,36 +233,27 @@ typedef short int yytype_int16; #define YYSIZE_MAXIMUM ((YYSIZE_T) -1) #ifndef YY_ -# if defined YYENABLE_NLS && YYENABLE_NLS +# if YYENABLE_NLS # if ENABLE_NLS # include <libintl.h> /* INFRINGES ON USER NAME SPACE */ -# define YY_(Msgid) dgettext ("bison-runtime", Msgid) +# 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 */ +# define YY_(msgid) msgid # endif #endif /* Suppress unused-variable warnings by "using" E. */ #if ! defined lint || defined __GNUC__ -# define YYUSE(E) ((void) (E)) +# define YYUSE(e) ((void) (e)) #else -# define YYUSE(E) /* empty */ +# define YYUSE(e) /* empty */ #endif - /* Identity function, used to suppress warnings about constant conditions. */ #ifndef lint -# define YYID(N) (N) +# define YYID(n) (n) #else #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) @@ -330,12 +286,11 @@ YYID (yyi) # define alloca _alloca # else # define YYSTACK_ALLOC alloca -# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ +# if ! defined _ALLOCA_H && ! defined _STDLIB_H && (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 +# ifndef _STDLIB_H +# define _STDLIB_H 1 # endif # endif # endif @@ -358,24 +313,24 @@ YYID (yyi) # ifndef YYSTACK_ALLOC_MAXIMUM # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM # endif -# if (defined __cplusplus && ! defined EXIT_SUCCESS \ +# if (defined __cplusplus && ! defined _STDLIB_H \ && ! ((defined YYMALLOC || defined malloc) \ && (defined YYFREE || defined free))) # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ -# ifndef EXIT_SUCCESS -# define EXIT_SUCCESS 0 +# ifndef _STDLIB_H +# define _STDLIB_H 1 # endif # endif # ifndef YYMALLOC # define YYMALLOC malloc -# if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ +# if ! defined malloc && ! defined _STDLIB_H && (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__ \ +# if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) void free (void *); /* INFRINGES ON USER NAME SPACE */ # endif @@ -404,7 +359,23 @@ union yyalloc ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ + YYSTACK_GAP_MAXIMUM) -# define YYCOPY_NEEDED 1 +/* Copy COUNT objects from FROM to TO. The source and destination do + not overlap. */ +# ifndef YYCOPY +# if defined __GNUC__ && 1 < __GNUC__ +# define YYCOPY(To, From, Count) \ + __builtin_memcpy (To, From, (Count) * sizeof (*(From))) +# else +# define YYCOPY(To, From, Count) \ + do \ + { \ + YYSIZE_T yyi; \ + for (yyi = 0; yyi < (Count); yyi++) \ + (To)[yyi] = (From)[yyi]; \ + } \ + while (YYID (0)) +# endif +# endif /* Relocate STACK from its old location to the new one. The local variables YYSIZE and YYSTACKSIZE give the old and new number of @@ -424,26 +395,6 @@ union yyalloc #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 26 /* YYLAST -- Last index in YYTABLE. */ @@ -525,13 +476,13 @@ static const yytype_int8 yyrhs[] = /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const yytype_uint8 yyrline[] = { - 0, 67, 67, 68, 69, 73, 74, 75, 79, 84, - 89, 99, 109, 114, 120, 126, 131, 132, 133, 134, - 135, 136, 137, 141, 142, 146, 151, 156, 160 + 0, 65, 65, 66, 67, 71, 72, 73, 77, 82, + 87, 97, 107, 112, 118, 124, 129, 130, 131, 132, + 133, 134, 135, 139, 140, 144, 149, 154, 158 }; #endif -#if YYDEBUG || YYERROR_VERBOSE || 1 +#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. First, the terminals, then, starting at YYNTOKENS, nonterminals. */ static const char *const yytname[] = @@ -545,7 +496,7 @@ static const char *const yytname[] = "\"opcode\"", "\"identifier (command or function name)\"", "\"input (input string or data)\"", "\"input\"", "\"request id (-r %d)\"", "$accept", "input", "parameters", "parameter", - "req_id", "full_expression", YY_NULL + "req_id", "full_expression", 0 }; #endif @@ -576,8 +527,8 @@ static const yytype_uint8 yyr2[] = 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 +/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state + STATE-NUM when YYTABLE doesn't specify something else to do. Zero means the default is an error. */ static const yytype_uint8 yydefact[] = { @@ -614,7 +565,8 @@ static const yytype_int8 yypgoto[] = /* 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. */ + number is the opposite. If zero, do what YYDEFACT says. + If YYTABLE_NINF, syntax error. */ #define YYTABLE_NINF -1 static const yytype_uint8 yytable[] = { @@ -625,12 +577,6 @@ static const yytype_uint8 yytable[] = 32, 36, 39, 40, 0, 0, 41, 42, 27 }; -#define yypact_value_is_default(Yystate) \ - (!!((Yystate) == (-16))) - -#define yytable_value_is_error(Yytable_value) \ - YYID (0) - static const yytype_int8 yycheck[] = { 3, 4, 5, 6, 7, 8, 21, 2, 3, 19, @@ -663,50 +609,78 @@ static const yytype_uint8 yystos[] = /* 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. */ + Once GCC version 2 has supplanted version 1, this can go. */ #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 (tsrm_ls, YY_("syntax error: cannot back up")); \ +#define YYBACKUP(Token, Value) \ +do \ + if (yychar == YYEMPTY && yylen == 1) \ + { \ + yychar = (Token); \ + yylval = (Value); \ + yytoken = YYTRANSLATE (yychar); \ + YYPOPSTACK (1); \ + 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. */ +/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. + If N is 0, then set CURRENT to the empty location which ends + the previous symbol: RHS[0] (always defined). */ + +#define YYRHSLOC(Rhs, K) ((Rhs)[K]) +#ifndef YYLLOC_DEFAULT +# define YYLLOC_DEFAULT(Current, Rhs, N) \ + do \ + if (YYID (N)) \ + { \ + (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ + (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ + (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ + (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ + } \ + else \ + { \ + (Current).first_line = (Current).last_line = \ + YYRHSLOC (Rhs, 0).last_line; \ + (Current).first_column = (Current).last_column = \ + YYRHSLOC (Rhs, 0).last_column; \ + } \ + while (YYID (0)) +#endif + + +/* YY_LOCATION_PRINT -- Print the location on the stream. + This macro was not mandated originally: define only if we know + we won't break user code: when these are the locations we know. */ + #ifndef YY_LOCATION_PRINT -# define YY_LOCATION_PRINT(File, Loc) ((void) 0) +# if YYLTYPE_IS_TRIVIAL +# define YY_LOCATION_PRINT(File, Loc) \ + fprintf (File, "%d.%d-%d.%d", \ + (Loc).first_line, (Loc).first_column, \ + (Loc).last_line, (Loc).last_column) +# else +# define YY_LOCATION_PRINT(File, Loc) ((void) 0) +# endif #endif /* YYLEX -- calling `yylex' with the right arguments. */ + #ifdef YYLEX_PARAM # define YYLEX yylex (&yylval, YYLEX_PARAM) #else @@ -733,7 +707,7 @@ do { \ { \ YYFPRINTF (stderr, "%s ", Title); \ yy_symbol_print (stderr, \ - Type, Value, tsrm_ls); \ + Type, Value); \ YYFPRINTF (stderr, "\n"); \ } \ } while (YYID (0)) @@ -747,28 +721,28 @@ do { \ #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, void *tsrm_ls) +yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) #else static void -yy_symbol_value_print (yyoutput, yytype, yyvaluep, tsrm_ls) +yy_symbol_value_print (yyoutput, yytype, yyvaluep) FILE *yyoutput; int yytype; YYSTYPE const * const yyvaluep; - void *tsrm_ls; #endif { - FILE *yyo = yyoutput; - YYUSE (yyo); if (!yyvaluep) return; - YYUSE (tsrm_ls); # ifdef YYPRINT if (yytype < YYNTOKENS) YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); # else YYUSE (yyoutput); # endif - YYUSE (yytype); + switch (yytype) + { + default: + break; + } } @@ -779,14 +753,13 @@ yy_symbol_value_print (yyoutput, yytype, yyvaluep, tsrm_ls) #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void -yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, void *tsrm_ls) +yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) #else static void -yy_symbol_print (yyoutput, yytype, yyvaluep, tsrm_ls) +yy_symbol_print (yyoutput, yytype, yyvaluep) FILE *yyoutput; int yytype; YYSTYPE const * const yyvaluep; - void *tsrm_ls; #endif { if (yytype < YYNTOKENS) @@ -794,7 +767,7 @@ yy_symbol_print (yyoutput, yytype, yyvaluep, tsrm_ls) else YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); - yy_symbol_value_print (yyoutput, yytype, yyvaluep, tsrm_ls); + yy_symbol_value_print (yyoutput, yytype, yyvaluep); YYFPRINTF (yyoutput, ")"); } @@ -837,13 +810,12 @@ do { \ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void -yy_reduce_print (YYSTYPE *yyvsp, int yyrule, void *tsrm_ls) +yy_reduce_print (YYSTYPE *yyvsp, int yyrule) #else static void -yy_reduce_print (yyvsp, yyrule, tsrm_ls) +yy_reduce_print (yyvsp, yyrule) YYSTYPE *yyvsp; int yyrule; - void *tsrm_ls; #endif { int yynrhs = yyr2[yyrule]; @@ -857,7 +829,7 @@ yy_reduce_print (yyvsp, yyrule, tsrm_ls) YYFPRINTF (stderr, " $%d = ", yyi + 1); yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], &(yyvsp[(yyi + 1) - (yynrhs)]) - , tsrm_ls); + ); YYFPRINTF (stderr, "\n"); } } @@ -865,7 +837,7 @@ yy_reduce_print (yyvsp, yyrule, tsrm_ls) # define YY_REDUCE_PRINT(Rule) \ do { \ if (yydebug) \ - yy_reduce_print (yyvsp, Rule, tsrm_ls); \ + yy_reduce_print (yyvsp, Rule); \ } while (YYID (0)) /* Nonzero means print parse trace. It is left uninitialized so that @@ -895,6 +867,7 @@ int yydebug; # define YYMAXDEPTH 10000 #endif + #if YYERROR_VERBOSE @@ -997,145 +970,115 @@ yytnamerr (char *yyres, const char *yystr) } # 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) +/* Copy into YYRESULT an error message about the unexpected token + YYCHAR while in state YYSTATE. Return the number of bytes copied, + including the terminating null byte. If YYRESULT is null, do not + copy anything; just return the number of bytes that would be + copied. As a special case, return 0 if an ordinary "syntax error" + message will do. Return YYSIZE_MAXIMUM if overflow occurs during + size calculation. */ +static YYSIZE_T +yysyntax_error (char *yyresult, int yystate, int yychar) { - 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; - } - } - } - } + int yyn = yypact[yystate]; - switch (yycount) + if (! (YYPACT_NINF < yyn && yyn <= YYLAST)) + return 0; + else { -# 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_ - } + int yytype = YYTRANSLATE (yychar); + YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); + YYSIZE_T yysize = yysize0; + YYSIZE_T yysize1; + int yysize_overflow = 0; + enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; + char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; + int yyx; + +# if 0 + /* This is so xgettext sees the translatable formats that are + constructed on the fly. */ + YY_("syntax error, unexpected %s"); + YY_("syntax error, unexpected %s, expecting %s"); + YY_("syntax error, unexpected %s, expecting %s or %s"); + YY_("syntax error, unexpected %s, expecting %s or %s or %s"); + YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"); +# endif + char *yyfmt; + char const *yyf; + static char const yyunexpected[] = "syntax error, unexpected %s"; + static char const yyexpecting[] = ", expecting %s"; + static char const yyor[] = " or %s"; + char yyformat[sizeof yyunexpected + + sizeof yyexpecting - 1 + + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) + * (sizeof yyor - 1))]; + char const *yyprefix = yyexpecting; + + /* Start YYX at -YYN if negative to avoid negative indexes in + YYCHECK. */ + 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 yycount = 1; + + yyarg[0] = yytname[yytype]; + yyfmt = yystpcpy (yyformat, yyunexpected); + + for (yyx = yyxbegin; yyx < yyxend; ++yyx) + if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) + { + if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) + { + yycount = 1; + yysize = yysize0; + yyformat[sizeof yyunexpected - 1] = '\0'; + break; + } + yyarg[yycount++] = yytname[yyx]; + yysize1 = yysize + yytnamerr (0, yytname[yyx]); + yysize_overflow |= (yysize1 < yysize); + yysize = yysize1; + yyfmt = yystpcpy (yyfmt, yyprefix); + yyprefix = yyor; + } - { - YYSIZE_T yysize1 = yysize + yystrlen (yyformat); - if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) - return 2; - yysize = yysize1; - } + yyf = YY_(yyformat); + yysize1 = yysize + yystrlen (yyf); + yysize_overflow |= (yysize1 < yysize); + 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; - } + if (yysize_overflow) + return YYSIZE_MAXIMUM; - /* 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; + if (yyresult) + { + /* 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 = yyresult; + int yyi = 0; + while ((*yyp = *yyf) != '\0') + { + if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) + { + yyp += yytnamerr (yyp, yyarg[yyi++]); + yyf += 2; + } + else + { + yyp++; + yyf++; + } + } + } + return yysize; + } } #endif /* YYERROR_VERBOSE */ + /*-----------------------------------------------. | Release the memory associated to this symbol. | @@ -1145,32 +1088,51 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void -yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, void *tsrm_ls) +yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) #else static void -yydestruct (yymsg, yytype, yyvaluep, tsrm_ls) +yydestruct (yymsg, yytype, yyvaluep) const char *yymsg; int yytype; YYSTYPE *yyvaluep; - void *tsrm_ls; #endif { YYUSE (yyvaluep); - YYUSE (tsrm_ls); if (!yymsg) yymsg = "Deleting"; YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); - YYUSE (yytype); + switch (yytype) + { + + default: + break; + } } +/* Prevent warnings from -Wmissing-prototypes. */ +#ifdef YYPARSE_PARAM +#if defined __STDC__ || defined __cplusplus +int yyparse (void *YYPARSE_PARAM); +#else +int yyparse (); +#endif +#else /* ! YYPARSE_PARAM */ +#if defined __STDC__ || defined __cplusplus +int yyparse (void); +#else +int yyparse (); +#endif +#endif /* ! YYPARSE_PARAM */ + + -/*----------. -| yyparse. | -`----------*/ +/*-------------------------. +| yyparse or yypush_parse. | +`-------------------------*/ #ifdef YYPARSE_PARAM #if (defined __STDC__ || defined __C99__FUNC__ \ @@ -1186,42 +1148,19 @@ yyparse (YYPARSE_PARAM) #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) int -yyparse (void *tsrm_ls) +yyparse (void) #else int -yyparse (tsrm_ls) - void *tsrm_ls; +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); +YYSTYPE yylval; /* Number of syntax errors so far. */ int yynerrs; @@ -1234,7 +1173,7 @@ YYSTYPE yylval YY_INITIAL_VALUE(yyval_default); `yyss': related to states. `yyvs': related to semantic values. - Refer to the stacks through separate pointers, to allow yyoverflow + Refer to the stacks thru separate pointers, to allow yyoverflow to reallocate them elsewhere. */ /* The state stack. */ @@ -1252,7 +1191,7 @@ YYSTYPE yylval YY_INITIAL_VALUE(yyval_default); int yyn; int yyresult; /* Lookahead token as an internal (translated) token number. */ - int yytoken = 0; + int yytoken; /* The variables used to return semantic value and location from the action routines. */ YYSTYPE yyval; @@ -1270,8 +1209,9 @@ YYSTYPE yylval YY_INITIAL_VALUE(yyval_default); Keep to zero when no symbol should be popped. */ int yylen = 0; - yyssp = yyss = yyssa; - yyvsp = yyvs = yyvsa; + yytoken = 0; + yyss = yyssa; + yyvs = yyvsa; yystacksize = YYINITDEPTH; YYDPRINTF ((stderr, "Starting parse\n")); @@ -1280,6 +1220,14 @@ YYSTYPE yylval YY_INITIAL_VALUE(yyval_default); yyerrstatus = 0; yynerrs = 0; yychar = YYEMPTY; /* Cause a token to be read. */ + + /* Initialize stack pointers. + Waste one element of value and location stack + so that they stay on the same level as the state stack. + The wasted elements are never initialized. */ + yyssp = yyss; + yyvsp = yyvs; + goto yysetstate; /*------------------------------------------------------------. @@ -1371,7 +1319,7 @@ yybackup: /* First try to decide what to do without reference to lookahead token. */ yyn = yypact[yystate]; - if (yypact_value_is_default (yyn)) + if (yyn == YYPACT_NINF) goto yydefault; /* Not known => get a lookahead token if don't already have one. */ @@ -1402,8 +1350,8 @@ yybackup: yyn = yytable[yyn]; if (yyn <= 0) { - if (yytable_value_is_error (yyn)) - goto yyerrlab; + if (yyn == 0 || yyn == YYTABLE_NINF) + goto yyerrlab; yyn = -yyn; goto yyreduce; } @@ -1420,9 +1368,7 @@ yybackup: yychar = YYEMPTY; yystate = yyn; - YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN *++yyvsp = yylval; - YY_IGNORE_MAYBE_UNINITIALIZED_END goto yynewstate; @@ -1459,52 +1405,59 @@ yyreduce: switch (yyn) { case 3: -/* Line 1802 of yacc.c */ -#line 68 "/Users/Bob/php-src-X/sapi/phpdbg/phpdbg_parser.y" - { phpdbg_stack_push(PHPDBG_G(parser_stack), &(yyvsp[(1) - (1)])); } + +/* Line 1455 of yacc.c */ +#line 66 "sapi/phpdbg/phpdbg_parser.y" + { phpdbg_stack_push(PHPDBG_G(parser_stack), &(yyvsp[(1) - (1)])); ;} break; case 5: -/* Line 1802 of yacc.c */ -#line 73 "/Users/Bob/php-src-X/sapi/phpdbg/phpdbg_parser.y" - { phpdbg_stack_push(PHPDBG_G(parser_stack), &(yyvsp[(1) - (1)])); } + +/* Line 1455 of yacc.c */ +#line 71 "sapi/phpdbg/phpdbg_parser.y" + { phpdbg_stack_push(PHPDBG_G(parser_stack), &(yyvsp[(1) - (1)])); ;} break; case 6: -/* Line 1802 of yacc.c */ -#line 74 "/Users/Bob/php-src-X/sapi/phpdbg/phpdbg_parser.y" - { phpdbg_stack_push(PHPDBG_G(parser_stack), &(yyvsp[(2) - (2)])); } + +/* Line 1455 of yacc.c */ +#line 72 "sapi/phpdbg/phpdbg_parser.y" + { phpdbg_stack_push(PHPDBG_G(parser_stack), &(yyvsp[(2) - (2)])); ;} break; case 7: -/* Line 1802 of yacc.c */ -#line 75 "/Users/Bob/php-src-X/sapi/phpdbg/phpdbg_parser.y" - { (yyval) = (yyvsp[(1) - (2)]); } + +/* Line 1455 of yacc.c */ +#line 73 "sapi/phpdbg/phpdbg_parser.y" + { (yyval) = (yyvsp[(1) - (2)]); ;} break; case 8: -/* Line 1802 of yacc.c */ -#line 79 "/Users/Bob/php-src-X/sapi/phpdbg/phpdbg_parser.y" + +/* Line 1455 of yacc.c */ +#line 77 "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 9: -/* Line 1802 of yacc.c */ -#line 84 "/Users/Bob/php-src-X/sapi/phpdbg/phpdbg_parser.y" + +/* Line 1455 of yacc.c */ +#line 82 "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 10: -/* Line 1802 of yacc.c */ -#line 89 "/Users/Bob/php-src-X/sapi/phpdbg/phpdbg_parser.y" + +/* Line 1455 of yacc.c */ +#line 87 "sapi/phpdbg/phpdbg_parser.y" { (yyval).type = FILE_PARAM; (yyval).file.name = malloc((yyvsp[(1) - (4)]).len + (yyvsp[(2) - (4)]).len + 1); @@ -1514,12 +1467,13 @@ yyreduce: (yyval).file.name[(yyvsp[(1) - (4)]).len + (yyvsp[(2) - (4)]).len] = '\0'; } (yyval).file.line = (yyvsp[(4) - (4)]).num; - } + ;} break; case 11: -/* Line 1802 of yacc.c */ -#line 99 "/Users/Bob/php-src-X/sapi/phpdbg/phpdbg_parser.y" + +/* Line 1455 of yacc.c */ +#line 97 "sapi/phpdbg/phpdbg_parser.y" { (yyval).type = NUMERIC_FILE_PARAM; (yyval).file.name = malloc((yyvsp[(1) - (5)]).len + (yyvsp[(2) - (5)]).len + 1); @@ -1529,154 +1483,160 @@ yyreduce: (yyval).file.name[(yyvsp[(1) - (5)]).len + (yyvsp[(2) - (5)]).len] = '\0'; } (yyval).file.line = (yyvsp[(5) - (5)]).num; - } + ;} break; case 12: -/* Line 1802 of yacc.c */ -#line 109 "/Users/Bob/php-src-X/sapi/phpdbg/phpdbg_parser.y" + +/* Line 1455 of yacc.c */ +#line 107 "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 13: -/* Line 1802 of yacc.c */ -#line 114 "/Users/Bob/php-src-X/sapi/phpdbg/phpdbg_parser.y" + +/* Line 1455 of yacc.c */ +#line 112 "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 14: -/* Line 1802 of yacc.c */ -#line 120 "/Users/Bob/php-src-X/sapi/phpdbg/phpdbg_parser.y" + +/* Line 1455 of yacc.c */ +#line 118 "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 15: -/* Line 1802 of yacc.c */ -#line 126 "/Users/Bob/php-src-X/sapi/phpdbg/phpdbg_parser.y" + +/* Line 1455 of yacc.c */ +#line 124 "sapi/phpdbg/phpdbg_parser.y" { (yyval).type = COND_PARAM; (yyval).str = (yyvsp[(2) - (2)]).str; (yyval).len = (yyvsp[(2) - (2)]).len; - } + ;} break; case 16: -/* Line 1802 of yacc.c */ -#line 131 "/Users/Bob/php-src-X/sapi/phpdbg/phpdbg_parser.y" - { (yyval) = (yyvsp[(1) - (1)]); } + +/* Line 1455 of yacc.c */ +#line 129 "sapi/phpdbg/phpdbg_parser.y" + { (yyval) = (yyvsp[(1) - (1)]); ;} break; case 17: -/* Line 1802 of yacc.c */ -#line 132 "/Users/Bob/php-src-X/sapi/phpdbg/phpdbg_parser.y" - { (yyval) = (yyvsp[(1) - (1)]); } + +/* Line 1455 of yacc.c */ +#line 130 "sapi/phpdbg/phpdbg_parser.y" + { (yyval) = (yyvsp[(1) - (1)]); ;} break; case 18: -/* Line 1802 of yacc.c */ -#line 133 "/Users/Bob/php-src-X/sapi/phpdbg/phpdbg_parser.y" - { (yyval) = (yyvsp[(1) - (1)]); } + +/* Line 1455 of yacc.c */ +#line 131 "sapi/phpdbg/phpdbg_parser.y" + { (yyval) = (yyvsp[(1) - (1)]); ;} break; case 19: -/* Line 1802 of yacc.c */ -#line 134 "/Users/Bob/php-src-X/sapi/phpdbg/phpdbg_parser.y" - { (yyval) = (yyvsp[(1) - (1)]); } + +/* Line 1455 of yacc.c */ +#line 132 "sapi/phpdbg/phpdbg_parser.y" + { (yyval) = (yyvsp[(1) - (1)]); ;} break; case 20: -/* Line 1802 of yacc.c */ -#line 135 "/Users/Bob/php-src-X/sapi/phpdbg/phpdbg_parser.y" - { (yyval) = (yyvsp[(1) - (1)]); } + +/* Line 1455 of yacc.c */ +#line 133 "sapi/phpdbg/phpdbg_parser.y" + { (yyval) = (yyvsp[(1) - (1)]); ;} break; case 21: -/* Line 1802 of yacc.c */ -#line 136 "/Users/Bob/php-src-X/sapi/phpdbg/phpdbg_parser.y" - { (yyval) = (yyvsp[(1) - (1)]); } + +/* Line 1455 of yacc.c */ +#line 134 "sapi/phpdbg/phpdbg_parser.y" + { (yyval) = (yyvsp[(1) - (1)]); ;} break; case 22: -/* Line 1802 of yacc.c */ -#line 137 "/Users/Bob/php-src-X/sapi/phpdbg/phpdbg_parser.y" - { (yyval) = (yyvsp[(1) - (1)]); } + +/* Line 1455 of yacc.c */ +#line 135 "sapi/phpdbg/phpdbg_parser.y" + { (yyval) = (yyvsp[(1) - (1)]); ;} break; case 23: -/* Line 1802 of yacc.c */ -#line 141 "/Users/Bob/php-src-X/sapi/phpdbg/phpdbg_parser.y" - { PHPDBG_G(req_id) = (yyvsp[(1) - (1)]).num; } + +/* Line 1455 of yacc.c */ +#line 139 "sapi/phpdbg/phpdbg_parser.y" + { PHPDBG_G(req_id) = (yyvsp[(1) - (1)]).num; ;} break; case 25: -/* Line 1802 of yacc.c */ -#line 146 "/Users/Bob/php-src-X/sapi/phpdbg/phpdbg_parser.y" + +/* Line 1455 of yacc.c */ +#line 144 "sapi/phpdbg/phpdbg_parser.y" { (yyval).type = EVAL_PARAM; (yyval).str = (yyvsp[(3) - (3)]).str; (yyval).len = (yyvsp[(3) - (3)]).len; - } + ;} break; case 26: -/* Line 1802 of yacc.c */ -#line 151 "/Users/Bob/php-src-X/sapi/phpdbg/phpdbg_parser.y" + +/* Line 1455 of yacc.c */ +#line 149 "sapi/phpdbg/phpdbg_parser.y" { (yyval).type = SHELL_PARAM; (yyval).str = (yyvsp[(3) - (3)]).str; (yyval).len = (yyvsp[(3) - (3)]).len; - } + ;} break; case 27: -/* Line 1802 of yacc.c */ -#line 156 "/Users/Bob/php-src-X/sapi/phpdbg/phpdbg_parser.y" + +/* Line 1455 of yacc.c */ +#line 154 "sapi/phpdbg/phpdbg_parser.y" { (yyval).type = RUN_PARAM; (yyval).len = 0; - } + ;} break; case 28: -/* Line 1802 of yacc.c */ -#line 160 "/Users/Bob/php-src-X/sapi/phpdbg/phpdbg_parser.y" + +/* Line 1455 of yacc.c */ +#line 158 "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 1667 "sapi/phpdbg/phpdbg_parser.c" + +/* Line 1455 of yacc.c */ +#line 1638 "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); @@ -1704,47 +1664,44 @@ yyreduce: | 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 (tsrm_ls, YY_("syntax error")); + 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 (tsrm_ls, yymsgp); - if (yysyntax_error_status == 2) - goto yyexhaustedlab; + YYSIZE_T yysize = yysyntax_error (0, yystate, yychar); + if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM) + { + YYSIZE_T yyalloc = 2 * yysize; + if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM)) + yyalloc = YYSTACK_ALLOC_MAXIMUM; + if (yymsg != yymsgbuf) + YYSTACK_FREE (yymsg); + yymsg = (char *) YYSTACK_ALLOC (yyalloc); + if (yymsg) + yymsg_alloc = yyalloc; + else + { + yymsg = yymsgbuf; + yymsg_alloc = sizeof yymsgbuf; + } + } + + if (0 < yysize && yysize <= yymsg_alloc) + { + (void) yysyntax_error (yymsg, yystate, yychar); + yyerror (yymsg); + } + else + { + yyerror (YY_("syntax error")); + if (yysize != 0) + goto yyexhaustedlab; + } } -# undef YYSYNTAX_ERROR #endif } @@ -1764,7 +1721,7 @@ yyerrlab: else { yydestruct ("Error: discarding", - yytoken, &yylval, tsrm_ls); + yytoken, &yylval); yychar = YYEMPTY; } } @@ -1803,7 +1760,7 @@ yyerrlab1: for (;;) { yyn = yypact[yystate]; - if (!yypact_value_is_default (yyn)) + if (yyn != YYPACT_NINF) { yyn += YYTERROR; if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) @@ -1820,15 +1777,13 @@ yyerrlab1: yydestruct ("Error: popping", - yystos[yystate], yyvsp, tsrm_ls); + 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. */ @@ -1852,25 +1807,20 @@ yyabortlab: yyresult = 1; goto yyreturn; -#if !defined yyoverflow || YYERROR_VERBOSE +#if !defined(yyoverflow) || YYERROR_VERBOSE /*-------------------------------------------------. | yyexhaustedlab -- memory exhaustion comes here. | `-------------------------------------------------*/ yyexhaustedlab: - yyerror (tsrm_ls, YY_("memory exhausted")); + 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, tsrm_ls); - } + yydestruct ("Cleanup: discarding lookahead", + yytoken, &yylval); /* Do not reclaim the symbols of the rule which action triggered this YYABORT or YYACCEPT. */ YYPOPSTACK (yylen); @@ -1878,7 +1828,7 @@ yyreturn: while (yyssp != yyss) { yydestruct ("Cleanup: popping", - yystos[*yyssp], yyvsp, tsrm_ls); + yystos[*yyssp], yyvsp); YYPOPSTACK (1); } #ifndef yyoverflow @@ -1894,11 +1844,12 @@ yyreturn: } -/* Line 2050 of yacc.c */ -#line 167 "/Users/Bob/php-src-X/sapi/phpdbg/phpdbg_parser.y" + +/* Line 1675 of yacc.c */ +#line 165 "sapi/phpdbg/phpdbg_parser.y" -static int yyerror(void ***tsrm_ls, const char *msg) { +static int yyerror(const char *msg) { phpdbg_error("command", "type=\"parseerror\" msg=\"%s\"", "Parse Error: %s", msg); { @@ -1912,12 +1863,9 @@ static int yyerror(void ***tsrm_ls, const char *msg) { return 0; } -int phpdbg_do_parse(phpdbg_param_t *stack, char *input TSRMLS_DC) { - phpdbg_init_lexer(stack, input TSRMLS_CC); +int phpdbg_do_parse(phpdbg_param_t *stack, char *input) { + phpdbg_init_lexer(stack, input); -#ifdef ZTS - return yyparse(TSRMLS_C); -#else - return yyparse(NULL); -#endif + return yyparse(); } + diff --git a/sapi/phpdbg/phpdbg_parser.h b/sapi/phpdbg/phpdbg_parser.h index 8d4aeacc31..be201fef96 100644 --- a/sapi/phpdbg/phpdbg_parser.h +++ b/sapi/phpdbg/phpdbg_parser.h @@ -1,8 +1,10 @@ -/* A Bison parser, made by GNU Bison 2.7.12-4996. */ -/* Bison interface for Yacc-like parsers in C +/* A Bison parser, made by GNU Bison 2.4.1. */ + +/* Skeleton interface for Bison's Yacc-like parsers in C - Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc. + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 + 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 @@ -30,18 +32,10 @@ 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 31 "/Users/Bob/php-src-X/sapi/phpdbg/phpdbg_parser.y" + +/* Line 1676 of yacc.c */ +#line 31 "sapi/phpdbg/phpdbg_parser.y" #include "phpdbg.h" #ifndef YY_TYPEDEF_YY_SCANNER_T @@ -50,8 +44,9 @@ typedef void* yyscan_t; #endif -/* Line 2060 of yacc.c */ -#line 55 "sapi/phpdbg/phpdbg_parser.h" + +/* Line 1676 of yacc.c */ +#line 50 "sapi/phpdbg/phpdbg_parser.h" /* Tokens. */ #ifndef YYTOKENTYPE @@ -80,26 +75,6 @@ typedef void* yyscan_t; T_REQ_ID = 276 }; #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_PROTO 268 -#define T_DIGITS 269 -#define T_LITERAL 270 -#define T_ADDR 271 -#define T_OPCODE 272 -#define T_ID 273 -#define T_INPUT 274 -#define T_UNEXPECTED 275 -#define T_REQ_ID 276 @@ -111,18 +86,5 @@ typedef int YYSTYPE; #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 *tsrm_ls); -#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 e4353976f3..18d23b834f 100644 --- a/sapi/phpdbg/phpdbg_parser.y +++ b/sapi/phpdbg/phpdbg_parser.y @@ -19,7 +19,7 @@ #include "phpdbg_lexer.h" #undef yyerror -static int yyerror(void ***tsrm_ls, const char *msg); +static int yyerror(const char *msg); ZEND_EXTERN_MODULE_GLOBALS(phpdbg); @@ -36,8 +36,6 @@ typedef void* yyscan_t; #endif } -%parse-param { void *tsrm_ls } - %output "sapi/phpdbg/phpdbg_parser.c" %defines "sapi/phpdbg/phpdbg_parser.h" @@ -166,7 +164,7 @@ full_expression %% -static int yyerror(void ***tsrm_ls, const char *msg) { +static int yyerror(const char *msg) { phpdbg_error("command", "type=\"parseerror\" msg=\"%s\"", "Parse Error: %s", msg); { @@ -180,12 +178,8 @@ static int yyerror(void ***tsrm_ls, const char *msg) { return 0; } -int phpdbg_do_parse(phpdbg_param_t *stack, char *input TSRMLS_DC) { - phpdbg_init_lexer(stack, input TSRMLS_CC); +int phpdbg_do_parse(phpdbg_param_t *stack, char *input) { + phpdbg_init_lexer(stack, input); -#ifdef ZTS - return yyparse(TSRMLS_C); -#else - return yyparse(NULL); -#endif + return yyparse(); } diff --git a/sapi/phpdbg/phpdbg_print.c b/sapi/phpdbg/phpdbg_print.c index 62a614281d..52bb6629eb 100644 --- a/sapi/phpdbg/phpdbg_print.c +++ b/sapi/phpdbg/phpdbg_print.c @@ -42,7 +42,7 @@ const phpdbg_command_t phpdbg_print_commands[] = { PHPDBG_PRINT(opline) /* {{{ */ { if (PHPDBG_G(in_execution) && EG(current_execute_data)) { - phpdbg_print_opline(EG(current_execute_data), 1 TSRMLS_CC); + phpdbg_print_opline(EG(current_execute_data), 1); } else { phpdbg_error("inactive", "type=\"execution\"", "Not Executing!"); } @@ -50,7 +50,7 @@ PHPDBG_PRINT(opline) /* {{{ */ return SUCCESS; } /* }}} */ -static inline void phpdbg_print_function_helper(zend_function *method TSRMLS_DC) /* {{{ */ +static inline void phpdbg_print_function_helper(zend_function *method) /* {{{ */ { switch (method->type) { case ZEND_USER_FUNCTION: { @@ -79,7 +79,7 @@ static inline void phpdbg_print_function_helper(zend_function *method TSRMLS_DC) zend_hash_init(&vars, op_array->last, NULL, NULL, 0); do { - char *decode = phpdbg_decode_opline(op_array, opline, &vars TSRMLS_CC); + char *decode = phpdbg_decode_opline(op_array, opline, &vars); if (decode != NULL) { phpdbg_writeln("print", "line=\"%u\" opline=\"%p\" opcode=\"%s\" op=\"%s\"", "\t\tL%u\t%p %-30s %s", opline->lineno, @@ -110,13 +110,13 @@ PHPDBG_PRINT(exec) /* {{{ */ { if (PHPDBG_G(exec)) { if (!PHPDBG_G(ops) && !(PHPDBG_G(flags) & PHPDBG_IN_SIGNAL_HANDLER)) { - phpdbg_compile(TSRMLS_C); + phpdbg_compile(); } if (PHPDBG_G(ops)) { phpdbg_notice("printinfo", "file=\"%s\" num=\"%d\"", "Context %s (%d ops)", PHPDBG_G(exec), PHPDBG_G(ops)->last); - phpdbg_print_function_helper((zend_function*) PHPDBG_G(ops) TSRMLS_CC); + phpdbg_print_function_helper((zend_function*) PHPDBG_G(ops)); } } else { phpdbg_error("inactive", "type=\"nocontext\"", "No execution context set"); @@ -142,7 +142,7 @@ PHPDBG_PRINT(stack) /* {{{ */ phpdbg_notice("printinfo", "opline=\"%p\" num=\"%d\"", "Stack @ %p (%d ops)", ops, ops->last); } } - phpdbg_print_function_helper((zend_function*) ops TSRMLS_CC); + phpdbg_print_function_helper((zend_function*) ops); } else { phpdbg_error("inactive", "type=\"execution\"", "Not Executing!"); } @@ -154,7 +154,7 @@ PHPDBG_PRINT(class) /* {{{ */ { zend_class_entry *ce; - if (phpdbg_safe_class_lookup(param->str, param->len, &ce TSRMLS_CC) == SUCCESS) { + if (phpdbg_safe_class_lookup(param->str, param->len, &ce) == SUCCESS) { phpdbg_notice("printinfo", "type=\"%s\" flag=\"%s\" class=\"%s\" num=\"%d\"", "%s %s: %s (%d methods)", (ce->type == ZEND_USER_CLASS) ? "User" : "Internal", @@ -172,7 +172,7 @@ PHPDBG_PRINT(class) /* {{{ */ zend_function *method; ZEND_HASH_FOREACH_PTR(&ce->function_table, method) { - phpdbg_print_function_helper(method TSRMLS_CC); + phpdbg_print_function_helper(method); } ZEND_HASH_FOREACH_END(); } @@ -188,7 +188,7 @@ PHPDBG_PRINT(method) /* {{{ */ { zend_class_entry *ce; - if (phpdbg_safe_class_lookup(param->method.class, strlen(param->method.class), &ce TSRMLS_CC) == SUCCESS) { + if (phpdbg_safe_class_lookup(param->method.class, strlen(param->method.class), &ce) == SUCCESS) { zend_function *fbc; zend_string *lcname = zend_string_alloc(strlen(param->method.name), 0); zend_str_tolower_copy(lcname->val, param->method.name, lcname->len); @@ -199,7 +199,7 @@ PHPDBG_PRINT(method) /* {{{ */ fbc->common.function_name->val, (fbc->type == ZEND_USER_FUNCTION) ? fbc->op_array.last : 0); - phpdbg_print_function_helper(fbc TSRMLS_CC); + phpdbg_print_function_helper(fbc); } else { phpdbg_error("print", "type=\"nomethod\" method=\"%s::%s\"", "The method %s::%s could not be found", param->method.class, param->method.name); } @@ -248,7 +248,7 @@ PHPDBG_PRINT(func) /* {{{ */ fbc->common.function_name->val, (fbc->type == ZEND_USER_FUNCTION) ? fbc->op_array.last : 0); - phpdbg_print_function_helper(fbc TSRMLS_CC); + phpdbg_print_function_helper(fbc); } else { phpdbg_error("print", "type=\"nofunction\" function=\"%s\"", "The function %s could not be found", func_name); } diff --git a/sapi/phpdbg/phpdbg_prompt.c b/sapi/phpdbg/phpdbg_prompt.c index 0ab5b4d230..b49049969e 100644 --- a/sapi/phpdbg/phpdbg_prompt.c +++ b/sapi/phpdbg/phpdbg_prompt.c @@ -89,7 +89,7 @@ const phpdbg_command_t phpdbg_prompt_commands[] = { PHPDBG_END_COMMAND }; /* }}} */ -static inline int phpdbg_call_register(phpdbg_param_t *stack TSRMLS_DC) /* {{{ */ +static inline int phpdbg_call_register(phpdbg_param_t *stack) /* {{{ */ { phpdbg_param_t *name = NULL; @@ -113,7 +113,7 @@ static inline int phpdbg_call_register(phpdbg_param_t *stack TSRMLS_DC) /* {{{ * ZVAL_STRINGL(&fci.function_name, lc_name, name->len); fci.size = sizeof(zend_fcall_info); fci.function_table = &PHPDBG_G(registered); - fci.symbol_table = zend_rebuild_symbol_table(TSRMLS_C); + fci.symbol_table = zend_rebuild_symbol_table(); fci.object = NULL; fci.retval = &fretval; fci.no_separation = 1; @@ -171,19 +171,19 @@ static inline int phpdbg_call_register(phpdbg_param_t *stack TSRMLS_DC) /* {{{ * next = next->next; } - zend_fcall_info_args(&fci, ¶ms TSRMLS_CC); + zend_fcall_info_args(&fci, ¶ms); } else { fci.params = NULL; fci.param_count = 0; } - phpdbg_activate_err_buf(0 TSRMLS_CC); - phpdbg_free_err_buf(TSRMLS_C); + phpdbg_activate_err_buf(0); + phpdbg_free_err_buf(); phpdbg_debug("created %d params from arguments", fci.param_count); - if (zend_call_function(&fci, NULL TSRMLS_CC) == SUCCESS) { - zend_print_zval_r(&fretval, 0 TSRMLS_CC); + if (zend_call_function(&fci, NULL) == SUCCESS) { + zend_print_zval_r(&fretval, 0); phpdbg_out("\n"); zval_ptr_dtor(&fretval); } @@ -208,7 +208,7 @@ struct phpdbg_init_state { const char *init_file; }; -static void phpdbg_line_init(char *cmd, struct phpdbg_init_state *state TSRMLS_DC) { +static void phpdbg_line_init(char *cmd, struct phpdbg_init_state *state) { size_t cmd_len = strlen(cmd); state->line++; @@ -228,7 +228,7 @@ static void phpdbg_line_init(char *cmd, struct phpdbg_init_state *state TSRMLS_D if (memcmp(cmd, ":>", sizeof(":>")-1) == SUCCESS) { state->in_code = 0; state->code[state->code_len] = '\0'; - zend_eval_stringl(state->code, state->code_len, NULL, "phpdbginit code" TSRMLS_CC); + zend_eval_stringl(state->code, state->code_len, NULL, "phpdbginit code"); free(state->code); state->code = NULL; return; @@ -252,33 +252,33 @@ static void phpdbg_line_init(char *cmd, struct phpdbg_init_state *state TSRMLS_D } zend_try { - char *input = phpdbg_read_input(cmd TSRMLS_CC); + char *input = phpdbg_read_input(cmd); phpdbg_param_t stack; phpdbg_init_param(&stack, STACK_PARAM); - phpdbg_activate_err_buf(1 TSRMLS_CC); + phpdbg_activate_err_buf(1); - if (phpdbg_do_parse(&stack, input TSRMLS_CC) <= 0) { - switch (phpdbg_stack_execute(&stack, 1 /* allow_async_unsafe == 1 */ TSRMLS_CC)) { + if (phpdbg_do_parse(&stack, input) <= 0) { + switch (phpdbg_stack_execute(&stack, 1 /* allow_async_unsafe == 1 */)) { case FAILURE: - phpdbg_activate_err_buf(0 TSRMLS_CC); - if (phpdbg_call_register(&stack TSRMLS_CC) == FAILURE) { + phpdbg_activate_err_buf(0); + if (phpdbg_call_register(&stack) == FAILURE) { if (state->init_file) { - phpdbg_output_err_buf("initfailure", "%b file=\"%s\" line=\"%d\" input=\"%s\"", "Unrecognized command in %s:%d: %s, %b!" TSRMLS_CC, state->init_file, state->line, input); + phpdbg_output_err_buf("initfailure", "%b file=\"%s\" line=\"%d\" input=\"%s\"", "Unrecognized command in %s:%d: %s, %b!", state->init_file, state->line, input); } else { - phpdbg_output_err_buf("initfailure", "%b line=\"%d\" input=\"%s\"", "Unrecognized command on line %d: %s, %b!" TSRMLS_CC, state->line, input); + phpdbg_output_err_buf("initfailure", "%b line=\"%d\" input=\"%s\"", "Unrecognized command on line %d: %s, %b!", state->line, input); } } break; } } - phpdbg_activate_err_buf(0 TSRMLS_CC); - phpdbg_free_err_buf(TSRMLS_C); + phpdbg_activate_err_buf(0); + phpdbg_free_err_buf(); phpdbg_stack_free(&stack); - phpdbg_destroy_input(&input TSRMLS_CC); + phpdbg_destroy_input(&input); } zend_catch { PHPDBG_G(flags) &= ~(PHPDBG_IS_RUNNING | PHPDBG_IS_CLEANING); if (PHPDBG_G(flags) & PHPDBG_IS_QUITTING) { @@ -289,12 +289,12 @@ static void phpdbg_line_init(char *cmd, struct phpdbg_init_state *state TSRMLS_D } -void phpdbg_string_init(char *buffer TSRMLS_DC) { +void phpdbg_string_init(char *buffer) { struct phpdbg_init_state state = {0}; char *str = strtok(buffer, "\n"); while (str) { - phpdbg_line_init(str, &state TSRMLS_CC); + phpdbg_line_init(str, &state); str = strtok(NULL, "\n"); } @@ -304,7 +304,7 @@ void phpdbg_string_init(char *buffer TSRMLS_DC) { } } -void phpdbg_try_file_init(char *init_file, size_t init_file_len, zend_bool free_init TSRMLS_DC) /* {{{ */ +void phpdbg_try_file_init(char *init_file, size_t init_file_len, zend_bool free_init) /* {{{ */ { zend_stat_t sb; @@ -317,7 +317,7 @@ void phpdbg_try_file_init(char *init_file, size_t init_file_len, zend_bool free_ state.init_file = init_file; while (fgets(cmd, PHPDBG_MAX_CMD, fp) != NULL) { - phpdbg_line_init(cmd, &state TSRMLS_CC); + phpdbg_line_init(cmd, &state); } if (state.code) { @@ -335,13 +335,13 @@ void phpdbg_try_file_init(char *init_file, size_t init_file_len, zend_bool free_ } } /* }}} */ -void phpdbg_init(char *init_file, size_t init_file_len, zend_bool use_default TSRMLS_DC) /* {{{ */ +void phpdbg_init(char *init_file, size_t init_file_len, zend_bool use_default) /* {{{ */ { if (!init_file && use_default) { char *scan_dir = getenv("PHP_INI_SCAN_DIR"); int i; - phpdbg_try_file_init(PHPDBG_STRL(PHP_CONFIG_FILE_PATH "/" PHPDBG_INIT_FILENAME), 0 TSRMLS_CC); + phpdbg_try_file_init(PHPDBG_STRL(PHP_CONFIG_FILE_PATH "/" PHPDBG_INIT_FILENAME), 0); if (!scan_dir) { scan_dir = PHP_CONFIG_FILE_SCAN_DIR; @@ -359,16 +359,16 @@ void phpdbg_init(char *init_file, size_t init_file_len, zend_bool use_default TS } asprintf(&init_file, "%s/%s", scan_dir, PHPDBG_INIT_FILENAME); - phpdbg_try_file_init(init_file, strlen(init_file), 1 TSRMLS_CC); + phpdbg_try_file_init(init_file, strlen(init_file), 1); if (i == -1) { break; } scan_dir += i + 1; } - phpdbg_try_file_init(PHPDBG_STRL(PHPDBG_INIT_FILENAME), 0 TSRMLS_CC); + phpdbg_try_file_init(PHPDBG_STRL(PHPDBG_INIT_FILENAME), 0); } else { - phpdbg_try_file_init(init_file, init_file_len, 1 TSRMLS_CC); + phpdbg_try_file_init(init_file, init_file_len, 1); } } @@ -378,12 +378,12 @@ PHPDBG_COMMAND(exec) /* {{{ */ if (VCWD_STAT(param->str, &sb) != FAILURE) { if (sb.st_mode & (S_IFREG|S_IFLNK)) { - char *res = phpdbg_resolve_path(param->str TSRMLS_CC); + char *res = phpdbg_resolve_path(param->str); size_t res_len = strlen(res); if ((res_len != PHPDBG_G(exec_len)) || (memcmp(res, PHPDBG_G(exec), res_len) != SUCCESS)) { if (PHPDBG_G(in_execution)) { - if (phpdbg_ask_user_permission("Do you really want to stop execution to set a new execution context?" TSRMLS_CC) == FAILURE) { + if (phpdbg_ask_user_permission("Do you really want to stop execution to set a new execution context?") == FAILURE) { return FAILURE; } } @@ -397,7 +397,7 @@ PHPDBG_COMMAND(exec) /* {{{ */ if (PHPDBG_G(ops)) { phpdbg_notice("exec", "type=\"unsetops\"", "Destroying compiled opcodes"); - phpdbg_clean(0 TSRMLS_CC); + phpdbg_clean(0); } PHPDBG_G(exec) = res; @@ -406,15 +406,15 @@ PHPDBG_COMMAND(exec) /* {{{ */ VCWD_CHDIR_FILE(res); *SG(request_info).argv = PHPDBG_G(exec); - php_hash_environment(TSRMLS_C); + php_hash_environment(); phpdbg_notice("exec", "type=\"set\" context=\"%s\"", "Set execution context: %s", PHPDBG_G(exec)); if (PHPDBG_G(in_execution)) { - phpdbg_clean(1 TSRMLS_CC); + phpdbg_clean(1); } - phpdbg_compile(TSRMLS_C); + phpdbg_compile(); } else { phpdbg_notice("exec", "type=\"unchanged\"", "Execution context not changed"); } @@ -427,7 +427,7 @@ PHPDBG_COMMAND(exec) /* {{{ */ return SUCCESS; } /* }}} */ -int phpdbg_compile(TSRMLS_D) /* {{{ */ +int phpdbg_compile(void) /* {{{ */ { zend_file_handle fh; @@ -436,9 +436,9 @@ int phpdbg_compile(TSRMLS_D) /* {{{ */ return FAILURE; } - if (php_stream_open_for_zend_ex(PHPDBG_G(exec), &fh, USE_PATH|STREAM_OPEN_FOR_INCLUDE TSRMLS_CC) == SUCCESS) { - PHPDBG_G(ops) = zend_compile_file(&fh, ZEND_INCLUDE TSRMLS_CC); - zend_destroy_file_handle(&fh TSRMLS_CC); + if (php_stream_open_for_zend_ex(PHPDBG_G(exec), &fh, USE_PATH|STREAM_OPEN_FOR_INCLUDE) == SUCCESS) { + PHPDBG_G(ops) = zend_compile_file(&fh, ZEND_INCLUDE); + zend_destroy_file_handle(&fh); phpdbg_notice("compile", "context=\"%s\"", "Successful compilation of %s", PHPDBG_G(exec)); @@ -487,7 +487,7 @@ PHPDBG_COMMAND(until) /* {{{ */ return PHPDBG_UNTIL; } /* }}} */ -static void phpdbg_seek_to_end(TSRMLS_D) { +static void phpdbg_seek_to_end(void) { const zend_op *opline = EG(current_execute_data)->opline; const zend_op_array *op_array = &EG(current_execute_data)->func->op_array - 1; @@ -513,7 +513,7 @@ PHPDBG_COMMAND(finish) /* {{{ */ } PHPDBG_G(flags) |= PHPDBG_IN_FINISH; - phpdbg_seek_to_end(TSRMLS_C); + phpdbg_seek_to_end(); return PHPDBG_FINISH; } /* }}} */ @@ -526,7 +526,7 @@ PHPDBG_COMMAND(leave) /* {{{ */ } PHPDBG_G(flags) |= PHPDBG_IN_LEAVE; - phpdbg_seek_to_end(TSRMLS_C); + phpdbg_seek_to_end(); return PHPDBG_LEAVE; } /* }}} */ @@ -536,20 +536,20 @@ PHPDBG_COMMAND(frame) /* {{{ */ if (!param) { phpdbg_notice("frame", "id=\"%d\"", "Currently in frame #%d", PHPDBG_G(frame).num); } else { - phpdbg_switch_frame(param->num TSRMLS_CC); + phpdbg_switch_frame(param->num); } return SUCCESS; } /* }}} */ -static inline void phpdbg_handle_exception(TSRMLS_D) /* }}} */ +static inline void phpdbg_handle_exception(void) /* }}} */ { zend_fcall_info fci; zval trace; /* get filename and linenumber before unsetting exception */ - const char *filename = zend_get_executed_filename(TSRMLS_C); - uint32_t lineno = zend_get_executed_lineno(TSRMLS_C); + const char *filename = zend_get_executed_filename(); + uint32_t lineno = zend_get_executed_lineno(); /* call __toString */ ZVAL_STRINGL(&fci.function_name, "__tostring", sizeof("__tostring") - 1); @@ -561,7 +561,7 @@ static inline void phpdbg_handle_exception(TSRMLS_D) /* }}} */ fci.param_count = 0; fci.params = NULL; fci.no_separation = 1; - if (zend_call_function(&fci, NULL TSRMLS_CC) == SUCCESS) { + if (zend_call_function(&fci, NULL) == SUCCESS) { phpdbg_writeln("exception", "name=\"%s\" trace=\"%.*s\"", "Uncaught %s!\n%.*s", EG(exception)->ce->name->val, Z_STRLEN(trace), Z_STRVAL(trace)); zval_ptr_dtor(&trace); @@ -573,7 +573,7 @@ static inline void phpdbg_handle_exception(TSRMLS_D) /* }}} */ phpdbg_writeln("exception", "opline=\"%p\" file=\"%s\" line=\"%u\"", "Stack entered at %p in %s on line %u", EG(current_execute_data)->func->op_array.opcodes, filename, lineno); zval_dtor(&fci.function_name); - zend_clear_exception(TSRMLS_C); + zend_clear_exception(); } /* }}} */ PHPDBG_COMMAND(run) /* {{{ */ @@ -583,15 +583,15 @@ PHPDBG_COMMAND(run) /* {{{ */ zend_bool restore = 1; if (PHPDBG_G(in_execution)) { - if (phpdbg_ask_user_permission("Do you really want to restart execution?" TSRMLS_CC) == SUCCESS) { + if (phpdbg_ask_user_permission("Do you really want to restart execution?") == SUCCESS) { phpdbg_startup_run++; - phpdbg_clean(1 TSRMLS_CC); + phpdbg_clean(1); } return SUCCESS; } if (!PHPDBG_G(ops)) { - if (phpdbg_compile(TSRMLS_C) == FAILURE) { + if (phpdbg_compile() == FAILURE) { phpdbg_error("compile", "type=\"compilefailure\" context=\"%s\"", "Failed to compile %s, cannot run", PHPDBG_G(exec)); goto out; } @@ -601,7 +601,7 @@ PHPDBG_COMMAND(run) /* {{{ */ if (ex && ex->symbol_table) { zend_hash_clean(&ex->symbol_table->ht); } else { - zend_rebuild_symbol_table(TSRMLS_C); + zend_rebuild_symbol_table(); } /* clean seek state */ @@ -609,7 +609,7 @@ PHPDBG_COMMAND(run) /* {{{ */ zend_hash_clean(&PHPDBG_G(seek)); /* reset hit counters */ - phpdbg_reset_breakpoints(TSRMLS_C); + phpdbg_reset_breakpoints(); if (param && param->type != EMPTY_PARAM && param->len != 0) { char **argv = emalloc(5 * sizeof(char *)); @@ -633,13 +633,13 @@ PHPDBG_COMMAND(run) /* {{{ */ SG(request_info).argv = erealloc(argv, ++argc * sizeof(char *)); SG(request_info).argc = argc; - php_hash_environment(TSRMLS_C); + php_hash_environment(); } zend_try { PHPDBG_G(flags) ^= PHPDBG_IS_INTERACTIVE; PHPDBG_G(flags) |= PHPDBG_IS_RUNNING; - zend_execute(PHPDBG_G(ops), &PHPDBG_G(retval) TSRMLS_CC); + zend_execute(PHPDBG_G(ops), &PHPDBG_G(retval)); PHPDBG_G(flags) ^= PHPDBG_IS_INTERACTIVE; } zend_catch { PHPDBG_G(in_execution) = 0; @@ -661,11 +661,11 @@ PHPDBG_COMMAND(run) /* {{{ */ if (restore) { if (EG(exception)) { - phpdbg_handle_exception(TSRMLS_C); + phpdbg_handle_exception(); } } - phpdbg_clean(1 TSRMLS_CC); + phpdbg_clean(1); PHPDBG_G(flags) &= ~PHPDBG_IS_RUNNING; } else { @@ -677,10 +677,10 @@ out: return SUCCESS; } /* }}} */ -int phpdbg_output_ev_variable(char *name, size_t len, char *keyname, size_t keylen, HashTable *parent, zval *zv TSRMLS_DC) { +int phpdbg_output_ev_variable(char *name, size_t len, char *keyname, size_t keylen, HashTable *parent, zval *zv) { phpdbg_notice("eval", "variable=\"%.*s\"", "Printing variable %.*s", (int) len, name); phpdbg_xml("<eval %r>"); - zend_print_zval_r(zv, 0 TSRMLS_CC); + zend_print_zval_r(zv, 0); phpdbg_xml("</eval>"); phpdbg_out("\n"); @@ -705,7 +705,7 @@ PHPDBG_COMMAND(ev) /* {{{ */ if (PHPDBG_G(flags) & PHPDBG_IN_SIGNAL_HANDLER) { phpdbg_try_access { - phpdbg_parse_variable(param->str, param->len, &EG(symbol_table).ht, 0, phpdbg_output_ev_variable, 0 TSRMLS_CC); + phpdbg_parse_variable(param->str, param->len, &EG(symbol_table).ht, 0, phpdbg_output_ev_variable, 0); } phpdbg_catch_access { phpdbg_error("signalsegv", "", "Could not fetch data, invalid data source"); } phpdbg_end_try_access(); @@ -721,13 +721,13 @@ PHPDBG_COMMAND(ev) /* {{{ */ /* disable stepping while eval() in progress */ PHPDBG_G(flags) |= PHPDBG_IN_EVAL; zend_try { - if (zend_eval_stringl(param->str, param->len, &retval, "eval()'d code" TSRMLS_CC) == SUCCESS) { + if (zend_eval_stringl(param->str, param->len, &retval, "eval()'d code") == SUCCESS) { phpdbg_xml("<eval %r>"); if (PHPDBG_G(flags) & PHPDBG_WRITE_XML) { zval *zvp = &retval; - phpdbg_xml_var_dump(zvp TSRMLS_CC); + phpdbg_xml_var_dump(zvp); } - zend_print_zval_r(&retval, 0 TSRMLS_CC); + zend_print_zval_r(&retval, 0); phpdbg_xml("</eval>"); phpdbg_out("\n"); zval_ptr_dtor(&retval); @@ -761,9 +761,9 @@ PHPDBG_COMMAND(back) /* {{{ */ } if (!param) { - phpdbg_dump_backtrace(0 TSRMLS_CC); + phpdbg_dump_backtrace(0); } else { - phpdbg_dump_backtrace(param->num TSRMLS_CC); + phpdbg_dump_backtrace(param->num); } return SUCCESS; @@ -827,42 +827,42 @@ PHPDBG_COMMAND(break) /* {{{ */ { if (!param) { phpdbg_set_breakpoint_file( - zend_get_executed_filename(TSRMLS_C), - zend_get_executed_lineno(TSRMLS_C) TSRMLS_CC); + zend_get_executed_filename(), + zend_get_executed_lineno()); } else switch (param->type) { case ADDR_PARAM: - phpdbg_set_breakpoint_opline(param->addr TSRMLS_CC); + phpdbg_set_breakpoint_opline(param->addr); break; case NUMERIC_PARAM: if (PHPDBG_G(exec)) { - phpdbg_set_breakpoint_file(phpdbg_current_file(TSRMLS_C), param->num TSRMLS_CC); + phpdbg_set_breakpoint_file(phpdbg_current_file(), param->num); } else { phpdbg_error("inactive", "type=\"noexec\"", "Execution context not set!"); } break; case METHOD_PARAM: - phpdbg_set_breakpoint_method(param->method.class, param->method.name TSRMLS_CC); + phpdbg_set_breakpoint_method(param->method.class, param->method.name); break; case NUMERIC_METHOD_PARAM: - phpdbg_set_breakpoint_method_opline(param->method.class, param->method.name, param->num TSRMLS_CC); + phpdbg_set_breakpoint_method_opline(param->method.class, param->method.name, param->num); break; case NUMERIC_FUNCTION_PARAM: - phpdbg_set_breakpoint_function_opline(param->str, param->num TSRMLS_CC); + phpdbg_set_breakpoint_function_opline(param->str, param->num); break; case FILE_PARAM: - phpdbg_set_breakpoint_file(param->file.name, param->file.line TSRMLS_CC); + phpdbg_set_breakpoint_file(param->file.name, param->file.line); break; case NUMERIC_FILE_PARAM: - phpdbg_set_breakpoint_file_opline(param->file.name, param->file.line TSRMLS_CC); + phpdbg_set_breakpoint_file_opline(param->file.name, param->file.line); break; case COND_PARAM: - phpdbg_set_breakpoint_expression(param->str, param->len TSRMLS_CC); + phpdbg_set_breakpoint_expression(param->str, param->len); break; case STR_PARAM: - phpdbg_set_breakpoint_symbol(param->str, param->len TSRMLS_CC); + phpdbg_set_breakpoint_symbol(param->str, param->len); break; case OP_PARAM: - phpdbg_set_breakpoint_opcode(param->str, param->len TSRMLS_CC); + phpdbg_set_breakpoint_opcode(param->str, param->len); break; phpdbg_default_switch_case(); @@ -884,17 +884,17 @@ PHPDBG_COMMAND(sh) /* {{{ */ return SUCCESS; } /* }}} */ -static int add_module_info(zend_module_entry *module TSRMLS_DC) { +static int add_module_info(zend_module_entry *module) { phpdbg_write("module", "name=\"%s\"", "%s\n", module->name); return 0; } -static int add_zendext_info(zend_extension *ext TSRMLS_DC) { +static int add_zendext_info(zend_extension *ext) { phpdbg_write("extension", "name=\"%s\"", "%s\n", ext->name); return 0; } -PHPDBG_API const char *phpdbg_load_module_or_extension(char **path, char **name TSRMLS_DC) { +PHPDBG_API const char *phpdbg_load_module_or_extension(char **path, char **name) { DL_HANDLE handle; char *extension_dir; @@ -963,7 +963,7 @@ PHPDBG_API const char *phpdbg_load_module_or_extension(char **path, char **name *name = new_extension->name; - zend_register_extension(new_extension, handle TSRMLS_CC); + zend_register_extension(new_extension, handle); if (new_extension->startup) { if (new_extension->startup(new_extension) != SUCCESS) { @@ -1004,20 +1004,20 @@ PHPDBG_API const char *phpdbg_load_module_or_extension(char **path, char **name module_entry->module_number = zend_next_free_module(); module_entry->handle = handle; - if ((module_entry = zend_register_module_ex(module_entry TSRMLS_CC)) == NULL) { + if ((module_entry = zend_register_module_ex(module_entry)) == NULL) { phpdbg_error("dl", "type=\"registerfailure\" module=\"%s\"", "Unable to register module %s", module_entry->name); goto quit; } - if (zend_startup_module_ex(module_entry TSRMLS_CC) == FAILURE) { + if (zend_startup_module_ex(module_entry) == FAILURE) { phpdbg_error("dl", "type=\"startupfailure\" module=\"%s\"", "Unable to startup module %s", module_entry->name); goto quit; } if (module_entry->request_startup_func) { - if (module_entry->request_startup_func(MODULE_PERSISTENT, module_entry->module_number TSRMLS_CC) == FAILURE) { + if (module_entry->request_startup_func(MODULE_PERSISTENT, module_entry->module_number) == FAILURE) { phpdbg_error("dl", "type=\"initfailure\" module=\"%s\"", "Unable to initialize module %s", module_entry->name); goto quit; @@ -1041,24 +1041,24 @@ PHPDBG_COMMAND(dl) /* {{{ */ if (!param || param->type == EMPTY_PARAM) { phpdbg_notice("dl", "extensiontype=\"Zend extension\"", "Zend extensions"); - zend_llist_apply(&zend_extensions, (llist_apply_func_t) add_zendext_info TSRMLS_CC); + zend_llist_apply(&zend_extensions, (llist_apply_func_t) add_zendext_info); phpdbg_out("\n"); phpdbg_notice("dl", "extensiontype=\"module\"", "Modules"); - zend_hash_apply(&module_registry, (apply_func_t) add_module_info TSRMLS_CC); + zend_hash_apply(&module_registry, (apply_func_t) add_module_info); } else switch (param->type) { case STR_PARAM: #ifdef HAVE_LIBDL path = estrndup(param->str, param->len); - phpdbg_activate_err_buf(1 TSRMLS_CC); - if ((type = phpdbg_load_module_or_extension(&path, &name TSRMLS_CC)) == NULL) { + phpdbg_activate_err_buf(1); + if ((type = phpdbg_load_module_or_extension(&path, &name)) == NULL) { phpdbg_error("dl", "path=\"%s\" %b", "Could not load %s, not found or invalid zend extension / module: %b", path); efree(name); } else { phpdbg_notice("dl", "extensiontype=\"%s\" name=\"%s\" path=\"%s\"", "Successfully loaded the %s %s at path %s", type, name, path); } - phpdbg_activate_err_buf(0 TSRMLS_CC); - phpdbg_free_err_buf(TSRMLS_C); + phpdbg_activate_err_buf(0); + phpdbg_free_err_buf(); efree(path); #else phpdbg_error("dl", "type=\"unsupported\" path=\"%.*s\"", "Cannot dynamically load %.*s - dynamic modules are not supported", (int) param->len, param->str); @@ -1076,7 +1076,7 @@ PHPDBG_COMMAND(source) /* {{{ */ zend_stat_t sb; if (VCWD_STAT(param->str, &sb) != -1) { - phpdbg_try_file_init(param->str, param->len, 0 TSRMLS_CC); + phpdbg_try_file_init(param->str, param->len, 0); } else { phpdbg_error("source", "type=\"notfound\" file=\"%s\"", "Failed to stat %s, file does not exist", param->str); } @@ -1089,7 +1089,7 @@ PHPDBG_COMMAND(export) /* {{{ */ FILE *handle = VCWD_FOPEN(param->str, "w+"); if (handle) { - phpdbg_export_breakpoints(handle TSRMLS_CC); + phpdbg_export_breakpoints(handle); fclose(handle); } else { phpdbg_error("export", "type=\"openfailure\" file=\"%s\"", "Failed to open or create %s, check path and permissions", param->str); @@ -1136,7 +1136,7 @@ PHPDBG_COMMAND(quit) /* {{{ */ PHPDBG_COMMAND(clean) /* {{{ */ { if (PHPDBG_G(in_execution)) { - if (phpdbg_ask_user_permission("Do you really want to clean your current environment?" TSRMLS_CC) == FAILURE) { + if (phpdbg_ask_user_permission("Do you really want to clean your current environment?") == FAILURE) { return SUCCESS; } } @@ -1151,7 +1151,7 @@ PHPDBG_COMMAND(clean) /* {{{ */ PHPDBG_G(flags) &= ~PHPDBG_IS_RUNNING; - phpdbg_clean(1 TSRMLS_CC); + phpdbg_clean(1); phpdbg_xml("</cleaninfo>"); @@ -1172,7 +1172,7 @@ PHPDBG_COMMAND(clear) /* {{{ */ phpdbg_writeln("clear", "methodoplines=\"%d\"", "Method oplines %d", zend_hash_num_elements(&PHPDBG_G(bp)[PHPDBG_BREAK_METHOD_OPLINE])); phpdbg_writeln("clear", "eval=\"%d\"", "Conditionals %d", zend_hash_num_elements(&PHPDBG_G(bp)[PHPDBG_BREAK_COND])); - phpdbg_clear_breakpoints(TSRMLS_C); + phpdbg_clear_breakpoints(); phpdbg_xml("</clearinfo>"); @@ -1191,7 +1191,7 @@ PHPDBG_COMMAND(list) /* {{{ */ return PHPDBG_LIST_HANDLER(lines)(PHPDBG_COMMAND_ARGS); case STR_PARAM: - phpdbg_list_function_byname(param->str, param->len TSRMLS_CC); + phpdbg_list_function_byname(param->str, param->len); break; case METHOD_PARAM: @@ -1206,10 +1206,10 @@ PHPDBG_COMMAND(list) /* {{{ */ PHPDBG_COMMAND(watch) /* {{{ */ { if (!param || param->type == EMPTY_PARAM) { - phpdbg_list_watchpoints(TSRMLS_C); + phpdbg_list_watchpoints(); } else switch (param->type) { case STR_PARAM: - if (phpdbg_create_var_watchpoint(param->str, param->len TSRMLS_CC) != FAILURE) { + if (phpdbg_create_var_watchpoint(param->str, param->len) != FAILURE) { phpdbg_notice("watch", "variable=\"%.*s\"", "Set watchpoint on %.*s", (int) param->len, param->str); } break; @@ -1220,7 +1220,7 @@ PHPDBG_COMMAND(watch) /* {{{ */ return SUCCESS; } /* }}} */ -int phpdbg_interactive(zend_bool allow_async_unsafe TSRMLS_DC) /* {{{ */ +int phpdbg_interactive(zend_bool allow_async_unsafe) /* {{{ */ { int ret = SUCCESS; char *input = NULL; @@ -1233,15 +1233,15 @@ int phpdbg_interactive(zend_bool allow_async_unsafe TSRMLS_DC) /* {{{ */ zend_bailout(); } - if (!(input = phpdbg_read_input(NULL TSRMLS_CC))) { + if (!(input = phpdbg_read_input(NULL))) { break; } phpdbg_init_param(&stack, STACK_PARAM); - if (phpdbg_do_parse(&stack, input TSRMLS_CC) <= 0) { - phpdbg_activate_err_buf(1 TSRMLS_CC); + if (phpdbg_do_parse(&stack, input) <= 0) { + phpdbg_activate_err_buf(1); #ifdef PHP_WIN32 #define PARA ((phpdbg_param_t *)stack.next)->type @@ -1249,11 +1249,11 @@ int phpdbg_interactive(zend_bool allow_async_unsafe TSRMLS_DC) /* {{{ */ sigio_watcher_start(); } #endif - switch (ret = phpdbg_stack_execute(&stack, allow_async_unsafe TSRMLS_CC)) { + switch (ret = phpdbg_stack_execute(&stack, allow_async_unsafe)) { case FAILURE: if (!(PHPDBG_G(flags) & PHPDBG_IS_STOPPING)) { - if (!allow_async_unsafe || phpdbg_call_register(&stack TSRMLS_CC) == FAILURE) { - phpdbg_output_err_buf(NULL, "%b", "%b" TSRMLS_CC); + if (!allow_async_unsafe || phpdbg_call_register(&stack) == FAILURE) { + phpdbg_output_err_buf(NULL, "%b", "%b"); } } break; @@ -1262,8 +1262,8 @@ int phpdbg_interactive(zend_bool allow_async_unsafe TSRMLS_DC) /* {{{ */ case PHPDBG_FINISH: case PHPDBG_UNTIL: case PHPDBG_NEXT: { - phpdbg_activate_err_buf(0 TSRMLS_CC); - phpdbg_free_err_buf(TSRMLS_C); + phpdbg_activate_err_buf(0); + phpdbg_free_err_buf(); if (!PHPDBG_G(in_execution) && !(PHPDBG_G(flags) & PHPDBG_IS_STOPPING)) { phpdbg_error("command", "type=\"noexec\"", "Not running"); } @@ -1271,8 +1271,8 @@ int phpdbg_interactive(zend_bool allow_async_unsafe TSRMLS_DC) /* {{{ */ } } - phpdbg_activate_err_buf(0 TSRMLS_CC); - phpdbg_free_err_buf(TSRMLS_C); + phpdbg_activate_err_buf(0); + phpdbg_free_err_buf(); #ifdef PHP_WIN32 if (PHPDBG_G(flags) & PHPDBG_IS_REMOTE && (RUN_PARAM == PARA || EVAL_PARAM == PARA)) { sigio_watcher_stop(); @@ -1282,33 +1282,33 @@ int phpdbg_interactive(zend_bool allow_async_unsafe TSRMLS_DC) /* {{{ */ } phpdbg_stack_free(&stack); - phpdbg_destroy_input(&input TSRMLS_CC); + phpdbg_destroy_input(&input); PHPDBG_G(req_id) = 0; input = NULL; } if (input) { phpdbg_stack_free(&stack); - phpdbg_destroy_input(&input TSRMLS_CC); + phpdbg_destroy_input(&input); PHPDBG_G(req_id) = 0; } if (PHPDBG_G(in_execution)) { - phpdbg_restore_frame(TSRMLS_C); + phpdbg_restore_frame(); } PHPDBG_G(flags) &= ~PHPDBG_IS_INTERACTIVE; - phpdbg_print_changed_zvals(TSRMLS_C); + phpdbg_print_changed_zvals(); return ret; } /* }}} */ -void phpdbg_clean(zend_bool full TSRMLS_DC) /* {{{ */ +void phpdbg_clean(zend_bool full) /* {{{ */ { /* this is implicitly required */ if (PHPDBG_G(ops)) { - destroy_op_array(PHPDBG_G(ops) TSRMLS_CC); + destroy_op_array(PHPDBG_G(ops)); efree(PHPDBG_G(ops)); PHPDBG_G(ops) = NULL; } @@ -1322,13 +1322,13 @@ void phpdbg_clean(zend_bool full TSRMLS_DC) /* {{{ */ #define DO_INTERACTIVE(allow_async_unsafe) do { \ if (!(PHPDBG_G(flags) & PHPDBG_IN_EVAL)) { \ - const char *file_char = zend_get_executed_filename(TSRMLS_C); \ + 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(TSRMLS_C)-1, zend_get_executed_lineno(TSRMLS_C) TSRMLS_CC); \ + phpdbg_list_file(file, 3, zend_get_executed_lineno()-1, zend_get_executed_lineno()); \ efree(file); \ } \ \ - switch (phpdbg_interactive(allow_async_unsafe TSRMLS_CC)) { \ + switch (phpdbg_interactive(allow_async_unsafe)) { \ case PHPDBG_LEAVE: \ case PHPDBG_FINISH: \ case PHPDBG_UNTIL: \ @@ -1338,7 +1338,7 @@ void phpdbg_clean(zend_bool full TSRMLS_DC) /* {{{ */ } \ } while (0) -void phpdbg_execute_ex(zend_execute_data *execute_data TSRMLS_DC) /* {{{ */ +void phpdbg_execute_ex(zend_execute_data *execute_data) /* {{{ */ { zend_bool original_in_execution = PHPDBG_G(in_execution); HashTable vars; @@ -1354,7 +1354,7 @@ void phpdbg_execute_ex(zend_execute_data *execute_data TSRMLS_DC) /* {{{ */ while (1) { if ((PHPDBG_G(flags) & PHPDBG_BP_RESOLVE_MASK)) { /* resolve nth opline breakpoints */ - phpdbg_resolve_op_array_breaks(&execute_data->func->op_array TSRMLS_CC); + phpdbg_resolve_op_array_breaks(&execute_data->func->op_array); } #ifdef ZEND_WIN32 @@ -1403,8 +1403,8 @@ void phpdbg_execute_ex(zend_execute_data *execute_data TSRMLS_DC) /* {{{ */ PHPDBG_G(flags) &= ~PHPDBG_IN_LEAVE; zend_hash_clean(&PHPDBG_G(seek)); phpdbg_notice("breakpoint", "id=\"leave\" file=\"%s\" line=\"%u\"", "Breaking for leave at %s:%u", - zend_get_executed_filename(TSRMLS_C), - zend_get_executed_lineno(TSRMLS_C) + zend_get_executed_filename(), + zend_get_executed_lineno() ); DO_INTERACTIVE(1); } else { @@ -1415,7 +1415,7 @@ void phpdbg_execute_ex(zend_execute_data *execute_data TSRMLS_DC) /* {{{ */ } /* not while in conditionals */ - phpdbg_print_opline_ex(execute_data, &vars, 0 TSRMLS_CC); + phpdbg_print_opline_ex(execute_data, &vars, 0); if (PHPDBG_G(flags) & PHPDBG_IS_STEPPING && (PHPDBG_G(flags) & PHPDBG_STEP_OPCODE || execute_data->opline->lineno != PHPDBG_G(last_line))) { PHPDBG_G(flags) &= ~PHPDBG_IS_STEPPING; @@ -1424,7 +1424,7 @@ void phpdbg_execute_ex(zend_execute_data *execute_data TSRMLS_DC) /* {{{ */ /* check if some watchpoint was hit */ { - if (phpdbg_print_changed_zvals(TSRMLS_C) == SUCCESS) { + if (phpdbg_print_changed_zvals() == SUCCESS) { DO_INTERACTIVE(1); } } @@ -1434,9 +1434,9 @@ void phpdbg_execute_ex(zend_execute_data *execute_data TSRMLS_DC) /* {{{ */ phpdbg_breakbase_t *brake; if ((PHPDBG_G(flags) & PHPDBG_BP_MASK) - && (brake = phpdbg_find_breakpoint(execute_data TSRMLS_CC)) + && (brake = phpdbg_find_breakpoint(execute_data)) && (brake->type != PHPDBG_BREAK_FILE || execute_data->opline->lineno != PHPDBG_G(last_line))) { - phpdbg_hit_breakpoint(brake, 1 TSRMLS_CC); + phpdbg_hit_breakpoint(brake, 1); DO_INTERACTIVE(1); } } @@ -1457,7 +1457,7 @@ next: if (execute_data->opline->opcode == ZEND_DO_FCALL && execute_data->func->type == ZEND_USER_FUNCTION) { zend_execute_ex = execute_ex; } - PHPDBG_G(vmret) = execute_data->opline->handler(execute_data TSRMLS_CC); + PHPDBG_G(vmret) = execute_data->opline->handler(execute_data); zend_execute_ex = phpdbg_execute_ex; if (PHPDBG_G(vmret) != 0) { @@ -1474,7 +1474,7 @@ next: } /* }}} */ /* only if *not* interactive and while executing */ -void phpdbg_force_interruption(TSRMLS_D) { +void phpdbg_force_interruption(void) { zend_execute_data *data = EG(current_execute_data); /* should be always readable if not NULL */ PHPDBG_G(flags) |= PHPDBG_IN_SIGNAL_HANDLER; @@ -1505,7 +1505,7 @@ PHPDBG_COMMAND(eol) /* {{{ */ phpdbg_notice("eol", "argument required", "argument required"); } else switch (param->type) { case STR_PARAM: - if (FAILURE == phpdbg_eol_global_update(param->str TSRMLS_CC)) { + if (FAILURE == phpdbg_eol_global_update(param->str)) { phpdbg_notice("eol", "unknown EOL name '%s', give crlf, lf, cr", "unknown EOL name '%s', give crlf, lf, cr", param->str); } break; diff --git a/sapi/phpdbg/phpdbg_prompt.h b/sapi/phpdbg/phpdbg_prompt.h index f583f2cdcd..3bd30c6279 100644 --- a/sapi/phpdbg/phpdbg_prompt.h +++ b/sapi/phpdbg/phpdbg_prompt.h @@ -22,13 +22,13 @@ #define PHPDBG_PROMPT_H /* {{{ */ -void phpdbg_string_init(char *buffer TSRMLS_DC); -void phpdbg_init(char *init_file, size_t init_file_len, zend_bool use_default TSRMLS_DC); -void phpdbg_try_file_init(char *init_file, size_t init_file_len, zend_bool free_init TSRMLS_DC); -int phpdbg_interactive(zend_bool allow_async_unsafe TSRMLS_DC); -int phpdbg_compile(TSRMLS_D); -void phpdbg_clean(zend_bool full TSRMLS_DC); -void phpdbg_force_interruption(TSRMLS_D); +void phpdbg_string_init(char *buffer); +void phpdbg_init(char *init_file, size_t init_file_len, zend_bool use_default); +void phpdbg_try_file_init(char *init_file, size_t init_file_len, zend_bool free_init); +int phpdbg_interactive(zend_bool allow_async_unsafe); +int phpdbg_compile(void); +void phpdbg_clean(zend_bool full); +void phpdbg_force_interruption(void); /* }}} */ /* {{{ phpdbg command handlers */ @@ -65,9 +65,9 @@ extern const phpdbg_command_t phpdbg_prompt_commands[]; /* }}} */ /* {{{ */ #if PHP_VERSION_ID >= 50500 -void phpdbg_execute_ex(zend_execute_data *execute_data TSRMLS_DC); +void phpdbg_execute_ex(zend_execute_data *execute_data); #else -void phpdbg_execute_ex(zend_op_array *op_array TSRMLS_DC); +void phpdbg_execute_ex(zend_op_array *op_array); #endif /* }}} */ #endif /* PHPDBG_PROMPT_H */ diff --git a/sapi/phpdbg/phpdbg_rinit_hook.c b/sapi/phpdbg/phpdbg_rinit_hook.c index ab976c4ddb..d6d136b466 100644 --- a/sapi/phpdbg/phpdbg_rinit_hook.c +++ b/sapi/phpdbg/phpdbg_rinit_hook.c @@ -68,18 +68,18 @@ static PHP_RINIT_FUNCTION(phpdbg_webhelper) /* {{{ */ char *msg = NULL; char msglen[5] = {0}; - phpdbg_webdata_compress(&msg, (int *)msglen TSRMLS_CC); + phpdbg_webdata_compress(&msg, (int *)msglen); send(s, msglen, 4, 0); send(s, msg, *(int *) msglen, 0); while ((buflen = recv(s, buf, sizeof(buf) - 1, 0)) > 0) { - php_write(buf, buflen TSRMLS_CC); + php_write(buf, buflen); } close(s); - php_output_flush_all(TSRMLS_C); + php_output_flush_all(); zend_bailout(); } #endif diff --git a/sapi/phpdbg/phpdbg_set.c b/sapi/phpdbg/phpdbg_set.c index 82b9f69f7a..2428f2b735 100644 --- a/sapi/phpdbg/phpdbg_set.c +++ b/sapi/phpdbg/phpdbg_set.c @@ -48,9 +48,9 @@ const phpdbg_command_t phpdbg_set_commands[] = { PHPDBG_SET(prompt) /* {{{ */ { if (!param || param->type == EMPTY_PARAM) { - phpdbg_writeln("setprompt", "str=\"%s\"", "Current prompt: %s", phpdbg_get_prompt(TSRMLS_C)); + phpdbg_writeln("setprompt", "str=\"%s\"", "Current prompt: %s", phpdbg_get_prompt()); } else { - phpdbg_set_prompt(param->str TSRMLS_CC); + phpdbg_set_prompt(param->str); } return SUCCESS; @@ -62,12 +62,12 @@ PHPDBG_SET(break) /* {{{ */ case NUMERIC_PARAM: { if (param->next) { if (param->next->num) { - phpdbg_enable_breakpoint(param->num TSRMLS_CC); + phpdbg_enable_breakpoint(param->num); } else { - phpdbg_disable_breakpoint(param->num TSRMLS_CC); + phpdbg_disable_breakpoint(param->num); } } else { - phpdbg_breakbase_t *brake = phpdbg_find_breakbase(param->num TSRMLS_CC); + phpdbg_breakbase_t *brake = phpdbg_find_breakbase(param->num); if (brake) { phpdbg_writeln("setbreak", "id=\"%ld\" active=\"%s\"", "Breakpoint #%ld %s", param->num, brake->disabled ? "off" : "on"); } else { @@ -90,9 +90,9 @@ PHPDBG_SET(breaks) /* {{{ */ } else switch (param->type) { case NUMERIC_PARAM: { if (param->num) { - phpdbg_enable_breakpoints(TSRMLS_C); + phpdbg_enable_breakpoints(); } else { - phpdbg_disable_breakpoints(TSRMLS_C); + phpdbg_disable_breakpoints(); } } break; @@ -106,31 +106,31 @@ PHPDBG_SET(breaks) /* {{{ */ #ifndef _WIN32 PHPDBG_SET(color) /* {{{ */ { - const phpdbg_color_t *color = phpdbg_get_color(param->next->str, param->next->len TSRMLS_CC); + const phpdbg_color_t *color = phpdbg_get_color(param->next->str, param->next->len); if (!color) { phpdbg_error("setcolor", "type=\"nocolor\"", "Failed to find the requested color (%s)", param->next->str); return SUCCESS; } - switch (phpdbg_get_element(param->str, param->len TSRMLS_CC)) { + switch (phpdbg_get_element(param->str, param->len)) { case PHPDBG_COLOR_PROMPT: phpdbg_notice("setcolor", "type=\"prompt\" color=\"%s\" code=\"%s\"", "setting prompt color to %s (%s)", color->name, color->code); if (PHPDBG_G(prompt)[1]) { free(PHPDBG_G(prompt)[1]); PHPDBG_G(prompt)[1]=NULL; } - phpdbg_set_color(PHPDBG_COLOR_PROMPT, color TSRMLS_CC); + phpdbg_set_color(PHPDBG_COLOR_PROMPT, color); break; case PHPDBG_COLOR_ERROR: phpdbg_notice("setcolor", "type=\"error\" color=\"%s\" code=\"%s\"", "setting error color to %s (%s)", color->name, color->code); - phpdbg_set_color(PHPDBG_COLOR_ERROR, color TSRMLS_CC); + phpdbg_set_color(PHPDBG_COLOR_ERROR, color); break; case PHPDBG_COLOR_NOTICE: phpdbg_notice("setcolor", "type=\"notice\" color=\"%s\" code=\"%s\"", "setting notice color to %s (%s)", color->name, color->code); - phpdbg_set_color(PHPDBG_COLOR_NOTICE, color TSRMLS_CC); + phpdbg_set_color(PHPDBG_COLOR_NOTICE, color); break; default: diff --git a/sapi/phpdbg/phpdbg_sigio_win32.c b/sapi/phpdbg/phpdbg_sigio_win32.c index 158e034872..7b99a66478 100644 --- a/sapi/phpdbg/phpdbg_sigio_win32.c +++ b/sapi/phpdbg/phpdbg_sigio_win32.c @@ -31,31 +31,28 @@ SigIoWatcherThread(VOID *p) { zend_uchar sig; struct win32_sigio_watcher_data *swd = (struct win32_sigio_watcher_data *)p; -#ifdef ZTS - void ***tsrm_ls = swd->tsrm_ls; -#endif top: - (void)phpdbg_consume_bytes(swd->fd, &sig, 1, -1 TSRMLS_CC); + (void)phpdbg_consume_bytes(swd->fd, &sig, 1, -1); if (3 == sig) { /* XXX completely not sure it is done right here */ - if (PHPDBG_G(flags) & PHPDBG_IS_INTERACTIVE) { + if (*swd->flags & PHPDBG_IS_INTERACTIVE) { if (raise(sig)) { goto top; } } - if (PHPDBG_G(flags) & PHPDBG_IS_SIGNALED) { - phpdbg_set_sigsafe_mem(&sig TSRMLS_CC); + if (*swd->flags & PHPDBG_IS_SIGNALED) { + phpdbg_set_sigsafe_mem(&sig); zend_try { - phpdbg_force_interruption(TSRMLS_C); + phpdbg_force_interruption(); } zend_end_try(); - phpdbg_clear_sigsafe_mem(TSRMLS_C); + phpdbg_clear_sigsafe_mem(); goto end; } - if (!(PHPDBG_G(flags) & PHPDBG_IS_INTERACTIVE)) { - PHPDBG_G(flags) |= PHPDBG_IS_SIGNALED; + if (!(*swd->flags & PHPDBG_IS_INTERACTIVE)) { + *swd->flags |= PHPDBG_IS_SIGNALED; } end: /* XXX set signaled flag to the caller thread, question is - whether it's needed */ @@ -72,11 +69,10 @@ session. */ void sigio_watcher_start(void) { - TSRMLS_FETCH(); PHPDBG_G(swd).fd = PHPDBG_G(io)[PHPDBG_STDIN].fd; #ifdef ZTS - PHPDBG_G(swd).tsrm_ls = tsrm_ls; + PHPDBG_G(swd).flags = &PHPDBG_G(flags); #endif PHPDBG_G(sigio_watcher_thread) = CreateThread( @@ -92,7 +88,6 @@ void sigio_watcher_stop(void) { DWORD waited; - TSRMLS_FETCH(); if (INVALID_HANDLE_VALUE == PHPDBG_G(sigio_watcher_thread)) { /* it probably did bail out already */ diff --git a/sapi/phpdbg/phpdbg_sigio_win32.h b/sapi/phpdbg/phpdbg_sigio_win32.h index 8c8a381d64..beb27f979f 100644 --- a/sapi/phpdbg/phpdbg_sigio_win32.h +++ b/sapi/phpdbg/phpdbg_sigio_win32.h @@ -25,9 +25,7 @@ #include "phpdbg_io.h" struct win32_sigio_watcher_data { -#ifdef ZTS - void ***tsrm_ls; -#endif + uint64_t *flags; int fd; }; diff --git a/sapi/phpdbg/phpdbg_sigsafe.c b/sapi/phpdbg/phpdbg_sigsafe.c index 1ca7bf230c..ce321595b1 100644 --- a/sapi/phpdbg/phpdbg_sigsafe.c +++ b/sapi/phpdbg/phpdbg_sigsafe.c @@ -7,7 +7,6 @@ ZEND_EXTERN_MODULE_GLOBALS(phpdbg); #define EXP_STR(x) STR(x) static void* zend_mm_mem_alloc(zend_mm_storage *storage, size_t size, size_t alignment) { - TSRMLS_FETCH(); if (EXPECTED(size == PHPDBG_SIGSAFE_MEM_SIZE && !PHPDBG_G(sigsafe_mem).allocated)) { PHPDBG_G(sigsafe_mem).allocated = 1; @@ -28,7 +27,7 @@ static void* zend_mm_mem_alloc(zend_mm_storage *storage, size_t size, size_t ali static void zend_mm_mem_free(zend_mm_storage *storage, void *ptr, size_t size) { } -void phpdbg_set_sigsafe_mem(char *buffer TSRMLS_DC) { +void phpdbg_set_sigsafe_mem(char *buffer) { phpdbg_signal_safe_mem *mem = &PHPDBG_G(sigsafe_mem); mem->mem = buffer; mem->allocated = 0; @@ -38,19 +37,19 @@ void phpdbg_set_sigsafe_mem(char *buffer TSRMLS_DC) { mem->heap = zend_mm_startup_ex(&mem->storage); - mem->old_heap = zend_mm_set_heap(mem->heap TSRMLS_CC); + mem->old_heap = zend_mm_set_heap(mem->heap); } -zend_mm_heap *phpdbg_original_heap_sigsafe_mem(TSRMLS_D) { +zend_mm_heap *phpdbg_original_heap_sigsafe_mem(void) { return PHPDBG_G(sigsafe_mem).old_heap; } -void phpdbg_clear_sigsafe_mem(TSRMLS_D) { - zend_mm_set_heap(phpdbg_original_heap_sigsafe_mem(TSRMLS_C) TSRMLS_CC); +void phpdbg_clear_sigsafe_mem(void) { + zend_mm_set_heap(phpdbg_original_heap_sigsafe_mem()); PHPDBG_G(sigsafe_mem).mem = NULL; } -zend_bool phpdbg_active_sigsafe_mem(TSRMLS_D) { +zend_bool phpdbg_active_sigsafe_mem(void) { return !!PHPDBG_G(sigsafe_mem).mem; } diff --git a/sapi/phpdbg/phpdbg_sigsafe.h b/sapi/phpdbg/phpdbg_sigsafe.h index 9ef723fdca..d8a195f266 100644 --- a/sapi/phpdbg/phpdbg_sigsafe.h +++ b/sapi/phpdbg/phpdbg_sigsafe.h @@ -18,11 +18,11 @@ typedef struct { #include "phpdbg.h" -zend_bool phpdbg_active_sigsafe_mem(TSRMLS_D); +zend_bool phpdbg_active_sigsafe_mem(void); -void phpdbg_set_sigsafe_mem(char *mem TSRMLS_DC); -void phpdbg_clear_sigsafe_mem(TSRMLS_D); +void phpdbg_set_sigsafe_mem(char *mem); +void phpdbg_clear_sigsafe_mem(void); -zend_mm_heap *phpdbg_original_heap_sigsafe_mem(TSRMLS_D); +zend_mm_heap *phpdbg_original_heap_sigsafe_mem(void); #endif diff --git a/sapi/phpdbg/phpdbg_utils.c b/sapi/phpdbg/phpdbg_utils.c index bff971d4cf..ee938f5c0d 100644 --- a/sapi/phpdbg/phpdbg_utils.c +++ b/sapi/phpdbg/phpdbg_utils.c @@ -140,20 +140,20 @@ PHPDBG_API int phpdbg_is_class_method(const char *str, size_t len, char **class, return 1; } /* }}} */ -PHPDBG_API char *phpdbg_resolve_path(const char *path TSRMLS_DC) /* {{{ */ +PHPDBG_API char *phpdbg_resolve_path(const char *path) /* {{{ */ { char resolved_name[MAXPATHLEN]; - if (expand_filepath(path, resolved_name TSRMLS_CC) == NULL) { + if (expand_filepath(path, resolved_name) == NULL) { return NULL; } return estrdup(resolved_name); } /* }}} */ -PHPDBG_API const char *phpdbg_current_file(TSRMLS_D) /* {{{ */ +PHPDBG_API const char *phpdbg_current_file(void) /* {{{ */ { - const char *file = zend_get_executed_filename(TSRMLS_C); + const char *file = zend_get_executed_filename(); if (memcmp(file, "[no active file]", sizeof("[no active file]")) == 0) { return PHPDBG_G(exec); @@ -162,7 +162,7 @@ PHPDBG_API const char *phpdbg_current_file(TSRMLS_D) /* {{{ */ return file; } /* }}} */ -PHPDBG_API const zend_function *phpdbg_get_function(const char *fname, const char *cname TSRMLS_DC) /* {{{ */ +PHPDBG_API const zend_function *phpdbg_get_function(const char *fname, const char *cname) /* {{{ */ { zend_function *func = NULL; zend_string *lfname = zend_string_alloc(strlen(fname), 0); @@ -172,7 +172,7 @@ PHPDBG_API const zend_function *phpdbg_get_function(const char *fname, const cha zend_class_entry *ce; zend_string *lcname = zend_string_alloc(strlen(cname), 0); memcpy(lcname->val, zend_str_tolower_dup(cname, lcname->len), lcname->len + 1); - ce = zend_lookup_class(lcname TSRMLS_CC); + ce = zend_lookup_class(lcname); efree(lcname); @@ -217,7 +217,7 @@ PHPDBG_API char *phpdbg_trim(const char *str, size_t len, size_t *new_len) /* {{ } /* }}} */ -PHPDBG_API const phpdbg_color_t *phpdbg_get_color(const char *name, size_t name_length TSRMLS_DC) /* {{{ */ +PHPDBG_API const phpdbg_color_t *phpdbg_get_color(const char *name, size_t name_length) /* {{{ */ { const phpdbg_color_t *color = colors; @@ -235,26 +235,26 @@ PHPDBG_API const phpdbg_color_t *phpdbg_get_color(const char *name, size_t name_ return NULL; } /* }}} */ -PHPDBG_API void phpdbg_set_color(int element, const phpdbg_color_t *color TSRMLS_DC) /* {{{ */ +PHPDBG_API void phpdbg_set_color(int element, const phpdbg_color_t *color) /* {{{ */ { PHPDBG_G(colors)[element] = color; } /* }}} */ -PHPDBG_API void phpdbg_set_color_ex(int element, const char *name, size_t name_length TSRMLS_DC) /* {{{ */ +PHPDBG_API void phpdbg_set_color_ex(int element, const char *name, size_t name_length) /* {{{ */ { - const phpdbg_color_t *color = phpdbg_get_color(name, name_length TSRMLS_CC); + const phpdbg_color_t *color = phpdbg_get_color(name, name_length); if (color) { - phpdbg_set_color(element, color TSRMLS_CC); + phpdbg_set_color(element, color); } else PHPDBG_G(colors)[element] = colors; } /* }}} */ -PHPDBG_API const phpdbg_color_t* phpdbg_get_colors(TSRMLS_D) /* {{{ */ +PHPDBG_API const phpdbg_color_t* phpdbg_get_colors(void) /* {{{ */ { return colors; } /* }}} */ -PHPDBG_API int phpdbg_get_element(const char *name, size_t len TSRMLS_DC) { +PHPDBG_API int phpdbg_get_element(const char *name, size_t len) { const phpdbg_element_t *element = elements; while (element && element->name) { @@ -269,7 +269,7 @@ PHPDBG_API int phpdbg_get_element(const char *name, size_t len TSRMLS_DC) { return PHPDBG_COLOR_INVALID; } -PHPDBG_API void phpdbg_set_prompt(const char *prompt TSRMLS_DC) /* {{{ */ +PHPDBG_API void phpdbg_set_prompt(const char *prompt) /* {{{ */ { /* free formatted prompt */ if (PHPDBG_G(prompt)[1]) { @@ -286,7 +286,7 @@ PHPDBG_API void phpdbg_set_prompt(const char *prompt TSRMLS_DC) /* {{{ */ PHPDBG_G(prompt)[0] = strdup(prompt); } /* }}} */ -PHPDBG_API const char *phpdbg_get_prompt(TSRMLS_D) /* {{{ */ +PHPDBG_API const char *phpdbg_get_prompt(void) /* {{{ */ { /* find cached prompt */ if (PHPDBG_G(prompt)[1]) { @@ -312,13 +312,13 @@ PHPDBG_API const char *phpdbg_get_prompt(TSRMLS_D) /* {{{ */ return PHPDBG_G(prompt)[1]; } /* }}} */ -int phpdbg_rebuild_symtable(TSRMLS_D) { +int phpdbg_rebuild_symtable(void) { if (!EG(current_execute_data) || !EG(current_execute_data)->func) { phpdbg_error("inactive", "type=\"op_array\"", "No active op array!"); return FAILURE; } - if (!zend_rebuild_symbol_table(TSRMLS_C)) { + if (!zend_rebuild_symbol_table()) { phpdbg_error("inactive", "type=\"symbol_table\"", "No active symbol table!"); return FAILURE; } @@ -326,7 +326,7 @@ int phpdbg_rebuild_symtable(TSRMLS_D) { return SUCCESS; } -PHPDBG_API int phpdbg_get_terminal_width(TSRMLS_D) /* {{{ */ +PHPDBG_API int phpdbg_get_terminal_width(void) /* {{{ */ { int columns; #ifdef _WIN32 @@ -353,7 +353,7 @@ PHPDBG_API void phpdbg_set_async_io(int fd) { #endif } -int phpdbg_safe_class_lookup(const char *name, int name_length, zend_class_entry **ce TSRMLS_DC) { +int phpdbg_safe_class_lookup(const char *name, int name_length, zend_class_entry **ce) { if (PHPDBG_G(flags) & PHPDBG_IN_SIGNAL_HANDLER) { char *lc_name, *lc_free; int lc_length; @@ -380,7 +380,7 @@ int phpdbg_safe_class_lookup(const char *name, int name_length, zend_class_entry efree(lc_free); } else { zend_string *str_name = zend_string_init(name, name_length, 0); - *ce = zend_lookup_class(str_name TSRMLS_CC); + *ce = zend_lookup_class(str_name); efree(str_name); } @@ -394,15 +394,15 @@ char *phpdbg_get_property_key(char *key) { return strchr(key + 1, 0) + 1; } -static int phpdbg_parse_variable_arg_wrapper(char *name, size_t len, char *keyname, size_t keylen, HashTable *parent, zval *zv, phpdbg_parse_var_func callback TSRMLS_DC) { - return callback(name, len, keyname, keylen, parent, zv TSRMLS_CC); +static int phpdbg_parse_variable_arg_wrapper(char *name, size_t len, char *keyname, size_t keylen, HashTable *parent, zval *zv, phpdbg_parse_var_func callback) { + return callback(name, len, keyname, keylen, parent, zv); } -PHPDBG_API int phpdbg_parse_variable(char *input, size_t len, HashTable *parent, size_t i, phpdbg_parse_var_func callback, zend_bool silent TSRMLS_DC) { - return phpdbg_parse_variable_with_arg(input, len, parent, i, (phpdbg_parse_var_with_arg_func) phpdbg_parse_variable_arg_wrapper, silent, callback TSRMLS_CC); +PHPDBG_API int phpdbg_parse_variable(char *input, size_t len, HashTable *parent, size_t i, phpdbg_parse_var_func callback, zend_bool silent) { + return phpdbg_parse_variable_with_arg(input, len, parent, i, (phpdbg_parse_var_with_arg_func) phpdbg_parse_variable_arg_wrapper, silent, callback); } -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, zend_bool silent, void *arg TSRMLS_DC) { +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, zend_bool silent, void *arg) { int ret = FAILURE; zend_bool new_index = 1; char *last_index; @@ -468,11 +468,11 @@ PHPDBG_API int phpdbg_parse_variable_with_arg(char *input, size_t len, HashTable efree(key); } - ret = callback(name, namelen, keyname, index_len, parent, zv, arg TSRMLS_CC) == SUCCESS || ret == SUCCESS?SUCCESS:FAILURE; + ret = callback(name, namelen, keyname, index_len, parent, zv, arg) == SUCCESS || ret == SUCCESS?SUCCESS:FAILURE; } else if (Z_TYPE_P(zv) == IS_OBJECT) { - phpdbg_parse_variable_with_arg(input, len, Z_OBJPROP_P(zv), i, callback, silent, arg TSRMLS_CC); + phpdbg_parse_variable_with_arg(input, len, Z_OBJPROP_P(zv), i, callback, silent, arg); } else if (Z_TYPE_P(zv) == IS_ARRAY) { - phpdbg_parse_variable_with_arg(input, len, Z_ARRVAL_P(zv), i, callback, silent, arg TSRMLS_CC); + phpdbg_parse_variable_with_arg(input, len, Z_ARRVAL_P(zv), i, callback, silent, arg); } else { /* Ignore silently */ } @@ -496,7 +496,7 @@ PHPDBG_API int phpdbg_parse_variable_with_arg(char *input, size_t len, HashTable char *name = estrndup(input, len); char *keyname = estrndup(last_index, index_len); - ret = callback(name, len, keyname, index_len, parent, zv, arg TSRMLS_CC) == SUCCESS || ret == SUCCESS?SUCCESS:FAILURE; + ret = callback(name, len, keyname, index_len, parent, zv, arg) == SUCCESS || ret == SUCCESS?SUCCESS:FAILURE; } else if (Z_TYPE_P(zv) == IS_OBJECT) { parent = Z_OBJPROP_P(zv); } else if (Z_TYPE_P(zv) == IS_ARRAY) { @@ -515,15 +515,15 @@ PHPDBG_API int phpdbg_parse_variable_with_arg(char *input, size_t len, HashTable return FAILURE; } -int phpdbg_is_auto_global(char *name, int len TSRMLS_DC) { +int phpdbg_is_auto_global(char *name, int len) { int ret; zend_string *str = zend_string_init(name, len, 0); - ret = zend_is_auto_global(str TSRMLS_CC); + ret = zend_is_auto_global(str); efree(str); return ret; } -static int phpdbg_xml_array_element_dump(zval *zv, zend_string *key, zend_ulong num TSRMLS_DC) { +static int phpdbg_xml_array_element_dump(zval *zv, zend_string *key, zend_ulong num) { phpdbg_xml("<element"); phpdbg_try_access { @@ -539,14 +539,14 @@ static int phpdbg_xml_array_element_dump(zval *zv, zend_string *key, zend_ulong phpdbg_xml(">"); - phpdbg_xml_var_dump(zv TSRMLS_CC); + phpdbg_xml_var_dump(zv); phpdbg_xml("</element>"); return 0; } -static int phpdbg_xml_object_property_dump(zval *zv, zend_string *key, zend_ulong num TSRMLS_DC) { +static int phpdbg_xml_object_property_dump(zval *zv, zend_string *key, zend_ulong num) { phpdbg_xml("<property"); phpdbg_try_access { @@ -574,7 +574,7 @@ static int phpdbg_xml_object_property_dump(zval *zv, zend_string *key, zend_ulon phpdbg_xml(">"); - phpdbg_xml_var_dump(zv TSRMLS_CC); + phpdbg_xml_var_dump(zv); phpdbg_xml("</property>"); @@ -583,12 +583,12 @@ static int phpdbg_xml_object_property_dump(zval *zv, zend_string *key, zend_ulon #define COMMON (is_ref ? "&" : "") -PHPDBG_API void phpdbg_xml_var_dump(zval *zv TSRMLS_DC) { +PHPDBG_API void phpdbg_xml_var_dump(zval *zv) { HashTable *myht; zend_string *class_name, *key; zend_ulong num; zval *val; - int (*element_dump_func)(zval *zv, zend_string *key, zend_ulong num TSRMLS_DC); + int (*element_dump_func)(zval *zv, zend_string *key, zend_ulong num); zend_bool is_ref = 0; int is_temp; @@ -635,7 +635,7 @@ PHPDBG_API void phpdbg_xml_var_dump(zval *zv TSRMLS_DC) { break; } - class_name = Z_OBJ_HANDLER_P(zv, get_class_name)(Z_OBJ_P(zv) TSRMLS_CC); + class_name = Z_OBJ_HANDLER_P(zv, get_class_name)(Z_OBJ_P(zv)); phpdbg_xml("<object refstatus=\"%s\" class=\"%.*s\" id=\"%d\" num=\"%d\">", COMMON, class_name->len, class_name->val, Z_OBJ_HANDLE_P(zv), myht ? zend_hash_num_elements(myht) : 0); zend_string_release(class_name); @@ -643,9 +643,9 @@ PHPDBG_API void phpdbg_xml_var_dump(zval *zv TSRMLS_DC) { head_done: if (myht) { ZEND_HASH_FOREACH_KEY_VAL_IND(myht, num, key, val) { - element_dump_func(val, key, num TSRMLS_CC); + element_dump_func(val, key, num); } ZEND_HASH_FOREACH_END(); - zend_hash_apply_with_arguments(myht TSRMLS_CC, (apply_func_args_t) element_dump_func, 0); + zend_hash_apply_with_arguments(myht, (apply_func_args_t) element_dump_func, 0); --myht->u.v.nApplyCount; if (is_temp) { zend_hash_destroy(myht); @@ -659,7 +659,7 @@ head_done: } break; case IS_RESOURCE: { - const char *type_name = zend_rsrc_list_get_rsrc_type(Z_RES_P(zv) TSRMLS_CC); + const char *type_name = zend_rsrc_list_get_rsrc_type(Z_RES_P(zv)); phpdbg_xml("<resource refstatus=\"%s\" id=\"%pd\" type=\"%ld\" />", COMMON, Z_RES_P(zv)->handle, type_name ? type_name : "unknown"); break; } diff --git a/sapi/phpdbg/phpdbg_utils.h b/sapi/phpdbg/phpdbg_utils.h index feb5470b69..4219af5713 100644 --- a/sapi/phpdbg/phpdbg_utils.h +++ b/sapi/phpdbg/phpdbg_utils.h @@ -28,10 +28,10 @@ PHPDBG_API int phpdbg_is_numeric(const char*); PHPDBG_API int phpdbg_is_empty(const char*); PHPDBG_API int phpdbg_is_addr(const char*); PHPDBG_API int phpdbg_is_class_method(const char*, size_t, char**, char**); -PHPDBG_API const char *phpdbg_current_file(TSRMLS_D); -PHPDBG_API char *phpdbg_resolve_path(const char* TSRMLS_DC); +PHPDBG_API const char *phpdbg_current_file(void); +PHPDBG_API char *phpdbg_resolve_path(const char*); PHPDBG_API char *phpdbg_trim(const char*, size_t, size_t*); -PHPDBG_API const zend_function *phpdbg_get_function(const char*, const char* TSRMLS_DC); +PHPDBG_API const zend_function *phpdbg_get_function(const char*, const char*); /* {{{ Color Management */ #define PHPDBG_COLOR_LEN 12 @@ -63,42 +63,42 @@ typedef struct _phpdbg_element_t { int id; } phpdbg_element_t; -PHPDBG_API const phpdbg_color_t *phpdbg_get_color(const char *name, size_t name_length TSRMLS_DC); -PHPDBG_API void phpdbg_set_color(int element, const phpdbg_color_t *color TSRMLS_DC); -PHPDBG_API void phpdbg_set_color_ex(int element, const char *name, size_t name_length TSRMLS_DC); -PHPDBG_API const phpdbg_color_t *phpdbg_get_colors(TSRMLS_D); -PHPDBG_API int phpdbg_get_element(const char *name, size_t len TSRMLS_DC); /* }}} */ +PHPDBG_API const phpdbg_color_t *phpdbg_get_color(const char *name, size_t name_length); +PHPDBG_API void phpdbg_set_color(int element, const phpdbg_color_t *color); +PHPDBG_API void phpdbg_set_color_ex(int element, const char *name, size_t name_length); +PHPDBG_API const phpdbg_color_t *phpdbg_get_colors(void); +PHPDBG_API int phpdbg_get_element(const char *name, size_t len); /* }}} */ /* {{{ Prompt Management */ -PHPDBG_API void phpdbg_set_prompt(const char* TSRMLS_DC); -PHPDBG_API const char *phpdbg_get_prompt(TSRMLS_D); /* }}} */ +PHPDBG_API void phpdbg_set_prompt(const char*); +PHPDBG_API const char *phpdbg_get_prompt(void); /* }}} */ /* {{{ Console Width */ -PHPDBG_API int phpdbg_get_terminal_width(TSRMLS_D); /* }}} */ +PHPDBG_API int phpdbg_get_terminal_width(void); /* }}} */ PHPDBG_API void phpdbg_set_async_io(int fd); -int phpdbg_rebuild_symtable(TSRMLS_D); +int phpdbg_rebuild_symtable(void); -int phpdbg_safe_class_lookup(const char *name, int name_length, zend_class_entry **ce TSRMLS_DC); +int phpdbg_safe_class_lookup(const char *name, int name_length, zend_class_entry **ce); char *phpdbg_get_property_key(char *key); -typedef int (*phpdbg_parse_var_func)(char *name, size_t len, char *keyname, size_t keylen, HashTable *parent, zval *zv TSRMLS_DC); -typedef int (*phpdbg_parse_var_with_arg_func)(char *name, size_t len, char *keyname, size_t keylen, HashTable *parent, zval *zv, void *arg TSRMLS_DC); +typedef int (*phpdbg_parse_var_func)(char *name, size_t len, char *keyname, size_t keylen, HashTable *parent, zval *zv); +typedef int (*phpdbg_parse_var_with_arg_func)(char *name, size_t len, char *keyname, size_t keylen, HashTable *parent, zval *zv, void *arg); -PHPDBG_API int phpdbg_parse_variable(char *input, size_t len, HashTable *parent, size_t i, phpdbg_parse_var_func callback, zend_bool silent TSRMLS_DC); -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, zend_bool silent, void *arg TSRMLS_DC); +PHPDBG_API int phpdbg_parse_variable(char *input, size_t len, HashTable *parent, size_t i, phpdbg_parse_var_func callback, zend_bool silent); +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, zend_bool silent, void *arg); -int phpdbg_is_auto_global(char *name, int len TSRMLS_DC); +int phpdbg_is_auto_global(char *name, int len); -PHPDBG_API void phpdbg_xml_var_dump(zval *zv TSRMLS_DC); +PHPDBG_API void phpdbg_xml_var_dump(zval *zv); #ifdef ZTS #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_ls))[TSRM_UNSHUFFLE_RSRC_ID(output_globals_id)]; + output_globals_ptr = (zend_output_globals *) (*((void ***) tsrm_get_ls_cache()))[TSRM_UNSHUFFLE_RSRC_ID(output_globals_id)]; #else #define PHPDBG_OUTPUT_BACKUP_DEFINES() \ zend_output_globals *output_globals_ptr; \ @@ -109,14 +109,14 @@ PHPDBG_API void phpdbg_xml_var_dump(zval *zv TSRMLS_DC); #define PHPDBG_OUTPUT_BACKUP_SWAP() \ original_output_globals = *output_globals_ptr; \ memset(output_globals_ptr, 0, sizeof(zend_output_globals)); \ - php_output_activate(TSRMLS_C); + php_output_activate(); #define PHPDBG_OUTPUT_BACKUP() \ PHPDBG_OUTPUT_BACKUP_DEFINES() \ PHPDBG_OUTPUT_BACKUP_SWAP() #define PHPDBG_OUTPUT_BACKUP_RESTORE() \ - php_output_deactivate(TSRMLS_C); \ + php_output_deactivate(); \ *output_globals_ptr = original_output_globals; #endif /* PHPDBG_UTILS_H */ diff --git a/sapi/phpdbg/phpdbg_wait.c b/sapi/phpdbg/phpdbg_wait.c index a76dda88e4..62105d882d 100644 --- a/sapi/phpdbg/phpdbg_wait.c +++ b/sapi/phpdbg/phpdbg_wait.c @@ -23,7 +23,7 @@ ZEND_EXTERN_MODULE_GLOBALS(phpdbg); -static void phpdbg_rebuild_http_globals_array(int type, const char *name TSRMLS_DC) { +static void phpdbg_rebuild_http_globals_array(int type, const char *name) { zval *zvp; if (Z_TYPE(PG(http_globals)[type]) != IS_UNDEF) { zval_dtor(&PG(http_globals)[type]); @@ -35,7 +35,7 @@ static void phpdbg_rebuild_http_globals_array(int type, const char *name TSRMLS_ } -static int phpdbg_dearm_autoglobals(zend_auto_global *auto_global TSRMLS_DC) { +static int phpdbg_dearm_autoglobals(zend_auto_global *auto_global) { if (auto_global->name->len != sizeof("GLOBALS") - 1 || memcmp(auto_global->name->val, "GLOBALS", sizeof("GLOBALS") - 1)) { auto_global->armed = 0; } @@ -48,7 +48,7 @@ typedef struct { HashPosition pos[2]; } phpdbg_intersect_ptr; -static int phpdbg_array_data_compare(const void *a, const void *b TSRMLS_DC) { +static int phpdbg_array_data_compare(const void *a, const void *b) { Bucket *f, *s; zval result; zval *first, *second; @@ -59,7 +59,7 @@ static int phpdbg_array_data_compare(const void *a, const void *b TSRMLS_DC) { first = &f->val; second = &s->val; - if (string_compare_function(&result, first, second TSRMLS_CC) == FAILURE) { + if (string_compare_function(&result, first, second) == FAILURE) { return 0; } @@ -72,12 +72,12 @@ static int phpdbg_array_data_compare(const void *a, const void *b TSRMLS_DC) { return 0; } -static void phpdbg_array_intersect_init(phpdbg_intersect_ptr *info, HashTable *ht1, HashTable *ht2 TSRMLS_DC) { +static void phpdbg_array_intersect_init(phpdbg_intersect_ptr *info, HashTable *ht1, HashTable *ht2) { info->ht[0] = ht1; info->ht[1] = ht2; - zend_hash_sort(info->ht[0], zend_qsort, (compare_func_t) phpdbg_array_data_compare, 0 TSRMLS_CC); - zend_hash_sort(info->ht[1], zend_qsort, (compare_func_t) phpdbg_array_data_compare, 0 TSRMLS_CC); + zend_hash_sort(info->ht[0], zend_qsort, (compare_func_t) phpdbg_array_data_compare, 0); + zend_hash_sort(info->ht[1], zend_qsort, (compare_func_t) phpdbg_array_data_compare, 0); zend_hash_internal_pointer_reset_ex(info->ht[0], &info->pos[0]); zend_hash_internal_pointer_reset_ex(info->ht[1], &info->pos[1]); @@ -124,14 +124,14 @@ static int phpdbg_array_intersect(phpdbg_intersect_ptr *info, zval **ptr) { return ret; } -void phpdbg_webdata_decompress(char *msg, int len TSRMLS_DC) { +void phpdbg_webdata_decompress(char *msg, int len) { zval *free_zv = NULL; zval zv, *zvp; HashTable *ht; php_unserialize_data_t var_hash; PHP_VAR_UNSERIALIZE_INIT(var_hash); - if (!php_var_unserialize(&zv, (const unsigned char **) &msg, (unsigned char *) msg + len, &var_hash TSRMLS_CC)) { + if (!php_var_unserialize(&zv, (const unsigned char **) &msg, (unsigned char *) msg + len, &var_hash)) { PHP_VAR_UNSERIALIZE_DESTROY(var_hash); phpdbg_error("wait", "type=\"invaliddata\" import=\"fail\"", "Malformed serialized was sent to this socket, arborting"); return; @@ -149,24 +149,24 @@ void phpdbg_webdata_decompress(char *msg, int len TSRMLS_DC) { if ((script = zend_hash_str_find(Z_ARRVAL_P(srv), ZEND_STRL("SCRIPT_FILENAME"))) && Z_TYPE_P(script) == IS_STRING) { phpdbg_param_t param; param.str = Z_STRVAL_P(script); - PHPDBG_COMMAND_HANDLER(exec)(¶m TSRMLS_CC); + PHPDBG_COMMAND_HANDLER(exec)(¶m); } } } PG(auto_globals_jit) = 0; - zend_hash_apply(CG(auto_globals), (apply_func_t) phpdbg_dearm_autoglobals TSRMLS_CC); + zend_hash_apply(CG(auto_globals), (apply_func_t) phpdbg_dearm_autoglobals); zend_hash_clean(&EG(symbol_table).ht); EG(symbol_table) = *Z_ARR_P(zvp); /* Rebuild cookies, env vars etc. from GLOBALS (PG(http_globals)) */ - phpdbg_rebuild_http_globals_array(TRACK_VARS_POST, "_POST" TSRMLS_CC); - phpdbg_rebuild_http_globals_array(TRACK_VARS_GET, "_GET" TSRMLS_CC); - phpdbg_rebuild_http_globals_array(TRACK_VARS_COOKIE, "_COOKIE" TSRMLS_CC); - phpdbg_rebuild_http_globals_array(TRACK_VARS_SERVER, "_SERVER" TSRMLS_CC); - phpdbg_rebuild_http_globals_array(TRACK_VARS_ENV, "_ENV" TSRMLS_CC); - phpdbg_rebuild_http_globals_array(TRACK_VARS_FILES, "_FILES" TSRMLS_CC); + phpdbg_rebuild_http_globals_array(TRACK_VARS_POST, "_POST"); + phpdbg_rebuild_http_globals_array(TRACK_VARS_GET, "_GET"); + phpdbg_rebuild_http_globals_array(TRACK_VARS_COOKIE, "_COOKIE"); + phpdbg_rebuild_http_globals_array(TRACK_VARS_SERVER, "_SERVER"); + phpdbg_rebuild_http_globals_array(TRACK_VARS_ENV, "_ENV"); + phpdbg_rebuild_http_globals_array(TRACK_VARS_FILES, "_FILES"); Z_ADDREF_P(zvp); free_zv = zvp; @@ -222,7 +222,7 @@ void phpdbg_webdata_decompress(char *msg, int len TSRMLS_DC) { } } ZEND_HASH_FOREACH_END(); - phpdbg_array_intersect_init(&pos, &zv_registry, Z_ARRVAL_P(zvp) TSRMLS_CC); + phpdbg_array_intersect_init(&pos, &zv_registry, Z_ARRVAL_P(zvp)); do { int mode = phpdbg_array_intersect(&pos, &module); if (mode < 0) { @@ -299,7 +299,7 @@ void phpdbg_webdata_decompress(char *msg, int len TSRMLS_DC) { } ZEND_HASH_FOREACH_END(); } - zend_ini_deactivate(TSRMLS_C); + zend_ini_deactivate(); if ((zvp = zend_hash_str_find(ht, ZEND_STRL("systemini"))) && Z_TYPE_P(zvp) == IS_ARRAY) { zval *ini_entry; @@ -309,7 +309,7 @@ void phpdbg_webdata_decompress(char *msg, int len TSRMLS_DC) { ZEND_HASH_FOREACH_STR_KEY_VAL(Z_ARRVAL_P(zvp), key, ini_entry) { if (key && Z_TYPE_P(ini_entry) == IS_STRING) { if ((original_ini = zend_hash_find_ptr(EG(ini_directives), key))) { - if (!original_ini->on_modify || original_ini->on_modify(original_ini, Z_STR_P(ini_entry), original_ini->mh_arg1, original_ini->mh_arg2, original_ini->mh_arg3, ZEND_INI_STAGE_ACTIVATE TSRMLS_CC) == SUCCESS) { + if (!original_ini->on_modify || original_ini->on_modify(original_ini, Z_STR_P(ini_entry), original_ini->mh_arg1, original_ini->mh_arg2, original_ini->mh_arg3, ZEND_INI_STAGE_ACTIVATE) == SUCCESS) { if (original_ini->modified && original_ini->orig_value != original_ini->value) { efree(original_ini->value); } @@ -327,7 +327,7 @@ void phpdbg_webdata_decompress(char *msg, int len TSRMLS_DC) { ZEND_HASH_FOREACH_STR_KEY_VAL(Z_ARRVAL_P(zvp), key, ini_entry) { if (key && Z_TYPE_P(ini_entry) == IS_STRING) { - zend_alter_ini_entry_ex(key, Z_STR_P(ini_entry), ZEND_INI_PERDIR, ZEND_INI_STAGE_HTACCESS, 1 TSRMLS_CC); + zend_alter_ini_entry_ex(key, Z_STR_P(ini_entry), ZEND_INI_PERDIR, ZEND_INI_STAGE_HTACCESS, 1); } } ZEND_HASH_FOREACH_END(); } @@ -384,7 +384,7 @@ PHPDBG_COMMAND(wait) /* {{{ */ recvd -= recv(sr, &(data[(*(int *) msglen) - recvd]), recvd, 0); } while (recvd > 0); - phpdbg_webdata_decompress(data, *(int *) msglen TSRMLS_CC); + phpdbg_webdata_decompress(data, *(int *) 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 7cf95919cc..c5a6bb95eb 100644 --- a/sapi/phpdbg/phpdbg_wait.h +++ b/sapi/phpdbg/phpdbg_wait.h @@ -24,6 +24,6 @@ PHPDBG_COMMAND(wait); -void phpdbg_webdata_decompress(char *msg, int len TSRMLS_DC); +void phpdbg_webdata_decompress(char *msg, int len); #endif /* PHPDBG_WAIT_H */ diff --git a/sapi/phpdbg/phpdbg_watch.c b/sapi/phpdbg/phpdbg_watch.c index 7a39d3ee1a..adb01f6d54 100644 --- a/sapi/phpdbg/phpdbg_watch.c +++ b/sapi/phpdbg/phpdbg_watch.c @@ -37,7 +37,7 @@ const phpdbg_command_t phpdbg_watch_commands[] = { PHPDBG_END_COMMAND }; -//#define HT_FROM_WATCH(watch) (watch->type == WATCH_ON_OBJECT ? watch->addr.obj->handlers->get_properties(watch->parent_container.zv TSRMLS_CC) : watch->type == WATCH_ON_ARRAY ? &watch->addr.arr->ht : NULL) +//#define HT_FROM_WATCH(watch) (watch->type == WATCH_ON_OBJECT ? watch->addr.obj->handlers->get_properties(watch->parent_container.zv) : watch->type == WATCH_ON_ARRAY ? &watch->addr.arr->ht : NULL) #define HT_FROM_ZVP(zvp) (Z_TYPE_P(zvp) == IS_OBJECT ? Z_OBJPROP_P(zvp) : Z_TYPE_P(zvp) == IS_ARRAY ? Z_ARRVAL_P(zvp) : NULL) typedef struct { @@ -51,7 +51,7 @@ typedef struct { #define MEMDUMP_SIZE(size) (sizeof(phpdbg_watch_memdump) - sizeof(void *) + (size)) -static phpdbg_watchpoint_t *phpdbg_check_for_watchpoint(void *addr TSRMLS_DC) { +static phpdbg_watchpoint_t *phpdbg_check_for_watchpoint(void *addr) { phpdbg_watchpoint_t *watch; phpdbg_btree_result *result = phpdbg_btree_find_closest(&PHPDBG_G(watchpoint_tree), (zend_ulong)phpdbg_get_page_boundary(addr) + phpdbg_pagesize - 1); @@ -70,24 +70,24 @@ static phpdbg_watchpoint_t *phpdbg_check_for_watchpoint(void *addr TSRMLS_DC) { return watch; } -static void phpdbg_change_watchpoint_access(phpdbg_watchpoint_t *watch, int access TSRMLS_DC) { +static void phpdbg_change_watchpoint_access(phpdbg_watchpoint_t *watch, int access) { /* pagesize is assumed to be in the range of 2^x */ mprotect(phpdbg_get_page_boundary(watch->addr.ptr), phpdbg_get_total_page_size(watch->addr.ptr, watch->size), access); } -static inline void phpdbg_activate_watchpoint(phpdbg_watchpoint_t *watch TSRMLS_DC) { - phpdbg_change_watchpoint_access(watch, PROT_READ TSRMLS_CC); +static inline void phpdbg_activate_watchpoint(phpdbg_watchpoint_t *watch) { + phpdbg_change_watchpoint_access(watch, PROT_READ); } -static inline void phpdbg_deactivate_watchpoint(phpdbg_watchpoint_t *watch TSRMLS_DC) { - phpdbg_change_watchpoint_access(watch, PROT_READ | PROT_WRITE TSRMLS_CC); +static inline void phpdbg_deactivate_watchpoint(phpdbg_watchpoint_t *watch) { + phpdbg_change_watchpoint_access(watch, PROT_READ | PROT_WRITE); } -static inline void phpdbg_store_watchpoint(phpdbg_watchpoint_t *watch TSRMLS_DC) { +static inline void phpdbg_store_watchpoint(phpdbg_watchpoint_t *watch) { phpdbg_btree_insert(&PHPDBG_G(watchpoint_tree), (zend_ulong) watch->addr.ptr, watch); } -static inline void phpdbg_remove_watchpoint(phpdbg_watchpoint_t *watch TSRMLS_DC) { +static inline void phpdbg_remove_watchpoint(phpdbg_watchpoint_t *watch) { phpdbg_btree_delete(&PHPDBG_G(watchpoint_tree), (zend_ulong) watch->addr.ptr); } @@ -108,10 +108,10 @@ void phpdbg_create_ht_watchpoint(HashTable *ht, phpdbg_watchpoint_t *watch) { void phpdbg_watch_HashTable_dtor(zval *ptr); -static int phpdbg_delete_watchpoint(phpdbg_watchpoint_t *tmp_watch TSRMLS_DC); -static void phpdbg_delete_ht_watchpoints_recursive(phpdbg_watchpoint_t *watch TSRMLS_DC); -static void phpdbg_delete_zval_watchpoints_recursive(phpdbg_watchpoint_t *watch TSRMLS_DC); -static void phpdbg_delete_watchpoints_recursive(phpdbg_watchpoint_t *watch TSRMLS_DC); +static int phpdbg_delete_watchpoint(phpdbg_watchpoint_t *tmp_watch); +static void phpdbg_delete_ht_watchpoints_recursive(phpdbg_watchpoint_t *watch); +static void phpdbg_delete_zval_watchpoints_recursive(phpdbg_watchpoint_t *watch); +static void phpdbg_delete_watchpoints_recursive(phpdbg_watchpoint_t *watch); /* TODO: Store all the possible watches the refcounted may refer to (for displaying & deleting by identifier) */ @@ -125,7 +125,7 @@ static phpdbg_watchpoint_t *phpdbg_create_refcounted_watchpoint(phpdbg_watchpoin return watch; } -static void phpdbg_add_watch_collision(phpdbg_watchpoint_t *watch TSRMLS_DC) { +static void phpdbg_add_watch_collision(phpdbg_watchpoint_t *watch) { phpdbg_watch_collision *cur; if ((cur = zend_hash_index_find_ptr(&PHPDBG_G(watch_collisions), (zend_ulong) watch->addr.ref))) { cur->num++; @@ -139,43 +139,43 @@ static void phpdbg_add_watch_collision(phpdbg_watchpoint_t *watch TSRMLS_DC) { coll.watch = *watch; zend_hash_init(&coll.watches, 8, NULL, NULL, 0); cur = zend_hash_index_add_mem(&PHPDBG_G(watch_collisions), (zend_ulong) watch->addr.ref, &coll, sizeof(phpdbg_watch_collision)); - phpdbg_store_watchpoint(&cur->watch TSRMLS_CC); - phpdbg_activate_watchpoint(&cur->watch TSRMLS_CC); + phpdbg_store_watchpoint(&cur->watch); + phpdbg_activate_watchpoint(&cur->watch); } zend_hash_str_add_ptr(&cur->watches, watch->parent->str, watch->parent->str_len, watch->parent); } -static void phpdbg_remove_watch_collision(zend_refcounted *ref TSRMLS_DC) { +static void phpdbg_remove_watch_collision(zend_refcounted *ref) { phpdbg_watch_collision *cur; if ((cur = zend_hash_index_find_ptr(&PHPDBG_G(watch_collisions), (zend_ulong) ref))) { phpdbg_watchpoint_t *watch = cur->watch.parent; if (watch->flags == PHPDBG_WATCH_RECURSIVE && !--cur->refs) { - phpdbg_delete_watchpoints_recursive(watch TSRMLS_CC); + phpdbg_delete_watchpoints_recursive(watch); } zend_hash_str_del(&cur->watches, watch->str, watch->str_len); if (!--cur->num) { - phpdbg_deactivate_watchpoint(&cur->watch TSRMLS_CC); - phpdbg_remove_watchpoint(&cur->watch TSRMLS_CC); + phpdbg_deactivate_watchpoint(&cur->watch); + phpdbg_remove_watchpoint(&cur->watch); - phpdbg_delete_watchpoint(watch TSRMLS_CC); + phpdbg_delete_watchpoint(watch); zend_hash_index_del(&PHPDBG_G(watch_collisions), (zend_ulong) ref); } } } -static int phpdbg_create_watchpoint(phpdbg_watchpoint_t *watch TSRMLS_DC) { +static int phpdbg_create_watchpoint(phpdbg_watchpoint_t *watch) { watch->flags |= PHPDBG_WATCH_SIMPLE; - phpdbg_store_watchpoint(watch TSRMLS_CC); + phpdbg_store_watchpoint(watch); zend_hash_str_add_ptr(&PHPDBG_G(watchpoints), watch->str, watch->str_len, watch); if (watch->parent && watch->parent->type == WATCH_ON_ZVAL && Z_REFCOUNTED_P(watch->parent->addr.zv)) { - phpdbg_add_watch_collision(phpdbg_create_refcounted_watchpoint(watch, Z_COUNTED_P(watch->parent->addr.zv)) TSRMLS_CC); + phpdbg_add_watch_collision(phpdbg_create_refcounted_watchpoint(watch, Z_COUNTED_P(watch->parent->addr.zv))); } if (watch->type == WATCH_ON_ZVAL) { @@ -193,16 +193,16 @@ static int phpdbg_create_watchpoint(phpdbg_watchpoint_t *watch TSRMLS_DC) { ref->parent_container = NULL; phpdbg_create_zval_watchpoint(Z_REFVAL_P(watch->addr.zv), ref); - phpdbg_create_watchpoint(ref TSRMLS_CC); + phpdbg_create_watchpoint(ref); } } - phpdbg_activate_watchpoint(watch TSRMLS_CC); + phpdbg_activate_watchpoint(watch); return SUCCESS; } -static int phpdbg_create_array_watchpoint(phpdbg_watchpoint_t *zv_watch TSRMLS_DC) { +static int phpdbg_create_array_watchpoint(phpdbg_watchpoint_t *zv_watch) { zval *zv = zv_watch->addr.zv; phpdbg_watchpoint_t *watch = emalloc(sizeof(phpdbg_watchpoint_t)); HashTable *ht = HT_FROM_ZVP(zv); @@ -215,7 +215,7 @@ static int phpdbg_create_array_watchpoint(phpdbg_watchpoint_t *zv_watch TSRMLS_D phpdbg_create_ht_watchpoint(ht, watch); - phpdbg_create_watchpoint(watch TSRMLS_CC); + phpdbg_create_watchpoint(watch); if (Z_TYPE_P(zv) == IS_ARRAY) { watch->flags |= PHPDBG_WATCH_ARRAY; @@ -223,12 +223,12 @@ static int phpdbg_create_array_watchpoint(phpdbg_watchpoint_t *zv_watch TSRMLS_D watch->flags |= PHPDBG_WATCH_OBJECT; } - phpdbg_add_watch_collision(phpdbg_create_refcounted_watchpoint(watch, Z_COUNTED_P(zv)) TSRMLS_CC); + phpdbg_add_watch_collision(phpdbg_create_refcounted_watchpoint(watch, Z_COUNTED_P(zv))); return SUCCESS; } -static int phpdbg_create_recursive_watchpoint(phpdbg_watchpoint_t *watch TSRMLS_DC) { +static int phpdbg_create_recursive_watchpoint(phpdbg_watchpoint_t *watch) { HashTable *ht; zval *zvp = watch->addr.zv; @@ -237,7 +237,7 @@ static int phpdbg_create_recursive_watchpoint(phpdbg_watchpoint_t *watch TSRMLS_ } watch->flags |= PHPDBG_WATCH_RECURSIVE; - phpdbg_create_watchpoint(watch TSRMLS_CC); + phpdbg_create_watchpoint(watch); ZVAL_DEREF(zvp); @@ -272,7 +272,7 @@ static int phpdbg_create_recursive_watchpoint(phpdbg_watchpoint_t *watch TSRMLS_ } phpdbg_create_zval_watchpoint(zv, new_watch); - phpdbg_create_recursive_watchpoint(new_watch TSRMLS_CC); + phpdbg_create_recursive_watchpoint(new_watch); } ZEND_HASH_FOREACH_END(); } @@ -294,34 +294,34 @@ static int phpdbg_create_recursive_watchpoint(phpdbg_watchpoint_t *watch TSRMLS_ } phpdbg_create_ht_watchpoint(ht, new_watch); - phpdbg_create_watchpoint(new_watch TSRMLS_CC); + phpdbg_create_watchpoint(new_watch); } return SUCCESS; } -static int phpdbg_delete_watchpoint_recursive(phpdbg_watchpoint_t *watch, zend_bool user_request TSRMLS_DC) { +static int phpdbg_delete_watchpoint_recursive(phpdbg_watchpoint_t *watch, zend_bool user_request) { if (watch->type == WATCH_ON_HASHTABLE) { HashTable *ht; phpdbg_btree_result *result; if (watch->type == WATCH_ON_HASHTABLE && user_request) { - phpdbg_delete_ht_watchpoints_recursive(watch TSRMLS_CC); + phpdbg_delete_ht_watchpoints_recursive(watch); } else { ht = HT_FROM_ZVP(watch->addr.zv); if ((result = phpdbg_btree_find(&PHPDBG_G(watchpoint_tree), (zend_ulong) ht))) { - phpdbg_delete_watchpoint_recursive((phpdbg_watchpoint_t *) result->ptr, user_request TSRMLS_CC); + phpdbg_delete_watchpoint_recursive((phpdbg_watchpoint_t *) result->ptr, user_request); } } } else if (watch->type == WATCH_ON_ZVAL) { - phpdbg_delete_zval_watchpoints_recursive(watch TSRMLS_CC); + phpdbg_delete_zval_watchpoints_recursive(watch); } return zend_hash_str_del(&PHPDBG_G(watchpoints), watch->str, watch->str_len); } -static void phpdbg_delete_ht_watchpoints_recursive(phpdbg_watchpoint_t *watch TSRMLS_DC) { +static void phpdbg_delete_ht_watchpoints_recursive(phpdbg_watchpoint_t *watch) { zend_string *strkey; zend_long numkey; char *str; @@ -336,26 +336,26 @@ static void phpdbg_delete_ht_watchpoints_recursive(phpdbg_watchpoint_t *watch TS } if ((watchpoint = zend_hash_str_find_ptr(&PHPDBG_G(watchpoints), str, str_len))) { - phpdbg_delete_watchpoint_recursive(watchpoint, 1 TSRMLS_CC); + phpdbg_delete_watchpoint_recursive(watchpoint, 1); } } ZEND_HASH_FOREACH_END(); } -static void phpdbg_delete_zval_watchpoints_recursive(phpdbg_watchpoint_t *watch TSRMLS_DC) { +static void phpdbg_delete_zval_watchpoints_recursive(phpdbg_watchpoint_t *watch) { if (Z_REFCOUNTED_P(watch->addr.zv)) { - phpdbg_remove_watch_collision(Z_COUNTED_P(watch->addr.zv) TSRMLS_CC); + phpdbg_remove_watch_collision(Z_COUNTED_P(watch->addr.zv)); } } -static void phpdbg_delete_watchpoints_recursive(phpdbg_watchpoint_t *watch TSRMLS_DC) { +static void phpdbg_delete_watchpoints_recursive(phpdbg_watchpoint_t *watch) { if (watch->type == WATCH_ON_ZVAL) { - phpdbg_delete_zval_watchpoints_recursive(watch TSRMLS_CC); + phpdbg_delete_zval_watchpoints_recursive(watch); } else if (watch->type == WATCH_ON_HASHTABLE) { - phpdbg_delete_ht_watchpoints_recursive(watch TSRMLS_CC); + phpdbg_delete_ht_watchpoints_recursive(watch); } } -static int phpdbg_delete_watchpoint(phpdbg_watchpoint_t *tmp_watch TSRMLS_DC) { +static int phpdbg_delete_watchpoint(phpdbg_watchpoint_t *tmp_watch) { int ret; phpdbg_watchpoint_t *watch; phpdbg_btree_result *result; @@ -367,7 +367,7 @@ static int phpdbg_delete_watchpoint(phpdbg_watchpoint_t *tmp_watch TSRMLS_DC) { watch = result->ptr; if (watch->flags & PHPDBG_WATCH_RECURSIVE) { - ret = phpdbg_delete_watchpoint_recursive(watch, 1 TSRMLS_CC); + ret = phpdbg_delete_watchpoint_recursive(watch, 1); } else { ret = zend_hash_str_del(&PHPDBG_G(watchpoints), watch->str, watch->str_len); } @@ -379,7 +379,7 @@ static int phpdbg_delete_watchpoint(phpdbg_watchpoint_t *tmp_watch TSRMLS_DC) { return ret; } -static int phpdbg_watchpoint_parse_wrapper(char *name, size_t len, char *keyname, size_t keylen, HashTable *parent, zval *zv, int (*callback)(phpdbg_watchpoint_t * TSRMLS_DC) TSRMLS_DC) { +static int phpdbg_watchpoint_parse_wrapper(char *name, size_t len, char *keyname, size_t keylen, HashTable *parent, zval *zv, int (*callback)(phpdbg_watchpoint_t *)) { int ret; phpdbg_watchpoint_t *watch = emalloc(sizeof(phpdbg_watchpoint_t)); watch->flags = 0; @@ -390,7 +390,7 @@ static int phpdbg_watchpoint_parse_wrapper(char *name, size_t len, char *keyname watch->parent_container = parent; phpdbg_create_zval_watchpoint(zv, watch); - ret = callback(watch TSRMLS_CC); + ret = callback(watch); if (ret != SUCCESS) { efree(watch); @@ -401,27 +401,27 @@ static int phpdbg_watchpoint_parse_wrapper(char *name, size_t len, char *keyname return ret; } -PHPDBG_API int phpdbg_watchpoint_parse_input(char *input, size_t len, HashTable *parent, size_t i, int (*callback)(phpdbg_watchpoint_t * TSRMLS_DC), zend_bool silent TSRMLS_DC) { - return phpdbg_parse_variable_with_arg(input, len, parent, i, (phpdbg_parse_var_with_arg_func) phpdbg_watchpoint_parse_wrapper, 0, callback TSRMLS_CC); +PHPDBG_API int phpdbg_watchpoint_parse_input(char *input, size_t len, HashTable *parent, size_t i, int (*callback)(phpdbg_watchpoint_t *), zend_bool silent) { + return phpdbg_parse_variable_with_arg(input, len, parent, i, (phpdbg_parse_var_with_arg_func) phpdbg_watchpoint_parse_wrapper, 0, callback); } -static int phpdbg_watchpoint_parse_symtables(char *input, size_t len, int (*callback)(phpdbg_watchpoint_t * TSRMLS_DC) TSRMLS_DC) { +static int phpdbg_watchpoint_parse_symtables(char *input, size_t len, int (*callback)(phpdbg_watchpoint_t *)) { if (EG(scope) && len >= 5 && !memcmp("$this", input, 5)) { zend_hash_str_add(&EG(current_execute_data)->symbol_table->ht, ZEND_STRL("this"), &EG(current_execute_data)->This); } - if (phpdbg_is_auto_global(input, len TSRMLS_CC) && phpdbg_watchpoint_parse_input(input, len, &EG(symbol_table).ht, 0, callback, 1 TSRMLS_CC) != FAILURE) { + if (phpdbg_is_auto_global(input, len) && phpdbg_watchpoint_parse_input(input, len, &EG(symbol_table).ht, 0, callback, 1) != FAILURE) { return SUCCESS; } - return phpdbg_watchpoint_parse_input(input, len, &EG(current_execute_data)->symbol_table->ht, 0, callback, 0 TSRMLS_CC); + return phpdbg_watchpoint_parse_input(input, len, &EG(current_execute_data)->symbol_table->ht, 0, callback, 0); } PHPDBG_WATCH(delete) /* {{{ */ { switch (param->type) { case STR_PARAM: - if (phpdbg_delete_var_watchpoint(param->str, param->len TSRMLS_CC) == FAILURE) { + if (phpdbg_delete_var_watchpoint(param->str, param->len) == FAILURE) { phpdbg_error("watchdelete", "type=\"nowatch\"", "Nothing was deleted, no corresponding watchpoint found"); } else { phpdbg_notice("watchdelete", "variable=\"%.*s\"", "Removed watchpoint %.*s", (int) param->len, param->str); @@ -436,13 +436,13 @@ PHPDBG_WATCH(delete) /* {{{ */ PHPDBG_WATCH(recursive) /* {{{ */ { - if (phpdbg_rebuild_symtable(TSRMLS_C) == FAILURE) { + if (phpdbg_rebuild_symtable() == FAILURE) { return SUCCESS; } switch (param->type) { case STR_PARAM: - if (phpdbg_watchpoint_parse_symtables(param->str, param->len, phpdbg_create_recursive_watchpoint TSRMLS_CC) != FAILURE) { + if (phpdbg_watchpoint_parse_symtables(param->str, param->len, phpdbg_create_recursive_watchpoint) != FAILURE) { phpdbg_notice("watchrecursive", "variable=\"%.*s\"", "Set recursive watchpoint on %.*s", (int)param->len, param->str); } break; @@ -455,13 +455,13 @@ PHPDBG_WATCH(recursive) /* {{{ */ PHPDBG_WATCH(array) /* {{{ */ { - if (phpdbg_rebuild_symtable(TSRMLS_C) == FAILURE) { + if (phpdbg_rebuild_symtable() == FAILURE) { return SUCCESS; } switch (param->type) { case STR_PARAM: - if (phpdbg_watchpoint_parse_symtables(param->str, param->len, phpdbg_create_array_watchpoint TSRMLS_CC) != FAILURE) { + if (phpdbg_watchpoint_parse_symtables(param->str, param->len, phpdbg_create_array_watchpoint) != FAILURE) { phpdbg_notice("watcharray", "variable=\"%.*s\"", "Set array watchpoint on %.*s", (int)param->len, param->str); } break; @@ -474,7 +474,6 @@ PHPDBG_WATCH(array) /* {{{ */ void phpdbg_watch_HashTable_dtor(zval *zv) { phpdbg_btree_result *result; - TSRMLS_FETCH(); zval_ptr_dtor_wrapper(zv); @@ -486,7 +485,7 @@ void phpdbg_watch_HashTable_dtor(zval *zv) { phpdbg_notice("watchdelete", "variable=\"%.*s\" recursive=\"%s\"", "%.*s was removed, removing watchpoint%s", (int) watch->str_len, watch->str, (watch->flags & PHPDBG_WATCH_RECURSIVE) ? " recursively" : ""); if (watch->flags & PHPDBG_WATCH_RECURSIVE) { - phpdbg_delete_watchpoint_recursive(watch, 0 TSRMLS_CC); + phpdbg_delete_watchpoint_recursive(watch, 0); } else { zend_hash_str_del(&PHPDBG_G(watchpoints), watch->str, watch->str_len); } @@ -494,26 +493,26 @@ void phpdbg_watch_HashTable_dtor(zval *zv) { } -int phpdbg_create_var_watchpoint(char *input, size_t len TSRMLS_DC) { - if (phpdbg_rebuild_symtable(TSRMLS_C) == FAILURE) { +int phpdbg_create_var_watchpoint(char *input, size_t len) { + if (phpdbg_rebuild_symtable() == FAILURE) { return FAILURE; } - return phpdbg_watchpoint_parse_symtables(input, len, phpdbg_create_watchpoint TSRMLS_CC); + return phpdbg_watchpoint_parse_symtables(input, len, phpdbg_create_watchpoint); } -int phpdbg_delete_var_watchpoint(char *input, size_t len TSRMLS_DC) { - if (phpdbg_rebuild_symtable(TSRMLS_C) == FAILURE) { +int phpdbg_delete_var_watchpoint(char *input, size_t len) { + if (phpdbg_rebuild_symtable() == FAILURE) { return FAILURE; } - return phpdbg_watchpoint_parse_symtables(input, len, phpdbg_delete_watchpoint TSRMLS_CC); + return phpdbg_watchpoint_parse_symtables(input, len, phpdbg_delete_watchpoint); } #ifdef _WIN32 -int phpdbg_watchpoint_segfault_handler(void *addr TSRMLS_DC) { +int phpdbg_watchpoint_segfault_handler(void *addr) { #else -int phpdbg_watchpoint_segfault_handler(siginfo_t *info, void *context TSRMLS_DC) { +int phpdbg_watchpoint_segfault_handler(siginfo_t *info, void *context) { #endif void *page; phpdbg_watch_memdump *dump; @@ -526,7 +525,7 @@ int phpdbg_watchpoint_segfault_handler(siginfo_t *info, void *context TSRMLS_DC) #else info->si_addr #endif - TSRMLS_CC); + ); if (watch == NULL) { return FAILURE; @@ -549,16 +548,15 @@ int phpdbg_watchpoint_segfault_handler(siginfo_t *info, void *context TSRMLS_DC) return SUCCESS; } -void phpdbg_watchpoints_clean(TSRMLS_D) { +void phpdbg_watchpoints_clean(void) { zend_hash_clean(&PHPDBG_G(watchpoints)); } static void phpdbg_watch_dtor(zval *pDest) { phpdbg_watchpoint_t *watch = (phpdbg_watchpoint_t *) Z_PTR_P(pDest); - TSRMLS_FETCH(); - phpdbg_deactivate_watchpoint(watch TSRMLS_CC); - phpdbg_remove_watchpoint(watch TSRMLS_CC); + phpdbg_deactivate_watchpoint(watch); + phpdbg_remove_watchpoint(watch); efree(watch->str); efree(watch->name_in_parent); @@ -575,7 +573,7 @@ static void phpdbg_watch_mem_dtor(void *llist_data) { free(*(void **) llist_data); } -void phpdbg_setup_watchpoints(TSRMLS_D) { +void phpdbg_setup_watchpoints(void) { #if _SC_PAGE_SIZE phpdbg_pagesize = sysconf(_SC_PAGE_SIZE); #elif _SC_PAGESIZE @@ -593,7 +591,7 @@ void phpdbg_setup_watchpoints(TSRMLS_D) { zend_hash_init(&PHPDBG_G(watch_collisions), 8, NULL, NULL, 0); } -static void phpdbg_print_changed_zval(phpdbg_watch_memdump *dump TSRMLS_DC) { +static void phpdbg_print_changed_zval(phpdbg_watch_memdump *dump) { /* fetch all changes between dump->page and dump->page + dump->size */ phpdbg_btree_position pos = phpdbg_btree_find_between(&PHPDBG_G(watchpoint_tree), (zend_ulong) dump->page, (zend_ulong) dump->page + dump->size); phpdbg_btree_result *result; @@ -631,11 +629,11 @@ static void phpdbg_print_changed_zval(phpdbg_watch_memdump *dump TSRMLS_DC) { } if (curTest != watch->addr.ptr) { - phpdbg_deactivate_watchpoint(watch TSRMLS_CC); - phpdbg_remove_watchpoint(watch TSRMLS_CC); + phpdbg_deactivate_watchpoint(watch); + phpdbg_remove_watchpoint(watch); watch->addr.ptr = curTest; - phpdbg_store_watchpoint(watch TSRMLS_CC); - phpdbg_activate_watchpoint(watch TSRMLS_CC); + phpdbg_store_watchpoint(watch); + phpdbg_activate_watchpoint(watch); reenable = 0; } @@ -680,7 +678,7 @@ static void phpdbg_print_changed_zval(phpdbg_watch_memdump *dump TSRMLS_DC) { } else { phpdbg_out("Old value: "); phpdbg_xml("<watchvalue %r type=\"old\">"); - zend_print_flat_zval_r((zval *) oldPtr TSRMLS_CC); + zend_print_flat_zval_r((zval *) oldPtr); phpdbg_xml("</watchvalue>"); phpdbg_out("\n"); } @@ -694,7 +692,7 @@ static void phpdbg_print_changed_zval(phpdbg_watch_memdump *dump TSRMLS_DC) { reenable = 0; if (Z_REFCOUNTED_P((zval *) oldPtr)) { - phpdbg_remove_watch_collision(Z_COUNTED_P((zval *) oldPtr) TSRMLS_CC); + phpdbg_remove_watch_collision(Z_COUNTED_P((zval *) oldPtr)); } break; } @@ -702,7 +700,7 @@ static void phpdbg_print_changed_zval(phpdbg_watch_memdump *dump TSRMLS_DC) { if (show_value) { phpdbg_out("New value: "); phpdbg_xml("<watchvalue %r type=\"new\">"); - zend_print_flat_zval_r(watch->addr.zv TSRMLS_CC); + zend_print_flat_zval_r(watch->addr.zv); phpdbg_xml("</watchvalue>"); phpdbg_out("\n"); } @@ -710,14 +708,14 @@ static void phpdbg_print_changed_zval(phpdbg_watch_memdump *dump TSRMLS_DC) { /* add new watchpoints if necessary */ if (Z_PTR_P(watch->addr.zv) != Z_PTR_P((zval *) oldPtr)) { if (Z_REFCOUNTED_P((zval *) oldPtr)) { - phpdbg_remove_watch_collision(Z_COUNTED_P((zval *) oldPtr) TSRMLS_CC); + phpdbg_remove_watch_collision(Z_COUNTED_P((zval *) oldPtr)); } if (Z_REFCOUNTED_P(watch->addr.zv)) { if (PHPDBG_G(flags) & PHPDBG_SHOW_REFCOUNTS) { phpdbg_writeln("watchrefcount", "type=\"new\" refcount=\"%d\"", "New refcount: %d", Z_COUNTED_P(watch->addr.zv)->refcount); } if (watch->flags & PHPDBG_WATCH_RECURSIVE) { - phpdbg_create_recursive_watchpoint(watch TSRMLS_CC); + phpdbg_create_recursive_watchpoint(watch); } } } @@ -744,7 +742,7 @@ static void phpdbg_print_changed_zval(phpdbg_watch_memdump *dump TSRMLS_DC) { /* add new watchpoints if necessary */ if (watch->flags & PHPDBG_WATCH_RECURSIVE) { - phpdbg_create_recursive_watchpoint(watch TSRMLS_CC); + phpdbg_create_recursive_watchpoint(watch); } } } @@ -774,7 +772,7 @@ static void phpdbg_print_changed_zval(phpdbg_watch_memdump *dump TSRMLS_DC) { } } -int phpdbg_print_changed_zvals(TSRMLS_D) { +int phpdbg_print_changed_zvals(void) { zend_llist_position pos; phpdbg_watch_memdump **dump; int ret; @@ -786,7 +784,7 @@ int phpdbg_print_changed_zvals(TSRMLS_D) { dump = (phpdbg_watch_memdump **) zend_llist_get_last_ex(&PHPDBG_G(watchlist_mem), &pos); do { - phpdbg_print_changed_zval(*dump TSRMLS_CC); + phpdbg_print_changed_zval(*dump); } while ((dump = (phpdbg_watch_memdump **) zend_llist_get_prev_ex(&PHPDBG_G(watchlist_mem), &pos))); zend_llist_clean(&PHPDBG_G(watchlist_mem)); @@ -797,7 +795,7 @@ int phpdbg_print_changed_zvals(TSRMLS_D) { return ret; } -void phpdbg_list_watchpoints(TSRMLS_D) { +void phpdbg_list_watchpoints(void) { phpdbg_watchpoint_t *watch; phpdbg_xml("<watchlist %r>"); @@ -811,7 +809,6 @@ void phpdbg_list_watchpoints(TSRMLS_D) { void phpdbg_watch_efree(void *ptr) { phpdbg_btree_result *result; - TSRMLS_FETCH(); result = phpdbg_btree_find_closest(&PHPDBG_G(watchpoint_tree), (zend_ulong) ptr); @@ -820,7 +817,7 @@ void phpdbg_watch_efree(void *ptr) { if ((size_t) watch->addr.ptr + watch->size > (size_t) ptr) { if (watch->type == WATCH_ON_ZVAL) { - phpdbg_remove_watch_collision(Z_COUNTED_P(watch->addr.zv) TSRMLS_CC); + phpdbg_remove_watch_collision(Z_COUNTED_P(watch->addr.zv)); } zend_hash_str_del(&PHPDBG_G(watchpoints), watch->str, watch->str_len); } diff --git a/sapi/phpdbg/phpdbg_watch.h b/sapi/phpdbg/phpdbg_watch.h index 35cab10dc1..8bee00261c 100644 --- a/sapi/phpdbg/phpdbg_watch.h +++ b/sapi/phpdbg/phpdbg_watch.h @@ -80,23 +80,23 @@ typedef struct { HashTable watches; } phpdbg_watch_collision; -void phpdbg_setup_watchpoints(TSRMLS_D); +void phpdbg_setup_watchpoints(void); #ifndef _WIN32 -int phpdbg_watchpoint_segfault_handler(siginfo_t *info, void *context TSRMLS_DC); +int phpdbg_watchpoint_segfault_handler(siginfo_t *info, void *context); #else -int phpdbg_watchpoint_segfault_handler(void *addr TSRMLS_DC); +int phpdbg_watchpoint_segfault_handler(void *addr); #endif void phpdbg_create_addr_watchpoint(void *addr, size_t size, phpdbg_watchpoint_t *watch); void phpdbg_create_zval_watchpoint(zval *zv, phpdbg_watchpoint_t *watch); -int phpdbg_delete_var_watchpoint(char *input, size_t len TSRMLS_DC); -int phpdbg_create_var_watchpoint(char *input, size_t len TSRMLS_DC); +int phpdbg_delete_var_watchpoint(char *input, size_t len); +int phpdbg_create_var_watchpoint(char *input, size_t len); -int phpdbg_print_changed_zvals(TSRMLS_D); +int phpdbg_print_changed_zvals(void); -void phpdbg_list_watchpoints(TSRMLS_D); +void phpdbg_list_watchpoints(void); void phpdbg_watch_efree(void *ptr); diff --git a/sapi/phpdbg/phpdbg_webdata_transfer.c b/sapi/phpdbg/phpdbg_webdata_transfer.c index 5ce6759062..258c8cf09f 100644 --- a/sapi/phpdbg/phpdbg_webdata_transfer.c +++ b/sapi/phpdbg/phpdbg_webdata_transfer.c @@ -19,15 +19,15 @@ #include "phpdbg_webdata_transfer.h" #include "ext/standard/php_var.h" -static int phpdbg_is_auto_global(char *name, int len TSRMLS_DC) { +static int phpdbg_is_auto_global(char *name, int len) { int ret; zend_string *str = zend_string_init(name, len, 0); - ret = zend_is_auto_global(str TSRMLS_CC); + ret = zend_is_auto_global(str); efree(str); return ret; } -PHPDBG_API void phpdbg_webdata_compress(char **msg, int *len TSRMLS_DC) { +PHPDBG_API void phpdbg_webdata_compress(char **msg, int *len) { zval array; HashTable *ht; zval zv[9] = {{{0}}}; @@ -37,11 +37,11 @@ PHPDBG_API void phpdbg_webdata_compress(char **msg, int *len TSRMLS_DC) { /* fetch superglobals */ { - phpdbg_is_auto_global(ZEND_STRL("GLOBALS") TSRMLS_CC); + phpdbg_is_auto_global(ZEND_STRL("GLOBALS")); /* might be JIT */ - phpdbg_is_auto_global(ZEND_STRL("_ENV") TSRMLS_CC); - phpdbg_is_auto_global(ZEND_STRL("_SERVER") TSRMLS_CC); - phpdbg_is_auto_global(ZEND_STRL("_REQUEST") TSRMLS_CC); + phpdbg_is_auto_global(ZEND_STRL("_ENV")); + phpdbg_is_auto_global(ZEND_STRL("_SERVER")); + phpdbg_is_auto_global(ZEND_STRL("_REQUEST")); array_init(&zv[1]); zend_hash_copy(Z_ARRVAL(zv[1]), &EG(symbol_table).ht, NULL); Z_ARRVAL(zv[1])->pDestructor = NULL; /* we're operating on a copy! Don't double free zvals */ @@ -165,7 +165,7 @@ PHPDBG_API void phpdbg_webdata_compress(char **msg, int *len TSRMLS_DC) { smart_str buf = {0}; PHP_VAR_SERIALIZE_INIT(var_hash); - php_var_serialize(&buf, &array, &var_hash TSRMLS_CC); + php_var_serialize(&buf, &array, &var_hash); PHP_VAR_SERIALIZE_DESTROY(var_hash); *msg = buf.s->val; *len = buf.s->len; diff --git a/sapi/phpdbg/phpdbg_webdata_transfer.h b/sapi/phpdbg/phpdbg_webdata_transfer.h index d70175ad99..f4edae9b3f 100644 --- a/sapi/phpdbg/phpdbg_webdata_transfer.h +++ b/sapi/phpdbg/phpdbg_webdata_transfer.h @@ -22,6 +22,6 @@ #include "zend.h" #include "phpdbg.h" -PHPDBG_API void phpdbg_webdata_compress(char **msg, int *len TSRMLS_DC); +PHPDBG_API void phpdbg_webdata_compress(char **msg, int *len); #endif /* PHPDBG_WEBDATA_TRANSFER_H */ diff --git a/sapi/phpdbg/phpdbg_win.c b/sapi/phpdbg/phpdbg_win.c index b0cbdf267a..5ad99cb0ef 100644 --- a/sapi/phpdbg/phpdbg_win.c +++ b/sapi/phpdbg/phpdbg_win.c @@ -31,9 +31,8 @@ int phpdbg_exception_handler_win32(EXCEPTION_POINTERS *xp) { CONTEXT *xc = xp->ContextRecord; if(xr->ExceptionCode == EXCEPTION_ACCESS_VIOLATION) { - TSRMLS_FETCH(); - - if (phpdbg_watchpoint_segfault_handler((void *)xr->ExceptionInformation[1] TSRMLS_CC) == SUCCESS) { + + if (phpdbg_watchpoint_segfault_handler((void *)xr->ExceptionInformation[1]) == SUCCESS) { return EXCEPTION_CONTINUE_EXECUTION; } } |