summaryrefslogtreecommitdiff
path: root/sapi/phpdbg/phpdbg_print.c
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2015-06-30 13:59:27 +0300
committerDmitry Stogov <dmitry@zend.com>2015-06-30 13:59:27 +0300
commit7aa7627172c11979ec45c2db85f99182812ee59d (patch)
tree90762a1d26b47213a9edd7016a9c45110156e24e /sapi/phpdbg/phpdbg_print.c
parentd554d64f649a915b4ecb3a1de409cfc8ff0e9133 (diff)
downloadphp-git-7aa7627172c11979ec45c2db85f99182812ee59d.tar.gz
Use ZSTR_ API to access zend_string elements (this is just renaming without semantick changes).
Diffstat (limited to 'sapi/phpdbg/phpdbg_print.c')
-rw-r--r--sapi/phpdbg/phpdbg_print.c38
1 files changed, 19 insertions, 19 deletions
diff --git a/sapi/phpdbg/phpdbg_print.c b/sapi/phpdbg/phpdbg_print.c
index 4013c0fd88..70b8c2f807 100644
--- a/sapi/phpdbg/phpdbg_print.c
+++ b/sapi/phpdbg/phpdbg_print.c
@@ -66,17 +66,17 @@ static inline void phpdbg_print_function_helper(zend_function *method) /* {{{ */
phpdbg_writeln("printoplineinfo", "type=\"User\" startline=\"%d\" endline=\"%d\" method=\"%s::%s\" file=\"%s\" opline=\"%p\"", "L%d-%d %s::%s() %s - %p + %d ops",
op_array->line_start,
op_array->line_end,
- method->common.scope->name->val,
- method->common.function_name->val,
- op_array->filename ? op_array->filename->val : "unknown",
+ ZSTR_VAL(method->common.scope->name),
+ ZSTR_VAL(method->common.function_name),
+ op_array->filename ? ZSTR_VAL(op_array->filename) : "unknown",
opline,
op_array->last);
} else {
phpdbg_writeln("printoplineinfo", "type=\"User\" startline=\"%d\" endline=\"%d\" function=\"%s\" file=\"%s\" opline=\"%p\"", "L%d-%d %s() %s - %p + %d ops",
op_array->line_start,
op_array->line_end,
- method->common.function_name ? method->common.function_name->val : "{main}",
- op_array->filename ? op_array->filename->val : "unknown",
+ method->common.function_name ? ZSTR_VAL(method->common.function_name) : "{main}",
+ op_array->filename ? ZSTR_VAL(op_array->filename) : "unknown",
opline,
op_array->last);
}
@@ -102,9 +102,9 @@ static inline void phpdbg_print_function_helper(zend_function *method) /* {{{ */
default: {
if (method->common.scope) {
- phpdbg_writeln("printoplineinfo", "type=\"Internal\" method=\"%s::%s\"", "\tInternal %s::%s()", method->common.scope->name->val, method->common.function_name->val);
+ phpdbg_writeln("printoplineinfo", "type=\"Internal\" method=\"%s::%s\"", "\tInternal %s::%s()", ZSTR_VAL(method->common.scope->name), ZSTR_VAL(method->common.function_name));
} else {
- phpdbg_writeln("printoplineinfo", "type=\"Internal\" function=\"%s\"", "\tInternal %s()", method->common.function_name->val);
+ phpdbg_writeln("printoplineinfo", "type=\"Internal\" function=\"%s\"", "\tInternal %s()", ZSTR_VAL(method->common.function_name));
}
}
}
@@ -135,13 +135,13 @@ PHPDBG_PRINT(stack) /* {{{ */
zend_op_array *ops = &EG(current_execute_data)->func->op_array;
if (ops->function_name) {
if (ops->scope) {
- phpdbg_notice("printinfo", "method=\"%s::%s\" num=\"%d\"", "Stack in %s::%s() (%d ops)", ops->scope->name->val, ops->function_name->val, ops->last);
+ phpdbg_notice("printinfo", "method=\"%s::%s\" num=\"%d\"", "Stack in %s::%s() (%d ops)", ZSTR_VAL(ops->scope->name), ZSTR_VAL(ops->function_name), ops->last);
} else {
- phpdbg_notice("printinfo", "function=\"%s\" num=\"%d\"", "Stack in %s() (%d ops)", ops->function_name->val, ops->last);
+ phpdbg_notice("printinfo", "function=\"%s\" num=\"%d\"", "Stack in %s() (%d ops)", ZSTR_VAL(ops->function_name), ops->last);
}
} else {
if (ops->filename) {
- phpdbg_notice("printinfo", "file=\"%s\" num=\"%d\"", "Stack in %s (%d ops)", ops->filename->val, ops->last);
+ phpdbg_notice("printinfo", "file=\"%s\" num=\"%d\"", "Stack in %s (%d ops)", ZSTR_VAL(ops->filename), ops->last);
} else {
phpdbg_notice("printinfo", "opline=\"%p\" num=\"%d\"", "Stack @ %p (%d ops)", ops, ops->last);
}
@@ -167,7 +167,7 @@ PHPDBG_PRINT(class) /* {{{ */
(ce->ce_flags & ZEND_ACC_ABSTRACT) ?
"Abstract Class" :
"Class",
- ce->name->val,
+ ZSTR_VAL(ce->name),
zend_hash_num_elements(&ce->function_table));
phpdbg_xml("<printmethods %r>");
@@ -195,12 +195,12 @@ PHPDBG_PRINT(method) /* {{{ */
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);
+ zend_str_tolower_copy(ZSTR_VAL(lcname), param->method.name, ZSTR_LEN(lcname));
if ((fbc = zend_hash_find_ptr(&ce->function_table, lcname))) {
phpdbg_notice("printinfo", "type=\"%s\" flags=\"Method\" symbol=\"%s\" num=\"%d\"", "%s Method %s (%d ops)",
(fbc->type == ZEND_USER_FUNCTION) ? "User" : "Internal",
- fbc->common.function_name->val,
+ ZSTR_VAL(fbc->common.function_name),
(fbc->type == ZEND_USER_FUNCTION) ? fbc->op_array.last : 0);
phpdbg_print_function_helper(fbc);
@@ -242,14 +242,14 @@ PHPDBG_PRINT(func) /* {{{ */
}
lcname = zend_string_alloc(func_name_len, 0);
- zend_str_tolower_copy(lcname->val, func_name, lcname->len);
+ zend_str_tolower_copy(ZSTR_VAL(lcname), func_name, ZSTR_LEN(lcname));
phpdbg_try_access {
if ((fbc = zend_hash_find_ptr(func_table, lcname))) {
phpdbg_notice("printinfo", "type=\"%s\" flags=\"%s\" symbol=\"%s\" num=\"%d\"", "%s %s %s (%d ops)",
(fbc->type == ZEND_USER_FUNCTION) ? "User" : "Internal",
(fbc->common.scope) ? "Method" : "Function",
- fbc->common.function_name->val,
+ ZSTR_VAL(fbc->common.function_name),
(fbc->type == ZEND_USER_FUNCTION) ? fbc->op_array.last : 0);
phpdbg_print_function_helper(fbc);
@@ -320,7 +320,7 @@ void phpdbg_print_opcodes_class(const char *class) {
(ce->ce_flags & ZEND_ACC_ABSTRACT) ?
"abstract Class" :
"class",
- ce->name->val);
+ ZSTR_VAL(ce->name));
if (ce->type != ZEND_USER_CLASS) {
return;
@@ -333,7 +333,7 @@ void phpdbg_print_opcodes_class(const char *class) {
} else {
phpdbg_out(", ");
}
- phpdbg_out("%s", method->common.function_name->val);
+ phpdbg_out("%s", ZSTR_VAL(method->common.function_name));
} ZEND_HASH_FOREACH_END();
if (first) {
phpdbg_out("-");
@@ -364,14 +364,14 @@ PHPDBG_API void phpdbg_print_opcodes(char *function)
ZEND_HASH_FOREACH_STR_KEY_PTR(EG(function_table), name, func) {
if (func->type == ZEND_USER_FUNCTION) {
phpdbg_out("\n");
- phpdbg_print_opcodes_function(name->val, name->len);
+ phpdbg_print_opcodes_function(ZSTR_VAL(name), ZSTR_LEN(name));
}
} ZEND_HASH_FOREACH_END();
ZEND_HASH_FOREACH_STR_KEY_PTR(EG(class_table), name, ce) {
if (ce->type == ZEND_USER_CLASS) {
phpdbg_out("\n\n");
- phpdbg_print_opcodes_class(name->val);
+ phpdbg_print_opcodes_class(ZSTR_VAL(name));
}
} ZEND_HASH_FOREACH_END();
} else if ((method_name = strtok(NULL, ":")) == NULL) {