summaryrefslogtreecommitdiff
path: root/sapi/phpdbg/phpdbg_opcode.c
diff options
context:
space:
mode:
authorBob Weinand <bobwei9@hotmail.com>2015-04-20 20:58:52 +0200
committerBob Weinand <bobwei9@hotmail.com>2015-04-20 20:59:13 +0200
commit5f10e84208c259a55db96789e9cbdf7e6af596a2 (patch)
treed82935cc83b81b6bb6c062a7010991b99e2bfa3f /sapi/phpdbg/phpdbg_opcode.c
parent0381c1b79e9491e68c9ca85a21e0a5bd68f3840f (diff)
downloadphp-git-5f10e84208c259a55db96789e9cbdf7e6af596a2.tar.gz
Shrink phpdbg opcode dump output a bit more
Diffstat (limited to 'sapi/phpdbg/phpdbg_opcode.c')
-rw-r--r--sapi/phpdbg/phpdbg_opcode.c21
1 files changed, 4 insertions, 17 deletions
diff --git a/sapi/phpdbg/phpdbg_opcode.c b/sapi/phpdbg/phpdbg_opcode.c
index 9622fd661b..654bd6288f 100644
--- a/sapi/phpdbg/phpdbg_opcode.c
+++ b/sapi/phpdbg/phpdbg_opcode.c
@@ -27,28 +27,15 @@
ZEND_EXTERN_MODULE_GLOBALS(phpdbg);
-static inline uint32_t phpdbg_decode_literal(zend_op_array *ops, zval *literal) /* {{{ */
-{
- int iter = 0;
-
- while (iter < ops->last_literal) {
- if (literal == &ops->literals[iter]) {
- return iter;
- }
- iter++;
- }
-
- return 0;
-} /* }}} */
-
static inline char *phpdbg_decode_op(zend_op_array *ops, znode_op *op, uint32_t type, HashTable *vars) /* {{{ */
{
char *decode = NULL;
switch (type &~ EXT_TYPE_UNUSED) {
- case IS_CV:
- asprintf(&decode, "$%s", ops->vars[EX_VAR_TO_NUM(op->var)]->val);
- break;
+ case IS_CV: {
+ zend_string *var = ops->vars[EX_VAR_TO_NUM(op->var)];
+ asprintf(&decode, "$%.*s%c", var->len <= 19 ? (int) var->len : 18, var->val, var->len <= 19 ? 0 : '+');
+ } break;
case IS_VAR:
case IS_TMP_VAR: {