com php-src: basic fixes to sapi/phpdbg: sapi/phpdbg/phpdbg.c sapi/phpdbg/phpdbg_bp.c sapi/phpdbg/phpdbg_frame.c sapi/phpdbg/phpdbg_help.c
sapi/phpdbg/phpdbg_info.c sapi/phpdbg/phpdbg_prompt.c

From: Date: Tue, 24 Dec 2013 10:44:53 +0000
Subject: com php-src: basic fixes to sapi/phpdbg: sapi/phpdbg/phpdbg.c sapi/phpdbg/phpdbg_bp.c sapi/phpdbg/phpdbg_frame.c sapi/phpdbg/phpdbg_help.c
sapi/phpdbg/phpdbg_info.c sapi/phpdbg/phpdbg_prompt.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-75447@lists.php.net to get a copy of this message
Commit: 5ae8f624a1cb3929b567cc47c634297b1a3e7915 Author: Anatol Belski <ab@php.net> Tue, 24 Dec 2013 02:37:12 -0800 Parents: 713b69adf8376d44a21021c13e2cae27740b9b26 Branches: str_size_and_int64 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=5ae8f624a1cb3929b567cc47c634297b1a3e7915 Log: basic fixes to sapi/phpdbg Changed paths: M sapi/phpdbg/phpdbg.c M sapi/phpdbg/phpdbg_bp.c M sapi/phpdbg/phpdbg_frame.c M sapi/phpdbg/phpdbg_help.c M sapi/phpdbg/phpdbg_info.c M sapi/phpdbg/phpdbg_prompt.c

diff --git a/sapi/phpdbg/phpdbg.c b/sapi/phpdbg/phpdbg.c index a0665a7..f758035 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); } /* }}} */ diff --git a/sapi/phpdbg/phpdbg_bp.c b/sapi/phpdbg/phpdbg_bp.c index 69e0fa7..0c1955c 100644 --- a/sapi/phpdbg/phpdbg_bp.c +++ b/sapi/phpdbg/phpdbg_bp.c @@ -114,7 +114,7 @@ PHPDBG_API void phpdbg_export_breakpoints(FILE *handle TSRMLS_DC) /* {{{ */ { HashPosition position[2]; HashTable **table = NULL; - zend_ulong id = 0L; + php_uint_t id = Z_I(0); if (zend_hash_num_elements(&PHPDBG_G(bp)[PHPDBG_BREAK_MAP])) { phpdbg_notice( @@ -715,12 +715,12 @@ static inline void phpdbg_create_conditional_break(phpdbg_breakcond_t *brake, co new_break.code = estrndup(expr, expr_len); new_break.code_len = expr_len; - Z_STRLEN(pv) = expr_len + sizeof("return ;") - 1; - Z_STRVAL(pv) = emalloc(Z_STRLEN(pv) + 1); + Z_STRSIZE(pv) = expr_len + sizeof("return ;") - 1; + Z_STRVAL(pv) = emalloc(Z_STRSIZE(pv) + 1); memcpy(Z_STRVAL(pv), "return ", sizeof("return ") - 1); memcpy(Z_STRVAL(pv) + sizeof("return ") - 1, expr, expr_len); - Z_STRVAL(pv)[Z_STRLEN(pv) - 1] = ';'; - Z_STRVAL(pv)[Z_STRLEN(pv)] = '\0'; + Z_STRVAL(pv)[Z_STRSIZE(pv) - 1] = ';'; + Z_STRVAL(pv)[Z_STRSIZE(pv)] = '\0'; Z_TYPE(pv) = IS_STRING; new_break.ops = zend_compile_string( @@ -1116,8 +1116,8 @@ PHPDBG_API void phpdbg_delete_breakpoint(zend_ulong num TSRMLS_DC) /* {{{ */ if ((brake = phpdbg_find_breakbase_ex(num, &table, &position TSRMLS_CC))) { char *key; - zend_uint klen; - zend_ulong idx; + php_size_t klen; + php_uint_t idx; int type = brake->type; char *name = NULL; size_t name_len = 0L; @@ -1394,8 +1394,8 @@ PHPDBG_API void phpdbg_print_breakpoints(zend_ulong type TSRMLS_DC) /* {{{ */ HashPosition position[2]; HashTable *class_table; char *class_name = NULL; - zend_uint class_len = 0; - zend_ulong class_idx = 0L; + php_size_t class_len = 0; + php_uint_t class_idx = 0L; phpdbg_writeln(SEPARATE); phpdbg_writeln("Method Breakpoints:"); @@ -1473,8 +1473,8 @@ PHPDBG_API void phpdbg_print_breakpoints(zend_ulong type TSRMLS_DC) /* {{{ */ HashPosition position[3]; HashTable *class_table, *method_table; char *class_name = NULL, *method_name = NULL; - zend_uint class_len = 0, method_len = 0; - zend_ulong class_idx = 0L, method_idx = 0L; + php_size_t class_len = 0, method_len = 0; + php_uint_t class_idx = Z_I(0), method_idx = Z_I(0); phpdbg_writeln(SEPARATE); phpdbg_writeln("Method opline Breakpoints:"); @@ -1512,8 +1512,8 @@ PHPDBG_API void phpdbg_print_breakpoints(zend_ulong type TSRMLS_DC) /* {{{ */ HashPosition position[2]; HashTable *function_table; char *function_name = NULL; - zend_uint function_len = 0; - zend_ulong function_idx = 0L; + php_size_t function_len = 0; + php_uint_t function_idx = 0L; phpdbg_writeln(SEPARATE); phpdbg_writeln("Function opline Breakpoints:"); @@ -1542,8 +1542,8 @@ PHPDBG_API void phpdbg_print_breakpoints(zend_ulong type TSRMLS_DC) /* {{{ */ HashPosition position[2]; HashTable *file_table; char *file_name = NULL; - zend_uint file_len = 0; - zend_ulong file_idx = 0L; + php_size_t file_len = 0; + php_uint_t file_idx = 0L; phpdbg_writeln(SEPARATE); phpdbg_writeln("File opline Breakpoints:"); diff --git a/sapi/phpdbg/phpdbg_frame.c b/sapi/phpdbg/phpdbg_frame.c index 24aff59..272b30f 100644 --- a/sapi/phpdbg/phpdbg_frame.c +++ b/sapi/phpdbg/phpdbg_frame.c @@ -114,7 +114,7 @@ static void phpdbg_dump_prototype(zval **tmp TSRMLS_DC) /* {{{ */ (void **)&class); } else { zend_get_object_classname(*class, (const char **)&Z_STRVAL_PP(class), - (zend_uint *)&Z_STRLEN_PP(class) TSRMLS_CC); + &Z_STRSIZE_PP(class) TSRMLS_CC); } if (is_class == SUCCESS) { @@ -186,14 +186,14 @@ void phpdbg_dump_backtrace(size_t num TSRMLS_DC) /* {{{ */ if (zend_hash_get_current_data_ex(Z_ARRVAL(zbacktrace), (void**)&tmp, &position) == FAILURE) { - phpdbg_write("frame #0: {main} at %s:%ld", Z_STRVAL_PP(file), Z_LVAL_PP(line)); + phpdbg_write("frame #0: {main} at %s:%ld", Z_STRVAL_PP(file), Z_IVAL_PP(line)); break; } if (user_defined == SUCCESS) { phpdbg_write("frame #%d: ", i++); phpdbg_dump_prototype(tmp TSRMLS_CC); - phpdbg_writeln(" at %s:%ld", Z_STRVAL_PP(file), Z_LVAL_PP(line)); + phpdbg_writeln(" at %s:%ld", Z_STRVAL_PP(file), Z_IVAL_PP(line)); } else { phpdbg_write(" => "); phpdbg_dump_prototype(tmp TSRMLS_CC); diff --git a/sapi/phpdbg/phpdbg_help.c b/sapi/phpdbg/phpdbg_help.c index edb1265..53aaccc 100644 --- a/sapi/phpdbg/phpdbg_help.c +++ b/sapi/phpdbg/phpdbg_help.c @@ -519,9 +519,9 @@ PHPDBG_HELP(register) /* {{{ */ if (zend_hash_num_elements(&PHPDBG_G(registered))) { HashPosition position; char *name = NULL; - zend_uint name_len = 0; + php_size_t name_len = 0; - phpdbg_notice("Registered Functions (%d)", zend_hash_num_elements(&PHPDBG_G(registered))); + phpdbg_notice("Registered Functions (%pd)", zend_hash_num_elements(&PHPDBG_G(registered))); for (zend_hash_internal_pointer_reset_ex(&PHPDBG_G(registered), &position); zend_hash_get_current_key_ex(&PHPDBG_G(registered), &name, &name_len, NULL, 1, &position) == HASH_KEY_IS_STRING; zend_hash_move_forward_ex(&PHPDBG_G(registered), &position)) { diff --git a/sapi/phpdbg/phpdbg_info.c b/sapi/phpdbg/phpdbg_info.c index 1744f59..f81aae4 100644 --- a/sapi/phpdbg/phpdbg_info.c +++ b/sapi/phpdbg/phpdbg_info.c @@ -143,7 +143,7 @@ PHPDBG_INFO(vars) /* {{{ */ switch (Z_TYPE_PP(data)) { case IS_STRING: phpdbg_write("(string)\t"); break; - case IS_LONG: phpdbg_write("(integer)\t"); break; + case IS_INT: phpdbg_write("(integer)\t"); break; case IS_DOUBLE: phpdbg_write("(float)\t"); break; case IS_RESOURCE: phpdbg_write("(resource)\t"); break; case IS_ARRAY: phpdbg_write("(array)\t"); break; diff --git a/sapi/phpdbg/phpdbg_prompt.c b/sapi/phpdbg/phpdbg_prompt.c index f2f482b..394596c 100644 --- a/sapi/phpdbg/phpdbg_prompt.c +++ b/sapi/phpdbg/phpdbg_prompt.c @@ -1261,7 +1261,7 @@ zend_vm_enter: zend_hash_clean( &PHPDBG_G(seek)); phpdbg_notice( - "Breaking for leave at %s:%u", + "Breaking for leave at %s:%pu", zend_get_executed_filename(TSRMLS_C), zend_get_executed_lineno(TSRMLS_C) );
« previous php.cvs (#75447) next »