From: krakjoe Date: Fri, 22 Nov 2013 09:56:17 +0000 (+0000) Subject: better info literal X-Git-Tag: php-5.6.0alpha1~110^2~143^2~5 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=46a67d15fe5d50d56c1372b0d2518cbe3e3cace3;p=php better info literal --- diff --git a/phpdbg_info.c b/phpdbg_info.c index a3a3f01989..4b98267ab0 100644 --- a/phpdbg_info.c +++ b/phpdbg_info.c @@ -18,9 +18,12 @@ */ #include "php.h" +#include "phpdbg.h" #include "phpdbg_utils.h" #include "phpdbg_info.h" +ZEND_EXTERN_MODULE_GLOBALS(phpdbg); + PHPDBG_INFO(files) /* {{{ */ { HashPosition pos; @@ -146,15 +149,32 @@ PHPDBG_INFO(vars) /* {{{ */ PHPDBG_INFO(literal) /* {{{ */ { - if (EG(in_execution) && EG(active_op_array)) { - zend_uint literal =0; - phpdbg_notice( - "Literal Constants %d", EG(active_op_array)->last_literal-1); + if ((EG(in_execution) && EG(active_op_array)) || PHPDBG_G(ops)) { + zend_op_array *ops = EG(active_op_array) ? EG(active_op_array) : PHPDBG_G(ops); + zend_uint literal =0, count = ops->last_literal-1; + + if (ops->function_name) { + if (ops->scope) { + phpdbg_notice( + "Literal Constants in %s::%s() (%d)", ops->scope->name, ops->function_name, count); + } else { + phpdbg_notice( + "Literal Constants in %s() (%d)", ops->function_name, count); + } + } else { + if (ops->filename) { + phpdbg_notice( + "Literal Constants in %s (%d)", ops->filename, count); + } else { + phpdbg_notice( + "Literal Constants @ %p (%d)", ops, count); + } + } - while (literal < EG(active_op_array)->last_literal) { + while (literal < ops->last_literal) { phpdbg_write("|-------- C%lu -------> [", literal); zend_print_zval( - &EG(active_op_array)->literals[literal].constant, 0); + &ops->literals[literal].constant, 0); phpdbg_write("]"); phpdbg_writeln(EMPTY); literal++;