From 09e6ef3986c2dabbe965a44b89e785839468fd16 Mon Sep 17 00:00:00 2001 From: Bob Weinand Date: Mon, 23 Dec 2013 23:55:07 +0100 Subject: Fixed credits in phpdbg.* files --- sapi/phpdbg/phpdbg.c | 1 + 1 file changed, 1 insertion(+) (limited to 'sapi/phpdbg/phpdbg.c') diff --git a/sapi/phpdbg/phpdbg.c b/sapi/phpdbg/phpdbg.c index 17193ed244..71208d22f7 100644 --- a/sapi/phpdbg/phpdbg.c +++ b/sapi/phpdbg/phpdbg.c @@ -14,6 +14,7 @@ +----------------------------------------------------------------------+ | Authors: Felipe Pena | | Authors: Joe Watkins | + | Authors: Bob Weinand | +----------------------------------------------------------------------+ */ -- cgit v1.2.1 From 62f0ffb34e89d3e1a6b3b3e6af73ef66eade67e8 Mon Sep 17 00:00:00 2001 From: Bob Weinand Date: Sat, 21 Dec 2013 22:42:11 +0100 Subject: Added breaking upon fatal-ish error --- sapi/phpdbg/phpdbg.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'sapi/phpdbg/phpdbg.c') diff --git a/sapi/phpdbg/phpdbg.c b/sapi/phpdbg/phpdbg.c index 71208d22f7..a0665a7ee5 100644 --- a/sapi/phpdbg/phpdbg.c +++ b/sapi/phpdbg/phpdbg.c @@ -439,6 +439,35 @@ static void php_sapi_phpdbg_log_message(char *message TSRMLS_DC) /* {{{ */ */ if (phpdbg_booted) { phpdbg_error("%s", message); + + switch (PG(last_error_type)) { + case E_ERROR: + case E_CORE_ERROR: + case E_COMPILE_ERROR: + case E_USER_ERROR: + case E_PARSE: + case E_RECOVERABLE_ERROR: + if (!(PHPDBG_G(flags) & PHPDBG_IN_EVAL)) { + phpdbg_list_file( + zend_get_executed_filename(TSRMLS_C), + 3, + zend_get_executed_lineno(TSRMLS_C)-1, + zend_get_executed_lineno(TSRMLS_C) + TSRMLS_CC + ); + } + + do { + switch (phpdbg_interactive(TSRMLS_C)) { + case PHPDBG_LEAVE: + case PHPDBG_FINISH: + case PHPDBG_UNTIL: + case PHPDBG_NEXT: + return; + } + } while (!(PHPDBG_G(flags) & PHPDBG_IS_QUITTING)); + + } } else fprintf(stdout, "%s\n", message); } /* }}} */ -- cgit v1.2.1 From 5ae8f624a1cb3929b567cc47c634297b1a3e7915 Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Tue, 24 Dec 2013 02:37:12 -0800 Subject: basic fixes to sapi/phpdbg --- sapi/phpdbg/phpdbg.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'sapi/phpdbg/phpdbg.c') diff --git a/sapi/phpdbg/phpdbg.c b/sapi/phpdbg/phpdbg.c index a0665a7ee5..f7580359fe 100644 --- a/sapi/phpdbg/phpdbg.c +++ b/sapi/phpdbg/phpdbg.c @@ -85,14 +85,14 @@ static PHP_MINIT_FUNCTION(phpdbg) /* {{{ */ REGISTER_STRINGL_CONSTANT("PHPDBG_VERSION", PHPDBG_VERSION, sizeof(PHPDBG_VERSION)-1, CONST_CS|CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("PHPDBG_FILE", FILE_PARAM, CONST_CS|CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("PHPDBG_METHOD", METHOD_PARAM, CONST_CS|CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("PHPDBG_LINENO", NUMERIC_PARAM, CONST_CS|CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("PHPDBG_FUNC", STR_PARAM, CONST_CS|CONST_PERSISTENT); + REGISTER_INT_CONSTANT("PHPDBG_FILE", FILE_PARAM, CONST_CS|CONST_PERSISTENT); + REGISTER_INT_CONSTANT("PHPDBG_METHOD", METHOD_PARAM, CONST_CS|CONST_PERSISTENT); + REGISTER_INT_CONSTANT("PHPDBG_LINENO", NUMERIC_PARAM, CONST_CS|CONST_PERSISTENT); + REGISTER_INT_CONSTANT("PHPDBG_FUNC", STR_PARAM, CONST_CS|CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("PHPDBG_COLOR_PROMPT", PHPDBG_COLOR_PROMPT, CONST_CS|CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("PHPDBG_COLOR_NOTICE", PHPDBG_COLOR_NOTICE, CONST_CS|CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("PHPDBG_COLOR_ERROR", PHPDBG_COLOR_ERROR, CONST_CS|CONST_PERSISTENT); + REGISTER_INT_CONSTANT("PHPDBG_COLOR_PROMPT", PHPDBG_COLOR_PROMPT, CONST_CS|CONST_PERSISTENT); + REGISTER_INT_CONSTANT("PHPDBG_COLOR_NOTICE", PHPDBG_COLOR_NOTICE, CONST_CS|CONST_PERSISTENT); + REGISTER_INT_CONSTANT("PHPDBG_COLOR_ERROR", PHPDBG_COLOR_ERROR, CONST_CS|CONST_PERSISTENT); return SUCCESS; } /* }}} */ @@ -485,7 +485,7 @@ static int php_sapi_phpdbg_deactivate(TSRMLS_D) /* {{{ */ static void php_sapi_phpdbg_register_vars(zval *track_vars_array TSRMLS_DC) /* {{{ */ { - unsigned int len; + php_size_t len; char *docroot = ""; /* In phpdbg mode, we consider the environment to be a part of the server variables @@ -526,7 +526,7 @@ static void php_sapi_phpdbg_register_vars(zval *track_vars_array TSRMLS_DC) /* { } /* }}} */ -static inline int php_sapi_phpdbg_ub_write(const char *message, unsigned int length TSRMLS_DC) /* {{{ */ +static inline php_size_t php_sapi_phpdbg_ub_write(const char *message, php_size_t length TSRMLS_DC) /* {{{ */ { return phpdbg_write("%s", message); } /* }}} */ -- cgit v1.2.1 From 0493099786b6135f1fe2f5de763f1edc61428303 Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Tue, 24 Dec 2013 21:59:44 +0100 Subject: next wave on fixes for ext/phpdbg --- sapi/phpdbg/phpdbg.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'sapi/phpdbg/phpdbg.c') diff --git a/sapi/phpdbg/phpdbg.c b/sapi/phpdbg/phpdbg.c index f7580359fe..05cbf5b2c0 100644 --- a/sapi/phpdbg/phpdbg.c +++ b/sapi/phpdbg/phpdbg.c @@ -223,7 +223,7 @@ static PHP_FUNCTION(phpdbg_exec) } { - struct stat sb; + zend_stat_t sb; zend_bool result = 1; if (VCWD_STAT(exec, &sb) != FAILURE) { @@ -293,7 +293,7 @@ static PHP_FUNCTION(phpdbg_break) phpdbg_clear_param(¶m TSRMLS_CC); } else if (EG(current_execute_data) && EG(active_op_array)) { - zend_ulong opline_num = (EG(current_execute_data)->opline - + php_uint_t opline_num = (EG(current_execute_data)->opline - EG(active_op_array)->opcodes); phpdbg_set_breakpoint_opline_ex( @@ -808,9 +808,9 @@ int main(int argc, char **argv) /* {{{ */ sapi_module_struct *phpdbg = &phpdbg_sapi_module; char *sapi_name; char *ini_entries; - int ini_entries_len; + php_size_t ini_entries_len; char **zend_extensions = NULL; - zend_ulong zend_extensions_len = 0L; + php_uint_t zend_extensions_len = 0L; zend_bool ini_ignore; char *ini_override; char *exec; @@ -823,7 +823,7 @@ int main(int argc, char **argv) /* {{{ */ zend_ulong flags; char *php_optarg; int php_optind, opt, show_banner = 1; - long cleaning = 0; + php_int_t cleaning = 0; zend_bool remote = 0; int run = 0; int step = 0; @@ -910,7 +910,7 @@ phpdbg_main: ini_override = strdup(php_optarg); break; case 'd': { - int len = strlen(php_optarg); + size_t len = strlen(php_optarg); char *val; if ((val = strchr(php_optarg, '='))) { -- cgit v1.2.1 From 63d3f0b844b3a5f1c94be3c97bca29235dc2b3fc Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Tue, 19 Aug 2014 08:07:31 +0200 Subject: basic macro replacements, all at once --- sapi/phpdbg/phpdbg.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'sapi/phpdbg/phpdbg.c') diff --git a/sapi/phpdbg/phpdbg.c b/sapi/phpdbg/phpdbg.c index 1fbd18a423..aaed7a3a88 100644 --- a/sapi/phpdbg/phpdbg.c +++ b/sapi/phpdbg/phpdbg.c @@ -87,14 +87,14 @@ static PHP_MINIT_FUNCTION(phpdbg) /* {{{ */ REGISTER_STRINGL_CONSTANT("PHPDBG_VERSION", PHPDBG_VERSION, sizeof(PHPDBG_VERSION)-1, CONST_CS|CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("PHPDBG_FILE", FILE_PARAM, CONST_CS|CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("PHPDBG_METHOD", METHOD_PARAM, CONST_CS|CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("PHPDBG_LINENO", NUMERIC_PARAM, CONST_CS|CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("PHPDBG_FUNC", STR_PARAM, CONST_CS|CONST_PERSISTENT); - - REGISTER_LONG_CONSTANT("PHPDBG_COLOR_PROMPT", PHPDBG_COLOR_PROMPT, CONST_CS|CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("PHPDBG_COLOR_NOTICE", PHPDBG_COLOR_NOTICE, CONST_CS|CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("PHPDBG_COLOR_ERROR", PHPDBG_COLOR_ERROR, CONST_CS|CONST_PERSISTENT); + REGISTER_INT_CONSTANT("PHPDBG_FILE", FILE_PARAM, CONST_CS|CONST_PERSISTENT); + REGISTER_INT_CONSTANT("PHPDBG_METHOD", METHOD_PARAM, CONST_CS|CONST_PERSISTENT); + REGISTER_INT_CONSTANT("PHPDBG_LINENO", NUMERIC_PARAM, CONST_CS|CONST_PERSISTENT); + REGISTER_INT_CONSTANT("PHPDBG_FUNC", STR_PARAM, CONST_CS|CONST_PERSISTENT); + + REGISTER_INT_CONSTANT("PHPDBG_COLOR_PROMPT", PHPDBG_COLOR_PROMPT, CONST_CS|CONST_PERSISTENT); + REGISTER_INT_CONSTANT("PHPDBG_COLOR_NOTICE", PHPDBG_COLOR_NOTICE, CONST_CS|CONST_PERSISTENT); + REGISTER_INT_CONSTANT("PHPDBG_COLOR_ERROR", PHPDBG_COLOR_ERROR, CONST_CS|CONST_PERSISTENT); return SUCCESS; } /* }}} */ -- cgit v1.2.1 From c3e3c98ec666812daaaca896cf5ef758a8a6df14 Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Mon, 25 Aug 2014 19:24:55 +0200 Subject: master renames phase 1 --- sapi/phpdbg/phpdbg.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'sapi/phpdbg/phpdbg.c') diff --git a/sapi/phpdbg/phpdbg.c b/sapi/phpdbg/phpdbg.c index aaed7a3a88..1fbd18a423 100644 --- a/sapi/phpdbg/phpdbg.c +++ b/sapi/phpdbg/phpdbg.c @@ -87,14 +87,14 @@ static PHP_MINIT_FUNCTION(phpdbg) /* {{{ */ REGISTER_STRINGL_CONSTANT("PHPDBG_VERSION", PHPDBG_VERSION, sizeof(PHPDBG_VERSION)-1, CONST_CS|CONST_PERSISTENT); - REGISTER_INT_CONSTANT("PHPDBG_FILE", FILE_PARAM, CONST_CS|CONST_PERSISTENT); - REGISTER_INT_CONSTANT("PHPDBG_METHOD", METHOD_PARAM, CONST_CS|CONST_PERSISTENT); - REGISTER_INT_CONSTANT("PHPDBG_LINENO", NUMERIC_PARAM, CONST_CS|CONST_PERSISTENT); - REGISTER_INT_CONSTANT("PHPDBG_FUNC", STR_PARAM, CONST_CS|CONST_PERSISTENT); - - REGISTER_INT_CONSTANT("PHPDBG_COLOR_PROMPT", PHPDBG_COLOR_PROMPT, CONST_CS|CONST_PERSISTENT); - REGISTER_INT_CONSTANT("PHPDBG_COLOR_NOTICE", PHPDBG_COLOR_NOTICE, CONST_CS|CONST_PERSISTENT); - REGISTER_INT_CONSTANT("PHPDBG_COLOR_ERROR", PHPDBG_COLOR_ERROR, CONST_CS|CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("PHPDBG_FILE", FILE_PARAM, CONST_CS|CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("PHPDBG_METHOD", METHOD_PARAM, CONST_CS|CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("PHPDBG_LINENO", NUMERIC_PARAM, CONST_CS|CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("PHPDBG_FUNC", STR_PARAM, CONST_CS|CONST_PERSISTENT); + + REGISTER_LONG_CONSTANT("PHPDBG_COLOR_PROMPT", PHPDBG_COLOR_PROMPT, CONST_CS|CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("PHPDBG_COLOR_NOTICE", PHPDBG_COLOR_NOTICE, CONST_CS|CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("PHPDBG_COLOR_ERROR", PHPDBG_COLOR_ERROR, CONST_CS|CONST_PERSISTENT); return SUCCESS; } /* }}} */ -- cgit v1.2.1 From 3234480827b27ff5d3469a732167afd289632a96 Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Wed, 27 Aug 2014 15:31:48 +0200 Subject: first show to make 's' work with size_t --- sapi/phpdbg/phpdbg.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sapi/phpdbg/phpdbg.c') diff --git a/sapi/phpdbg/phpdbg.c b/sapi/phpdbg/phpdbg.c index 1fbd18a423..6fe06a9f65 100644 --- a/sapi/phpdbg/phpdbg.c +++ b/sapi/phpdbg/phpdbg.c @@ -308,7 +308,7 @@ static PHP_FUNCTION(phpdbg_color) { long element = 0L; char *color = NULL; - int color_len = 0; + size_t color_len = 0; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ls", &element, &color, &color_len) == FAILURE) { return; @@ -329,7 +329,7 @@ static PHP_FUNCTION(phpdbg_color) static PHP_FUNCTION(phpdbg_prompt) { char *prompt = NULL; - int prompt_len = 0; + size_t prompt_len = 0; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &prompt, &prompt_len) == FAILURE) { return; -- cgit v1.2.1